• Editor
  • Animation - Is "Closing out" a timeline necessary?

Hello,
Is "Closing out" a timeline necessary? Especially if you have multiple animations that will fire?
Meaning, is it necessary to copy paste all last keyframes at the end of a sequence to "close it out" so that transitions or blends will be smoother? My tech artist said i needed to do this, but it can be time consuming.

example 1 not closed out = some last keys are mid timeline

example 2 closed out = all last keys that might fall mid timeline are copied and pasted to the end to "close it out."

Related Discussions
...

You definitely don't need to key everything at the end of the animation. Fewer keys is better.

Spine shows lines between keys that have different values. The kind of line tells you the interpolation used between the keys: dashed for stepped, straight for linear, and straight with little curved ends for Bezier.

When there is no line, it means the values are the same. In you screenshot, there is no line between the translate, scale, and shear keys. Since they all have the same values, you can delete all the keys except for the keys on frame 0. If your keys on frame 0 are the same as the setup pose, you can delete those too.

You can use animation clean up to automatically delete unnecessary keys. Note it can't be used for animations intended to be played on higher tracks, as described there.

Fewer keys means less data needs to be processed to apply the animation at runtime. The difference is very small, but can add up to a lot with many animations and skeletons.

@Nate ,
Thanks for the reply. I am referring to instances where several animations would blend from one animation to another at runtime.Will not having "closed keys" on each timeline make for strange blending between animation interpolations?

Mixing between animations does not require keys on the last frame of an animation. Nothing requires that.

@Nate. Fantastic ! Thanks so much. I appreciate the quick response.

Howdy! I don't know if this info is out of date, but just wanted to mention that I've seen extremely dire warnings to Game Maker users to ensure to always, without exception, keyframe R/T/S at the beginning and end of every single Spine animation. Game Maker only works with the 3.7 runtime, so not sure if that's changed if you're able to use a newer runtime.
If you are working on a project in which you have Spine animations interrupting other animations, outside of Spine itself, it might be a good idea to do some tests before you commit either way.

Testing is never a bad idea. I can't say off the top of my head if 3.7 has some quirks that would require extra keys to be set, but definitely it should not be needed in 3.8+. Last I heard GameMaker was in progress moving to 4.0, FWIW.

I heard the same, looking forward to it!

I can confirm a time that you do need to close it off is when using changing colors with the 'Tint Black' option on slots within Unity. Otherwise, once it does a full loop on an animation, any slot using the Tint Black will turn black

Also, the Animation CleanUp export seems to erase color keys on the beginning and end so you have to use the manual animation cleanup first, then lay down a row of keys before exporting with Animation Cleanup off.

Not relevant to what you're doing now but something to look out for.

Applying an animation in the Spine Runtimes changes the state of the skeleton. In older versions of Spine, a previous animation may have left the skeleton in a weird state, wrecking subsequent animations. This led to adding lots of keys on frame 0 and as I mentioned, lots of keys isn't good!

I don't remember off the top of my head in what version we changed this, but in 3.8+ when using AnimationState if you have been applying an animation and that animation will no longer be applied, then it resets all the state that the animation changed back to the setup pose. This ensures that subsequent animations are applied on top of a known state. You no longer need to key everything on frame 0.

stikkanimate escribió

I can confirm a time that you do need to close it off is when using changing colors with the 'Tint Black' option on slots within Unity. Otherwise, once it does a full loop on an animation, any slot using the Tint Black will turn black

This starts to get tricky because there are many ways to apply an animation.

When an animation is applied, all state that the animation changes (eg slot color) is set by the animation, though there are some slight differences when there is no key on frame 0:

If your animation is on the lowest track (or is the lowest track that keys that slot's color), then before the first key you get the setup pose color.

If your looping animation was on a higher track (ie a lower track keys that slot's color), then you'll get the slot color from the previous loop until the first key on the higher track. If you don't want this, you'd set a key on frame 0. Note that either way you don't need a key on the last frame.

stikkanimate escribió

Also, the Animation CleanUp export seems to erase color keys on the beginning and end so you have to use the manual animation cleanup first, then lay down a row of keys before exporting with Animation Cleanup off.

There are numerous rules, but animation clean up is safe to use in all cases when the animation will be applied on the lowest track. It will delete slot color keys at the start/end if they are the same as the setup pose's slot color.

If your animation is intended for use on a higher track, then animation clean up may delete keys that you need to prevent the lower track from showing. In that case unfortunately you don't want to use animation clean up. We don't yet have a way to mark keys as "protected" so animation clean up won't delete them. We plan to add that in v4.1.

Ahh good to know the exact reason! I don't have hands-on experience with track usage in Unity - except the game jumps between many animation states per character very often so I can only assume this is the matter when it comes to some animations. I'll bookmark this so I can come back to it on my own work. Thanks Nate!

Sure, no problem! :beer: