Search Unity

Resolved Crash in Timeline with custom track for animation

Discussion in 'Timeline' started by FelipeReis, Oct 6, 2020.

  1. FelipeReis

    FelipeReis

    Joined:
    Jan 27, 2012
    Posts:
    38
    Hi, I'm trying to create a custom track to play animation,
    the way I did seems to work, but with big amount of clips it has a big chance to crash unity.



    What I did is create a clip script which contain the animation clip playable and in the
    TrackMixer I create and update all the animation mixer and animation layer mixers needed.

    During playback in the processframe of the trackmixer, I need to connect and disconnect the mixers, right now it seems to work, but with a big amount of clips(100+) its almost certain to crash after some seconds of
    playback.

    Any thoughts why is crashing?

    Code (CSharp):
    1. Received signal SIGSEGV
    2. Stack trace:
    3. 0x00007ff669292a50 (Unity) AnimationMixerPlayable::MixerProcess
    4. 0x00007ff66929546b (Unity) AnimationMixerPlayable::ProcessRootMotion
    5. 0x00007ff669292abe (Unity) AnimationMixerPlayable::MixerProcess
    6. 0x00007ff66929546b (Unity) AnimationMixerPlayable::ProcessRootMotion
    7. 0x00007ff6692a80aa (Unity) AnimationLayerMixerPlayable::LayerMixerProcess
    8. 0x00007ff6692a925a (Unity) AnimationLayerMixerPlayable::ProcessRootMotion
    9. 0x00007ff66920ad29 (Unity) `anonymous namespace'::ProcessPlayableGraph
    10. 0x00007ff66920b255 (Unity) Animator::ProcessRootMotionStep
    11. 0x00007ff66922fff3 (Unity) Animator::ProcessRootMotionJob
    12. 0x00007ff66922ec98 (Unity) UnityEngine::Animation::BlockRangeJob<Animator::AnimatorJob>::Job
    13. 0x00007ff66a2a8457 (Unity) JobQueue::Exec
    14. 0x00007ff66a2b0e0c (Unity) JobQueue::WaitForJobGroupID
    15. 0x00007ff66a297501 (Unity) CompleteFenceInternal
    16. 0x00007ff669239d56 (Unity) Animator::UpdateAvatars
    17. 0x00007ff66aa41d19 (Unity) DirectorManager::ExecuteProcessCallbacks
    18. 0x00007ff66aa424bf (Unity) `DirectorManager::InitializeClass'::`2'::PreLateUpdateDirectorUpdateAnimationBeginRegistrator::Forward
    19. 0x00007ff66a3b41bc (Unity) ExecutePlayerLoop
    20. 0x00007ff66a3b4293 (Unity) ExecutePlayerLoop
    21. 0x00007ff66a3bb259 (Unity) PlayerLoop
    22. 0x00007ff66b7b77a1 (Unity) PlayerLoopController::UpdateScene
    23. 0x00007ff66b7b5487 (Unity) Application::TickTimer
    24. 0x00007ff66c10237f (Unity) MainMessageLoop
    25. 0x00007ff66c1062e1 (Unity) WinMain
    26. 0x00007ff66df00796 (Unity) __scrt_common_main_seh
    27. 0x00007ffb18337bd4 (KERNEL32) BaseThreadInitThunk
    28. 0x00007ffb18e6ce51 (ntdll) RtlUserThreadStart
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Try moving the connection/disconnection code of playables to PrepareFrame instead of ProcessFrame.That might fix this issue (but of course, also feel free to file a bug report).

    I am guessing you are manipulating the animation graph on one thread while it is being updated on another. Is your playable behaviour to change the connections from a different track?
     
  3. FelipeReis

    FelipeReis

    Joined:
    Jan 27, 2012
    Posts:
    38
    Okay, I will try it out.
    No, I am creating the animation output and mixers in the playable graph that comes from process frame function.
     
  4. FelipeReis

    FelipeReis

    Joined:
    Jan 27, 2012
    Posts:
    38
    Ahh it works, thank you so much!