Page 1 of 1
Can you add multiple rotation keys to the same frame?
Posted: Wed Nov 15, 2023 4:03 am
by n00bc0de
I am trying to add 3 rotation keys to each frame (x,y, and z). Do I need to combine all my rotations into 1 key? I tried doing a rotation key for each axis but it only sets it for the first axis and ignores the other ones in that frame.
Re: Can you add multiple rotation keys to the same frame?
Posted: Wed Nov 15, 2023 11:15 am
by CuteAlien
Yeah, looking at CSkinnedMesh::getFrameData it only seems to take one index per frame. So they have indeed to be combined. I think you can directly do that with quaternions - multiply them in the order in which they need to be applied and you end up with a quaternion with the combined rotation (same with matrices if you work with those).
In theory the animation system could do that itself in it's cleanup where it calls stuff like dropBadKeys. Just would need another test for identical keys and then multiply them in the order in which they got added and remove all but first one. But would need a patch for that - for now you'll have to do this yourself.