What exactly does AnimationPlayer's "Optimize Animation" and "Bake Animation" do?

Godot Version

4.2.1 - Mono (But applies to any latest version)

Question

I’ve been trying to find some more infromation about these 2 options, but I couldn’t find anything about them in the docs, and if I search for them, especially optimize, I only find general optimization tips, but absolutely nothing about this specific option in the AnimationPlayer node. What do these do exactly, when should they be used, and are they even relevant for 2D animations that just animate from a SpriteSheet?

These options are mostly used for 3D animations.

Bake animation will bake the tracks keyframes to the selected fps creating a keyframe each frame interpolating the values from the original keyframes. So if you have a 1 second animation with 2 keyframes one at 0.0 and another at 1.0 it will create keyframes between the original keyframes interpolating the values with the separation between keyframes that you set in the FPS. If you set it to 30 FPS each 0.0333 seconds it will add a keyframe. If you set it to 60 FPS each 0.0166 seconds it will add a keyframe.

Optimize animation will remove keyframes which difference is lower than the max error values. So if you have 3 keyframes 3.0, 3.07, 3.1 really close together depending on the settings you set in the popup dialog the keyframe 3.07 may get deleted.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.