Search Unity

ProcessFrame not working?

Discussion in 'Timeline' started by chenxiayun, May 10, 2022.

  1. chenxiayun

    chenxiayun

    Joined:
    Nov 12, 2021
    Posts:
    1
    My animation is perfectly normal on the clip slide. But when I suddenly break away from the animation and click outside the clip, my animation remains the same as before. I want it to return to the beginning or the end of the time point. What should I do?
    upload_2022-5-10_17-26-42.png
    When I click on the red area, ProcessFrame doesn't work. What do I do to keep it working?
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Its so annoying because I remember reading a post or video about this just last week but don't remember the exact details. I assume you are doing a custom track? Do you have a mixer class? I was trying to remember it was something like "you need to have a mixer that copes with zero clips". You can put a ProcessFrame() function on the PlayableBehavior for a single clip, but if you want to support blending between clips, you need another "mixer" PlayableBehavior to combine multiple clip playable behaviors to produce the final value to actually use. This mixer is created by the CreateTrackMixer() method of your TrackAsset. I vaguely remember something like to get the default when no clip is present, you need to create a mixer so it can see "there are zero clips here - I will use defaults then". But I am not sure to be honest. (I wish I kept the blog post link now!)