I’m having an issue where a characters pose gets reset when binding to a timeline at runtime.It then blends into the timeline animation track from the wrong pose instead of what the Animator was playing. The pose seems to be the same one you see when configuring muscle settings for an avatar.
It doesn’t do it for all timelines that are handled the same way but it happens to a few.
This shows what happens. The second frame is when the timeline binding occurs.
I don’t have a solution for this but can +1 this also happens constantly to me. I’m not doing any sort of runtime binding, though. Steps to repro are:
Have a PlayableDirector attached to a GameObject with an Animator targeting a Humanoid rig,
Disable PlayableDirector.PlayOnAwake
Click the GameObject, which puts the PlayableDirector into Preview mode and sets the Animator state to whatever clip is playing on the Timeline
Enter PlayMode: observe the character is stuck in neutral muscle pose until the Timeline is played
This only happens when the PlayableDirector has been put into Preview mode at least one time since the last time PlayMode was entered, and will happen even if Preview is not enabled and/or the PlayableDirector does not have focus in the Inspector when PlayMode is entered. The “fix” for me is to always start PlayMode twice… The first time I start PlayMode, Animator gets initialized in the bad state, the second time - as long as I don’t click on the object with the PlayableDirector attached - it will start without issue.
Of additional note: When I start PlayMode with my PlayableDirector object selected in the Hierarchy, the Inspector panel reports “This object only exists at Runtime,” which is an interesting thing to say when I am in Runtime. Reselecting the GameObject causes the Inspector to redraw appropriately. I suspect whatever hacky shenanigans are happening inside the #if UNITY_EDITOR blocks in AnimationTrack are worth a look. Especially lines 927-929 (in v1.7.5) which look particularly sus to me:
// Create default pose clip from collected properties
if (hasHumanMotion)
animClips.Add(GetDefaultHumanoidClip());
Thanks for the additional info. I was going to try pre binding the player to the timeline next time I have a chance but it seems like it might still be an issue? In my case I’m not actively modifying the timeline although I do have the timeline window open. If it is somehow related to the editor preview mode I might need to see if the issue persists in an actual build.
EDIT: After checking that anim referenced in GetDefaultHumanoidClip it is the t-pose anim that you see when blending in/out of a timeline. So for me at least that doesn’t seem the be the issue. If someone knows where the muscle pose animation comes from that might help narrow down the source of the problem.
For us, this occurs with any timeline that is animating a rigged character. Once you’ve previewed the timeline, the character will be stuck in the pose the next time you enter playmode. All bindings are set manually, they’re never changed