- Home /
How to refresh timeline after update to AnimationClip
I am working on some editor tools for recording object motion. In the editor, at playtime I have a script that generates new AnimationCurves for an Animation Clip thats on the timeline. The problem is that after I have updated it, changes are reflected in the timeline playback until after I exit playmode.
I have tried have the director rebuild the graph, as well as asking the asset database to save all changes. What do I need to do to get the timeline to update immediately?
Answer by seant_unity · Oct 09, 2018 at 06:04 PM
You can do this in 2018.3 using a new API call: https://docs.unity3d.com/2018.3/Documentation/ScriptReference/Timeline.TimelineEditor.Refresh.html.
Before that you could un-select and re-select the playable Director, which only works if the timeline window isn't locked.
I tried manually clicking something else and then reselecting the timeline object with the Playable Director on it, but it didn't help
try calling https://docs.unity3d.com/ScriptReference/Animator.Rebind.html, depending on the version of Unity that may be necessary when changing clips.