ZhangHuan

Spine version 3.8.99
Unity version 2018.4.30f1
There are two spine animation in TestSpineScene.scene, one used "animation clean up" when export from spine, another without.
Both of them play "idle" animation, and then play "appear" animation.
添付ファイルを見るにはパーミッションが必要です
ZhangHuan
  • 記事: 6

Harald

Thanks for reporting. Please note that Animation cleanup will remove keys that are identical to the setup pose. This is not always what you want, so in many cases you will need to disable Animation cleanup.
アバター
Harald

Harri
  • 記事: 3353

Nate

Animation clean up should always be safe to use on the lowest AnimationState track. If using an animation on a higher track, clean up may delete keys you need.

We'll take a look at your files and get back to you soon!
アバター
Nate

Nate
  • 記事: 11350

ZhangHuan

Thanks, it looks like remove keys that are identical to the setup pose.
I find this in guide:
"In the future Spine will allow marking keys as "protected" so Clean Up will not remove them."
In my opinion, most of users need "protected" and "don't clear first key" when they choose Clean Up.
ZhangHuan
  • 記事: 6

Nate

Yep, that feature will help!

You shouldn't need any key protection when using clean up when your animation will be used on the lowest track. If clean up causes a problem for the lowest track, we'd like to see the project file (before clean up).
アバター
Nate

Nate
  • 記事: 11350

ZhangHuan

my code like:
m_SkeletonAnimation.AnimationState.ClearTracks();
m_SkeletonAnimation.AnimationState.Update(0);

m_SkeletonAnimation.AnimationState.SetAnimation(0, appearAnim, false); // invoke spine animation
track index equal 0.

Spine project file in spine.zip without clean up. I only use it in export.
ZhangHuan
  • 記事: 6

Nate

If you only set an animation on a single track number (zero in your code above) then animation clean up should not wreck your animations. Can you please send us the project file (we don't need the images) and tell us the name of the animation that has the problem? contact@esotericsoftware.com
アバター
Nate

Nate
  • 記事: 11350

ZhangHuan

I can't understand.
I have upload two file in the first time.
spine.zip contains:
area101_center_decor_2.spine // spine project, 3.8.99
Animation/* // export without clean up
AnimationCleanUp/* // export and clean up

TestSpine.zip contains unity project
Play TestSpineScene.scene can trigger this problem.
Did I miss anything?
ZhangHuan
  • 記事: 6

Nate

I'm very sorry! I missed your attachments in the first post. I tried the exports in the "Animation" and "AnimationCleanUp" folders with the 3.8.99 Skeleton Viewer and the animations render exactly the same.

Looking at your code, the problem is this line:
m_SkeletonAnimation.AnimationState.ClearTracks();
See TrackEntry clearTracks:
Removes all animations from all tracks, leaving skeletons in their current pose.
You are playing the idle animation, then clearing all tracks, leaving the skeleton in the idle animation pose. You then play the appear animation, which will only pose the skeleton for the timelines it has. appear doesn't key all the same timelines that idle does, so some of the skeleton pose is left in the idle pose.

The problem is as Harald said: when you use animation clean up, it removes keys for the setup pose. Normally this is not a problem, but you have left the skeleton in the idle pose by using ClearTracks.

You could use SetToSetupPose after ClearTracks. However, there is no reason to call ClearTracks at all. You can just call SetAnimation to play appear. AnimationState handles resetting everything back to the setup pose when an animation (idle in this case) will no longer be applied.
アバター
Nate

Nate
  • 記事: 11350

ZhangHuan

Thanks! I have used "ClearTracks" to force delete animation mix. It's my fault.
ZhangHuan
  • 記事: 6

Nate

No worries, it's good to understand why it does what it does. You can set the mix duration:
TrackEntry entry = m_SkeletonAnimation.AnimationState.SetAnimation(0, appearAnim, false);
entry.MixDuration = 0;
アバター
Nate

Nate
  • 記事: 11350


Return to Bugs