Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Sequences corrupted during upgrade from 2022.1 to 2022.2b8

Discussion in '2022.2 Beta' started by akent99, Sep 16, 2022.

  1. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I upgraded a project from 2022.1 to 2022.2b8 (uses the Unity Sequences package) and the "Sequences" window only shows the top level master sequences - all the subsequences are gone. I also cannot click on any sequences to activate them.

    I initially posted this in the Timeline section, but realized this area is probably better - sorry for the duplicate! https://forum.unity.com/threads/sequences-and-2022-2b8-scripting-api-changes.1336739/

    It looks like Sequences got a bit of rework, so maybe the internal format has changed needed a different upgrade approach?
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    One update. I noticed hunting through objects saved on disk that the "EditorialPlayableAsset" had a new m_Timeline property. I tried to set this on my old object and got a child appearing (so it had some kind of effect, but did not cause the whole hierarchy to appear). But I think I have to update somewhere that is storing the "Sequences" hierarchy, and have not worked out where that is yet.
     
  3. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Another update. I created a new simple project, created sequences (nothing in them), upgraded from 2022.1f1 to 2022.2b8 and it worked.

    As a quick hack, I copied the Sequences directory from my old project into the new project Sequences folder and started it up - it found the master sequences, but no children. So something about my old sequences is causing a problem during upgrades. But I have a small upload now and have uploaded it as a bug (IN-16951).

    upload_2022-9-17_12-47-27.png
     
    Last edited: Sep 17, 2022
  4. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Thanks for reporting it! We'll look into it!

    We indeed changed a bit our data model between Sequences 1.1.0 and 2.0.0. Sequences are still Timeline assets, however we changed the way we store the parenting information between timelines (sequences). From our tests it didn't cause any problem but we don't necessarily have the ability to test on very diverse projects.

    Can you tell me which version of Sequences you're now using? I would guess it is 2.0.0-pre.2, right?

    I can suggest 2 things to maybe fix your issue (hopefully one will work):
    1. In the Project window, try to "Reimport" your Sequences' Timeline. You can select the Timeline asset(s) you wish to re-import, right click, "Reimport".
    2. If it's still not good, then looking at the editorial clip's binding is also a good avenue to explore. I would assume from what you're saying that all the binding to the playable directors are still correct. However the binding to the m_Timeline property is empty? It is a bit cumbersome but could you try setting one or 2 (or re-setting the playable director property could also work) and see if then you see them appear in the Sequences window? Also, you might need to "refresh" the Sequences window to be sure you see the effect of what you're doing. It should always refresh when needed, but as it is a specific case, I would suggest closing and re-opening the window to be sure.
    Let me know if those can help workaround your issue.

    We also have a version 2.0.0 of Sequences released. It should come with 2022.2.0b9, but you can already access it. In the Package Manager, at the top left corner of the window, you can use the "+" button to add the package by name "com.unity.sequences" and it should install 2.0.0. It's possible we already fixed some things there that could help as well.
     
  5. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I am using Sequences 2.0.0-pre.2 (basically, I am using the "Cinematic Studio" feature set, so that is the version it picked for 2022.2b8).

    I clicked on the master timeline and selected "reimport". It was already in the Sequences panel, but did it again to see if it would load the children up. I could not see a difference. I then did the same for a sub-sequence. But I think that was the wrong thing as it has now loaded it up as a master sequence (its not under the master sequence, its alongside it.) Not sure how to "unregister" it as a master sequence from the Sequences window now (I don't want to delete the timeline!). I assume I have to remove the "MasterSequence" tag?

    I opened the master sequence timeline, clicked on the clip in the Sequences track. It shows a script of EditorialPlayableAsset, Directory of "Location 20 (Playable Director)" and "Location 20_Timeline (Timeline asset)" - so that all seems to make sense. But in the Sequences window, "Location 20" is not shown as a child of the master sequence. (It is shown with no children.)

    If I select on the master sequence in the Project window, it magically says the script is MasterSequence, but does not show any properties.

    So I moved on and loaded Sequences 2.0.0. The Sequences window was then empty (all the master sequences that were there before with no children are no longer there). I tried "reimport" on the Timeline - no effect. The Timeline window now shows for the master sequence timeline "Track cannot be loaded" for the Sequences track.

    So I tried to create a new master sequence to see what would happen. It is visible in the Sequences window, a Timeline asset is created on disk. but if I select it the Timeline does not appear in the Timeline window. Instead I get an exception in the console:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Sequences.StructureTreeView.AddItemForSequence (UnityEditor.Sequences.SequenceNode sequence) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/SequencesWindow/StructureTreeView.cs:407)
    UnityEditor.Sequences.StructureTreeView.OnSequenceCreated (UnityEngine.Timeline.TimelineAsset timeline) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/SequencesWindow/StructureTreeView.cs:401)
    UnityEditor.Sequences.HierarchyDataChangeVerifier.OnSequenceCreated (UnityEngine.Sequences.TimelineSequence sequence, UnityEngine.Sequences.MasterSequence masterSequence) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/Core/Editorial/HierarchyDataChangeVerifier.cs:38)
    UnityEditor.Sequences.SequenceUtility.CreateMasterSequence (System.String name, System.Single fps) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/Core/Editorial/SequenceUtility.cs:103)
    UnityEditor.Sequences.StructureTreeView.RenameEnded (System.Int32 id, System.Boolean canceled) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/SequencesWindow/StructureTreeView.cs:167)
    UnityEditor.Sequences.SequencesTreeView.OnRenameItemEnding (UnityEditor.Sequences.RenameableLabel label, System.Boolean canceled) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/Core/UI/UIControls/SequencesTreeView.cs:306)
    UnityEditor.Sequences.RenameableLabel.EndRename (System.Boolean canceled) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/Core/UI/UIControls/RenameableLabel/RenameableLabel.cs:87)
    UnityEditor.Sequences.RenameableLabel.OnBlurEvent (UnityEngine.UIElements.BlurEvent evt) (at Library/PackageCache/com.unity.sequences@2.0.0/Editor/Core/UI/UIControls/RenameableLabel/RenameableLabel.cs:110)
    UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.PropagationPhase propagationPhase) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.CallbackEventHandler.UnityEngine.UIElements.IEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPath (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.DefaultDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcher.OpenGate () (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <a69592e6e5cf4003ac6707a67bdf3fd1>:0)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <b530d6b864d14e17b91c934592613be8>:0)


    How does 2.0.0 find all the master sequences and their child sequences etc to populate the Sequences window?


    Note! I took the project I uploaded as a bug report and when I right clicked on a timeline, it gave me the option to "Instantiate in Active Scene". This caused the game objects to be created in the scene - nice. But the Sequences window still does not show the child sequences/shots of the master sequence (even though the full hierarchy did appear in the scene). So it kind of knows all the hierachy, but its not visible in the Sequences window for some reason.
     
  6. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Wow ok, lets try something else then!
    I opened your project (that was attached to your ticket).

    I tried method 2, which is manually binding the TimelineAsset on the EditorialPlayableAsset (editorial clips in Timeline). To do that, I proceed as follow (repro steps given for Episode 2, but it's the same for the others):
    1. In the Project view, in the Sequences folder, in the Episode 2 folder, I select the "master timeline", i.e. "Episode 2 - Newcome_Timeline".
    2. In the Timeline window, select the first editorial clip.
    3. In the Inspector window, as you noticed, there is a "Timeline" property that is null for now. That's the one we need to fix. Drag & Drop "Location 30" timeline into this property (or use the picker, as you wish)
    4. Repeat for all sub-sequences.
    You don't even need to have the editorial structure instantiated in any scene to do that.
    Once you're done re-doing those bindings, you can close and re-open the Sequences window.

    For the MasterSequence issue, I'm not sure what to say. I don't see it.
    But to answer your questions:
    1. "How does 2.0.0 find all the master sequences": it look for the "MasterSequence" asset in the Project. If you look in a Master Sequence folder, you have Timeline assets and one MasterSequence asset.
    2. "and their child sequences": it looks for the Editorial clips present in a Timeline and the binding on them. We added the "timeline" property so that we can achieve that even when an editorial structure is not instantiated in the hierarchy (as the "PlayableDirector" binding can only be resolved then).
    I hope that helps! It will be a bit tedious to redo those bindings by hand but it's the best workaround I have for now. I guess we could also write a script to do that based on the editorial clip names.

    On our side, we will do more extensive tests of upgrading projects to try to find if there is something we missed in the code. So far we didn't have the issue when upgrading our Cinematic Studio sample, but I see a few upgrade scenario that were not covered while doing that, so I'll try those.
     
  7. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I tried to repeat on my "real" project, but when I load Sequences 2.0.0 I get an error for the Sequences track in the timeline, so I cannot click on the clip.
    upload_2022-9-20_22-55-48.png

    No errors in the console. I assume some other package version that it is not happy with in the larger project.

    Dropping back to 2.0.0-pre.2 the error goes away (I can open the timeline and select the clips in it). I found I had a custom track referring to "Arial.ttf" that has been renamed to "LocalRuntime.ttf". After that, the -pre.2 version started working on Episode 3! I got the sequences window back.

    Having fixed the font reference, I tried moving forwards to Sequences 2.0.0 (release version), but same error as above. - "Track cannot be loaded" with no console error messages. Maybe there is some other dependency that does not work with 2022.2b8...?

    So tried moving back to the -pre.2 version and load another scene and master sequence. Fail! Its not showing the children again (restarted, closed and reopened sequences window, etc). There is an error in the log I don't understand:

    upload_2022-9-21_0-13-6.png

    But other errors are sometimes visible. I wonder if another problem with a custom track lurking somewhere (and hiding the error message from the logs to trace it properly). But enough for tonight. Thanks for the help! Made some progress.
     

    Attached Files:

  8. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    First time I see this error... And I don't really get the error on the track either. I tried to upgrade to 2.0.0 but I had no issue on my side (with the project attached with your bug report, which is not your full real project if I understand correctly).

    If you get new things that I could try on my side let me know. The repro steps I gave you above should be (in theory) the only workaround you need (regarding fixing your sequences).
     
  9. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I will try to repeat later. It seems like runtime errors in custom track scripts might cause the problem. E.g. I did not ship one of the scripts, so that custom track probably did not load for you. But for my full environment it did load, then threw an exception at runtime (font not found). The only problem here is there were no errors on the console in 2,0.0, so it made it hard to track down (I got the hint when I went back to the -pre.2 version - it showed a warning in the console - but I want to confirm that sequence of events to make sure of the details). That was going to be my next test - make sure all the custom track scripts are in the sample project and try again.
     
  10. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I won't pretend to understand why, but with 2.0.0-pre.2 creating a new sequence under a master sequence, closing the sequences window, then reopening the sequences window makes all the children appear again. Then I can delete the new sequence I just created. So got that version going.

    But with 2.0.0 the sequences window is completely empty. So I started merging more of my project scripts into the test project, adding more packages via package manager (mathematics, animation rigging, HDRP, etc - needed by my scripts). Eventually when I got enough to compile, the sequences window was populated again with some master sequences (the children were gone), and some with children (!). So it does seem other compile errors are causing the sequences 2.0.0 to play up. Creating a sub-sequence, closing the sequences window, and reopening it did cause the children to be found in the sequences window. So my challenge appears to be to find all the errors in scripts without seeing any error messages in the Console window...

    Oh, and with 2.0.0 (release) I created a new master sequence and it appeared in the window (only thing listed). I then closed the window and reopened it - now empty.

    Bottom line, error messages I assume are being suppressed somehow because I am reasonably confident know its errors elsewhere in the project that is resulting in the Sequences package not behaving. But I have not managed to get an updated demo project that is useful. I might just back off to 2.0.0-pre.2 for a while.
     
  11. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Oh, one final note, I went back to 2.0.0-pre.2 and the sequences window was populated again. So the 2.0.0 release seems to be more sensitive to errors.
     
  12. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Okay, so the last one was not actually a "final" note... but I also just noticed (2.0.0-pre.2) the naming in the sequences window includes the _Timeline suffix for existing sequences, but not for newly created sequences (I just added Shot 008). Maybe just an upgrade problem (it does not bother me), just mentioning in case relevant. The new shot retains its name even when Unity is restarted.

    upload_2022-9-24_7-15-0.png