ActorSequenceComponent + RuntimeCellTransformer is calling RerunConstructionScripts killing the sequence

Hello !

The actor sequence doesn’t play. I’m wondering if there is a better fix for the actor UActorSequence::GetParentBlueprint returning nullptr and if not, how I can avoid loosing my sequence when rerunconstructionscript is called through RCT?

(Currently I’m making the issue disappear with a “!InActor->Tags.Contains(UWorldPartitionRuntimeCellTransformer::NAME_CellTransformerIgnoreActor);” in the Algo::CopyIf that creates the array the RerunConstructionScripts is called on)

Regards,

Loïc Leinot

[Attachment Removed]

Steps to Reproduce
When I have ActorSequenceComponent on an actor in a WP map with a RuntimeCellTransformer, this is calling RerunConstructionScripts on the actor and the LevelActorSequenceComponent seems to loose the sequence reference (the play doesn’t happen).

Important to note too UActorSequence::GetParentBlueprint was returning nullptr for most of our use case and thus adding the actor sequence to the world and causing a bunch of issues so I changed that to :

UBlueprint* UActorSequence::GetParentBlueprint() const
{
  if (UBlueprintGeneratedClass* GeneratedClass = GetTypedOuter<UBlueprintGeneratedClass>())
  {
    return Cast<UBlueprint>(GeneratedClass->ClassGeneratedBy);
  }
  // If Outer is not a blueprint, this might mean we use the base class but this could still be used inside of a BP, so we try to get the class from the outer's outer
  UObject* Outer = GetOuter();
  while (Outer)
  {
    if (UBlueprintGeneratedClass* GeneratedClass = Cast<UBlueprintGeneratedClass>(Outer->GetClass()))
    {
      return Cast<UBlueprint>(GeneratedClass->ClassGeneratedBy);
    }
    Outer = Outer->GetOuter();
  }
  return nullptr;
}

So I think it looses the reference because it’s owned by the outer’s outer instead of the outer so when reattaching component the ref to the right actor is lost.

[Attachment Removed]

Hello!

Your post is discussing 2 separate problems. I strongly recommend that you file a separate ticket regarding UActorSequence::GetParentBlueprint(). The change you propose is changing the “meaning” of the method. The current question the method answers is : “Is this Actor Sequence owned by a Blueprint class(return is non-null),OR by a plain level-placed actor (return is null)?”. With the modified code, the question becomes: "“Is this Actor Sequence owned by a Blueprint class, a Blueprint instance OR by a plain level-placed actor?”. The intent of the method is to return null on level instances of BPs. Please explain the problems that you are trying to address in the new ticket. We will make sure it is review by an expert from the sequencer team.

Regarding the broken sequence, the problem was traced back to an edge case in the reinstantiation of the BP. The case gets triggered because of the UActorSequence::Signature member is different from the archetype on the 2nd run of RerunConstructionScripts. The best workaround is to add a meta tag to the UActorSequenceComponent::Sequence member so it is forced to the reassigned during the reinstantiation.

	/**
	 * Embedded actor sequence data.
	 *
	 * SkipUCSModifiedProperties: UActorSequence derives from UMovieSceneSignedObject, which seeds a
	 * fresh Signature GUID in PostInitProperties for every object that lacks RF_ArchetypeObject.
	 * AActor::CreateComponentFromTemplate strips that flag when it duplicates the SCS template, so a
	 * rebuilt Sequence can never compare equal to its archetype. Without this,
	 * DetermineUCSModifiedProperties always misattributes Sequence to the construction script and
	 * FComponentPropertyReader skips restoring it, leaving the pointer on the sub-object that
	 * ApplyToComponent already evicted to the transient package.
	 */
//                                                             ********************************
	UPROPERTY(EditAnywhere, Instanced, Category=Animation, meta=(SkipUCSModifiedProperties))
	TObjectPtr<UActorSequence> Sequence;

I filed an internal bug report so the root of the problem can be investigated by the engine team and fixed in a future release.

Regards,

Martin

[Attachment Removed]

Thank you, I’ll do that in the meantime.

The other issue was where the sequence was saved for blueprint instances, we had reference from the world to the instance that was (and should be) in a partition. But we had no big issue with the mod I made.

[Attachment Removed]