Case 573355
I’ll be looking forward to it! Dynamically editing/reloading keyframes with scripts has some potential…
This issue still reproduces on Unity 4.3.
Resaved/reloaded animation clips are not correctly looping at the right time. Yet I can hit play on the animation and loop properly.
Even if I delete the mechanim state and re-add the animation, the time is still incorrect.
Reloading the project no longer fixes the issue.
And the animation viewer shows 6.2 seconds worth of keyframes. Yet now it keeps looping at 1 sec.
Playing the animation from the animation window with the play button displays correctly…
Case 573355Repro Project Included
Repro video: http://www.youtube.com/watch?v=rdFgboCamqk
For the most part the Animation API and Mechanim lets you do some great things.
I’m just having a minor issue with detecting external changes as shown by the video.
-
The Mechanim/Animation window needs to repaint after detecting the AnimationClip that you are looking at changed. I.e. The 12 second clip should immediately refresh the keyframes to show 1.5 seconds.
-
There’s an internal mechanim state issue clipping the looping on the shortened animation clip. Some field that wasn’t updated for the new time perhaps. As you can see playing the animation plays correctly.
Moving a Keyframe in the Animation window to get the internal state to update is a workaround, but I really want this to be automatic. If there’s too many manual steps it will break your concentration…
====
Bug Report:
- What happened
Mechanim isn’t auto reloading animation clip changes as expected.
The Animation window needs to repaint after an animation clip has changed.
And then the internal state of mechanim doesn’t completely reload the animation times.
- How can we reproduce it using the example you attached
Repro video: http://www.youtube.com/watch?v=rdFgboCamqk
Use the example scene: Scenes/TheScene
-
Open the clip editor from Window->Open AnimationClip Editor
-
Select the original animation clip, adjust the length
-
Click Save Animation and name the new clip.
-
Setup The animation controller to use the new saved animation clip
-
If you use Save Again Animation with different time lengths you’ll see a couple issues.
A. The animation window doesn’t refresh when an animationclip change is detected.
B. The looping animation in play mode isn’t looping with the right time.
C. If you click play the animation in the animation tab it animates correct.
D. If you move an animation frame play mode plays correctly.
The internal state of mechanim should refresh when an animation clip change is detected.
This way I can get instance feedback for my external keyframe changes.