|
Hey,
In the asset browser, I can see that my position constraint has a property called ‘Translation’; this is the value I want to get with my script.
I’ve tried going about this in much the same way that I would go about getting the translation value for an FBCamera object (for example), but I am always returned an error:
from pyfbsdk import *
allConstraints=FBSystem().Scene.Constraints for constraintLoop in allConstraints:
if constraintLoop.Name == "My Position Constraint":
print "Found your position constraint..."
yourConstraint = constraintLoop
positionConstraintOffset = yourConstraint.Translation
Im sure there is a way to get this value, any help would be much appreciated!
Thanks!
|
|
|
|
Most attributes are hidden in the property list. There is no “Translation” object attribute for FBConstraint types since not all constraints have this.
So to find the information you are looking for you would simply find it in the property list:
from pyfbsdk import *
allConstraints=FBSystem().Scene.Constraints for constraintLoop in allConstraints:
if constraintLoop.Name == "My Position Constraint":
print "Found your position constraint..."
yourConstraint = constraintLoop
positionConstraintOffset = yourConstraint.PropertyList.Find("Translation").Data
This will return you a FBVector3d object.
Suggestion… break out of the loop once you found the correct constraint to conserve time
Cheers,
Scott
|
|
|