Reporting in case a problem with sequences beta - not sure. I use “RigBuilder” from Animation Rigging 1.0.3 (Unity package to allow you to do overrides in a timeline, Animation Rigging | Animation Rigging | 0.2.7-preview). But as I flip around my scene with sequences, I am seeing the error below in the log. I am wondering if jumping between timelines is getting it confused
The stack trace is
MissingReferenceException: The object of type ‘RigBuilder’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Animations.Rigging.RigBuilder.StopPreview () (at Library/PackageCache/com.unity.animation.rigging@1.0.3/Runtime/AnimationRig/RigBuilder.cs:157)
UnityEditor.Timeline.WindowState.OnStopPreview () (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/State/WindowState.cs:994)
UnityEditor.Timeline.WindowState.set_previewMode (System.Boolean value) (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/State/WindowState.cs:253)
UnityEditor.Timeline.WindowState.Reset () (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/State/WindowState.cs:440)
UnityEditor.Timeline.TimelineWindow.OnBeforeSequenceChange () (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/Window/TimelineWindow_ActiveTimeline.cs:52)
UnityEditor.Timeline.WindowState.SetCurrentSequence (UnityEngine.Timeline.TimelineAsset timelineAsset, UnityEngine.Playables.PlayableDirector director, UnityEngine.Timeline.TimelineClip hostClip) (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/State/WindowState.cs:377)
UnityEditor.Timeline.TimelineWindow.SetCurrentTimeline (UnityEngine.Timeline.TimelineAsset seq, UnityEngine.Playables.PlayableDirector instanceOfDirector, UnityEngine.Timeline.TimelineClip hostClip, System.Boolean force) (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/Window/TimelineWindow_ActiveTimeline.cs:43)
UnityEditor.Timeline.TimelineWindow.SetCurrentTimeline (UnityEngine.Playables.PlayableDirector director, UnityEngine.Timeline.TimelineClip hostClip) (at Library/PackageCache/com.unity.timeline@1.5.2/Editor/Window/TimelineWindow_ActiveTimeline.cs:29)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEditor.Sequences.TimelineUtility.PushItemIntoBreadcrumb (UnityEngine.Playables.PlayableDirector director, UnityEngine.Timeline.TimelineClip hostClip) (at Packages/com.unity.sequences@1.0.0-pre.6/Editor/Utilities/TimelineUtility.cs:111)
UnityEditor.Sequences.TimelineUtility.RefreshBreadcrumb (UnityEditor.Sequences.TimelineUtility+TimelinePath path) (at Packages/com.unity.sequences@1.0.0-pre.6/Editor/Utilities/TimelineUtility.cs:133)
UnityEditor.Sequences.SelectionUtility.TrySetTimelineInContextOf (UnityEngine.Playables.PlayableDirector director) (at Packages/com.unity.sequences@1.0.0-pre.6/Editor/Utilities/SelectionUtility.cs:137)
UnityEditor.Sequences.SelectionUtility.OnEditorSelectionChanged () (at Packages/com.unity.sequences@1.0.0-pre.6/Editor/Utilities/SelectionUtility.cs:83)
UnityEditor.Selection.Internal_CallSelectionChanged () (at <9540aba417024bb296674f70fa788b73>:0)
The section of code appears to be:
void OnStopPreview()
{
if (m_PreviewedComponents != null)
{
foreach (var previewComponent in m_PreviewedComponents)
{
if (previewComponent != null)
{
previewComponent.StopPreview();
}
}
m_PreviewedComponents = null;
}
It appears the RigBuilder instance has been destroyed, but it is still in the previewComponent list.
I don’t have precise instructions to repeat sorry - the following is to the best of my memory. I have a character with the RigBuilder script in the scene (the only character so far) and dropped a walk animation clip onto it. Hmmm, to be precise, I added “Bear” (character’s name) into the scene first using Sequence Assembly, then deleted the Sequence Asset Track from the timeline and added my own Animation Track so I could drop the animation clips directly into it (rather than creating a variant per animation). But then I realized I needed to use “Bear carrying Bag” (a variant of Bear). I used Sequence Assembly to pick the variant. This deleted Bear from the scene and added Bear carrying Bag, but that messed up the animation track as Bear was deleted. I was trying to drop the new Bear carrying Bag from the scene into the timeline for that animation track but it was failing. That is when I noticed the error message. So maybe the problem was swapping the character Bear with a variant Bear carrying Bag got things confused as my timeline was still using the old object…???
Notice in the timeline I also have “Bear” as a track under Character but it references “Bear carrying Bag” - I think that got added back in when I swapped the character from “Bear” to the variant “Bear carrying Bag”.
But I cannot now delete the “Bear” track above (I pick “Delete” from right clicking, but it does not delete and I get the error in the Console) and I cannot drop “Bear-v11-2 Prefab Variant” under “Bear carrying Bag” in the scene into the first track under “Character” (where it says “None (Animator)”) - again nothing happens (except error is added to the log).
I will restart Unity and try again later - capturing details while I can.