• Editor
  • Possible to bake animations?

Related Discussions
...

I'm just wondering if this is possible. I have a bunch of ik and constraints in a file and am wondering if the motion could be "baked" onto the affected bones so that I could get it "close enough" with ik, bake, then animate the rest with fk. Also not sure if there is overhead to using ik at runtime (or potential issues blending animations which may mix ik and fk)

Yes, but it is not automated. If you have bones controlled by IK, you can select them and key their rotation. This creates FK rotation keys using the rotation value that the IK calculated. These keys are applied and then overridden by the IK constraint, but if you delete the IK constraint or change it's mix to <100, then you'll see the rotation from the FK keys. You'll need to decide how often you want to set FK keys in your animation to get a reasonable approximation of the IK.

Like anything, there is of course overhead when using IK at runtime, but it is very unlikely to be a bottleneck. It's 2 dozen multiplies and a couple trig calls (sqrt, acos, atan2). About twice the work is done to solve IK if the parent IK bone has nonuniform scale, but even that is minimal compared to the other work done to apply an animation and pose a skeleton, and that entire amount of work is likely minimal compared to your application logic and rendering.

I'm not sure you'd see issues blending animations which mix IK and FK. You could use the Preview view for this.

Nate wrote

Yes, but it is not automated. If you have bones controlled by IK, you can select them and key their rotation. This creates FK rotation keys using the rotation value that the IK calculated. These keys are applied and then overridden by the IK constraint, but if you delete the IK constraint or change it's mix to <100, then you'll see the rotation from the FK keys. You'll need to decide how often you want to set FK keys in your animation to get a reasonable approximation of the IK.

Okay, I didn't realize this... I think that it doesn't auto-key rotations in this case so you need to manually click the key. But it does what I was looking for.

Yep, auto key only keys what changes. You wouldn't want IK to cause a bunch of FK rotation keys as you scrub! 😃

3달 후

Hi,

we are using a runtime which doesnt yet support Spine IK.
Is there any chance of getting a "bake animation" button?
Or is there any possibility to create a script which does this?
It's a small app, with an animation hard to tackle without IK, so just plain baking every frame would be sufficient I think (shouldn't cause performance troubles).

Thanks!

We don't have a way to automate baking IK, sorry. You could do it manually by using IK, then keying the bone at each frame, then removing IK. Else you could export to JSON and write a script to pose the skeleton for each frame of an animation, create rotation keys for the IK bones, and then remove the IK. This script is for something else, but shows how it can be easily to dig around in the JSON and write it out again. This script shows how to load a skeleton, go through its animations, and access the bone transforms.

Hi,
thanks for the fast reply, I'll take a look at it!