|
Hi,
I’m going a bit nuts. After trying many different solutions I have ended up using a constraint to transfer rotation from one object to another. This should only be temporary so I want to key the constrained object to it’s new value, and then delete the constraint. Problem is keying is done with the old value, disregarding the constraint and the current rotation of the object.
This is the snippet that doesn’t work, from activiatingthe constraint:
cnst.SetActive(True)
FBSystem().Scene.Evaluate()
lAnimNodes = mGRBD.AnimationNode.Nodes for lNode in lAnimNodes:
if (lNode.Name == 'Lcl Rotation'):
lNode.KeyCandidate()
cnst.FBDelete()
The constraint works, but not the keying. Any ideas?
Clarification: It sets a key, but with the value it would have been without the constraint.
/Claes
|
|
|
|
A little around the topic - but why you need to use constraint to transfer rotation? Can you explain it, so maybe I will be able to help you?
As for keying. I think solution that could work (untested) is getting rotation vector for a model after you activate constraint and evaluate scene. And then you can add this value to FBAnimationNode by KeyAdd(...).
Cheers
|
|
|
|
When getting the values directly sometimes it flipped. Probably becuase there are close-to-180 on X and Z. Only want to rotate around Y.
I was 100% sure I tried what you suggested, to get the values on the object itself after it was constrained, but I couldn’t have, becuse it works! Thanks :)
/Claes
|
|
|