[Closed] Setting node-based coordsys rotation
Hmm well it’s setting the values correctly, but I seem to be having some issues with how it interpolates between two poses – even if those are identical – where it will rotate the hand over time, even though the pose at frame 0 is identical to the one at frame 100.
I’m not sure if this is directly related to the issue of setting rotations, but I thought it might be. Any idea what might cause this? Axis order, or something else?
edit: hmm, it seems to sometimes “fix itself” if I load a default pose at frame 0, before or after using a pose at another frame.
You storing a value per-frame? or each keyframe – because i’m guessing you’ll want to store in the in/outTangents too – i.e the bezier handles for the key.
I’m storing the value at the current frame only. However, it seems I can’t use the simple route of storing the transform only, since it includes position data, which is not always desired – depends on which controller it is, IK controllers will want position data, most others will only need rotation data.
If I get the rotation like so:
savedRotation = (node.transform*inverse mainShape.transform).rotation
then what would be the correct way to set it – all of these are wrong:
node.transform.rotation = (savedRotation * mainShape.transform) <-- does nothing
node.rotation = (savedRotation * mainShape.transform) <-- does nothing
node.rotation = savedRotation <-- nodes all over the place
easy,
tm = obj.transform * inverse target.transform
apply rotation:
obj.rotation = (tm * target.transform).rotation
i’m sure it’s all about how you set the rotation value… if you have a rotation data in quaternions(matrix) you have to apply the data as quaternion…
I follow the procedure eek suggested, using
savedTransform = (node.transform*inverse mainShape.transform)
to save the value, and then using
node.transform = (savedTransform * mainShape.transform)
to restore it
Focus only on the rotation, if that’s all that you need saved?
savedRotation = (node.transform.rotation * inverse mainShape.transform.rotation)
node.transform.rotation = (savedRotation * mainShape.transform.rotation)