MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set effector translation using python?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
1284933037
416 Views, 2 Replies

How to set effector translation using python?

I want to change the world position of effector.first,I get the effector

 

TargetCharacter = lApp.CurrentCharacter
rigEffector_L = TargetCharacter.GetEffectorModel(FBEffectorId.kFBLeftKneeEffectorId)

 

then, I sucess get the world position of the effector

 

world_pos = FBVector3d()   
rigEffector_L.GetVector(world_pos , FBModelTransformationType.kModelTransformation, True)
print(world_pos )

 

 the finally,i try to set new world position of the effector,but failed

 

world_pos2=FBVector3d(world_pos[0],world_pos[1],0)
print(world_pos2)
rigEffector_L.SetVector(world_pos2, FBModelTransformationType.kModelTransformation, True)

 

,nothing happened .

then I try to set the new value in animation curve,but something happened I cant understand,

1284933037_0-1722604933619.png

the curve key value had change,but the properties didnt change,I  was confusion.

2 REPLIES 2
Message 2 of 3
damian.pajda
in reply to: 1284933037

have you used
FBSystem().Scene.Evaluate()
after setting Vector? This function is important after functions like SetVector or SetMatrix, because it updates whole scene after setting transformations programatically.
 
BTW. if you want to get position vector then it would be better to use this attribute 
FBModelTransformationType.kModelTranslation instead of FBModelTransformationType.kModelTransformation.
kModelTranslation - means position
kModelTransformation - means whole obj transform (position, rotation and scale)
 
Message 3 of 3
1284933037
in reply to: damian.pajda

thanks for your attention ,your suggestion seemed work here

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report