Search Unity

Using AnimationMixer for Timelines - hit a crash

Discussion in 'Timeline' started by panta, Aug 8, 2018.

  1. panta

    panta

    Joined:
    Aug 10, 2012
    Posts:
    71
    I'm using a Playable Graph to mix together an AnimatorControllerPlayable (for our character's locomotion) and several TimelinePlayables (for the character's abilities/skills). Usually, the character is animating via the AnimatorControllerPlayable, but when we perform an ability/skill, we mix the timeline animation into the PlayableGraph. The crash happens right after the TimelinePlayable is crossfaded to. Our TimelinePlayables are quite complex, consisting of character animations, gameplay events, audio, and VFX.

    This has worked well so far, but recently I've hit a crash that's fairly reliable (Editor crashes almost every time I run the game).

    I've attached the crash dump logs and file to this forum post, as well as copied the stack below:
    Code (CSharp):
    1. ========== OUTPUTTING STACK TRACE ==================
    2.  
    3. 0x0000000141A15C3C (Unity) AnimationLayerMixerPlayable::LayerMixerProcess
    4. 0x0000000141A1703A (Unity) AnimationLayerMixerPlayable::ProcessAnimation
    5. 0x0000000141A17119 (Unity) AnimationPlayable::ProcessAnimation
    6. 0x0000000141A16574 (Unity) AnimationMixerPlayable::MixerProcess
    7. 0x0000000141A170AE (Unity) AnimationMixerPlayable::ProcessAnimation
    8. 0x00000001419CF4E3 (Unity) `anonymous namespace'::ProcessPlayableGraph
    9. 0x00000001419CF0C7 (Unity) Animator::ProcessAnimationsStep
    10. 0x00000001419CEE3A (Unity) Animator::ProcessAnimationsJob
    11. 0x00000001408A90B0 (Unity) JobQueue::Exec
    12. 0x00000001408A937E (Unity) JobQueue::ExecuteJobFromHighPriorityStack
    13. 0x00000001408A9813 (Unity) JobQueue::ProcessJobs
    14. 0x00000001408AB6E9 (Unity) JobQueue::WorkLoop
    15. 0x0000000140A85678 (Unity) Thread::RunThreadWrapper
    16. 0x00007FFDB6423034 (KERNEL32) BaseThreadInitThunk
    17. 0x00007FFDB7DE1431 (ntdll) RtlUserThreadStart
    18.  
    19. ========== END OF STACKTRACE ===========
    I've noticed this crash only occurs when I remove a TimelinePlayable from my PlayableBehaviour that is controlling my animation mixing. Here's the snippet that does the removal:
    upload_2018-8-7_18-56-59.png

    My code is pretty heavily based on the Unity SimpleAnimation sample, which also does removal of Playables from the graph, but it seems to do it only after pausing the playables and (unlike my code) removal never happens on the same ProcessFrame as when the playable was stopped.

    Is there something about the way I'm removing the playable that causes the whole Editor to crash like this? Does this look like any known issue that the team has seen before?

    It would be very difficult to make a min repro of this, due to the fact that it's very wrapped up in our game's system, but if a Unity dev would be willing to look at it, I could make one.

    Thank you!
     

    Attached Files:

    Last edited: Aug 8, 2018
  2. panta

    panta

    Joined:
    Aug 10, 2012
    Posts:
    71
    Found the root cause - I was plugging an animator controller into the animator when I began the blend to a Timeline in my playableGraph, as was suggested by @seant_unity in this thread about root motion and timelines:
    https://forum.unity.com/threads/obj...w-mode-vs-scene-playback.483435/#post-3574896

    If I comment out this line of code, there is no longer any crash (but my character warps to 0,0,0 as soon as the Timeline starts playing instead of animating the Timeline from its current position). Weirdly enough, the crash doesn't happen if I blend to a Timeline from the default state in my animator controller.

    Is it confirmed that 2018.3 will have an option for timelines to animate from the current local position without having to do these hacks with the animator/animatorcontrollers? If so, I could avoid this crash altogether...