However I can’t seem to figure out how to add a keyframe to an animation curve as a matrix directly. I wouldn’t even mind doing each matrix value ([0, 0]; [0, 1]; ..) separately if need be. I just basically want to forward these matrices directly into the animations, add one keyframe per. I’m doing a workaround right now but the rotations are weird:
My rotations are not correct; they simply spazz out all over the place when my original animation just contained a simple “Spin” around the y-axis.
Am I even animating this correctly?
Any help would be greatly appreciated, thanks!
EDIT: I increased the time between keyframes to 1 second just to see what was happening better. It appears that each keyframe STARTS correctly, where it should be for that frame; it’s the in-between interpolation that causes the “spazzing”.
Should just be 120-degree rotation around the y-axis. But GetR() above returns (180, 60, 180). These two rotations are actually identical and would produce the same matrix, but the problem is that when I animate the rotation components (x, y, z) separately, it thinks it needs to do a full 180 for x and z and thus interpolates it as such, causing the “spazzing”. So even though it ends up where it needs to each time, the journey there looks very odd. Is there a way to animate the full rotation and have it interpolate properly, instead of each individual component?
Just to clarify, in the original program there was no interpolation; it’s very old and it just played each keyframe directly. It’d be nice to add in proper interpolation now, and modernize the look a little bit, but I suppose not a necessity. So somehow disabling interpolation for this FBX file would work too, if there’s a way.
You may try to use FbxAnimCurveFilterUnroll::Apply to unroll the animation curves.