LevelSequenceActor transform offset for Sequencer lost on value changed

Whenever I toggle Lock, Pin, Ignore on subsequences or adding new transform key on a character inside a subsequence the Actors lose the LevelSequenceActor transform offset they have at preview and go back to world origin, playback is based on the origin instead of LevelSequenceActor after this.

If I scrub back to frame -1 and move to a frame > 0 the playback is correct again, relative to LevelSequenceActor.

If I call `RequestInvalidateCachedData()` on `OnMovieSceneDataChanged` the playback continues correctly relative to LevelSequenceActor. The problem is that this doesn’t take the LOCK into account. So if no solution is found a more generic delegate to catch all changes in Sequencer and force this call might be ok for now.

  ISequencerModule& SequencerModule = FModuleManager::LoadModuleChecked<ISequencerModule>("Sequencer");

  FOnSequencerCreated::FDelegate InOnSequencerCreated;
  InOnSequencerCreated.BindLambda([](TSharedRef<ISequencer> NewSequencer)
  {
    // When a Sequencer is opened, bind a refresh listener to it
    NewSequencer->OnMovieSceneDataChanged().AddLambda([WeakSeq = TWeakPtr<ISequencer>(NewSequencer)](EMovieSceneDataChangeType Change)
    {
      if (TSharedPtr<ISequencer> Seq = WeakSeq.Pin())
      {
        Seq->RequestInvalidateCachedData();
      }
    });
  });

Can someone help me debug this? Not sure how easy is to repro the setup. Pointing to a location I can look at to detect how the LevelSequenceActor reference is lost would be appreciated at least

Steps to Reproduce
I’ve got a LevelSequence with:

  • MasterSequence
    • Characters
      • Area1
      • Area2

Toggling Lock, Pin, Ignore on “Characters”, “Area1” or “Area2” subsequences or adding new transform key on a character inside “Area1”.

This is not a 100% repro, I’m not sure what are the exact reasons this is happening as it’s not reproducible in all LevelSequences.

Hey there,

Apologies for the delay. First there are a few bugs here that we found when reproing your issue and I’ve logged it here so that you can follow along: https://issues.unrealengine.com/issue/UE-354232

To help you debug what might be going on here. It looks like when we instantiate the Custom Instance Data for the sequence, we don’t have any binding that listens for changes to those properties, so like you said we don’t invalidate the sequence cache. The suggested changes you have up there are a bit of a hammer, but if you wanted to make an adjustment specific to the custom instance data, you could look into invalidating the cached data when those properties change inside of SequenerEdMode.cpp. In there when we initialize the transform tracks, we fetch the transform data, but don’t do any bindings.

Dustin