It seems there’s been a change to how Spawnable bindings work for MovieSceneSequences between UE 5.4 and 5.5. I’m trying to decode the source code for now, but maybe someone knows and is willing to share knowledge - how does one add a component track to an actor track using C++?
I had to change how I add a spawnable actor too - before I could just spawn a transient actor to GEditor world, use Cast<UMovieSceneSequence>(LevelSequence)->CreateSpawnable(TransientActor)
, and remove the transient actor from the world. Now I have to use the ULevelSequence::MakeSpawnableTemplateFromInstance
and pass the result to CreateSpawnable
. It works for creating spawnables and not making a mess, but now I have a hard time adding component tracks. I try to add the components using
LevelSequence->GetMovieScene()->AddPossessable(SomeName, Component->GetClass());
FMovieScenePossessable * ComponentPossessable = Sequence->GetMovieScene()->FindPossessable(ComponentGuid);
LevelSequence->BindPossessableObject(ComponentGuid, *Component, Owner);
ComponentPossessable->SetParent(OwnerGuid, LevelSequence->GetMovieScene());
but well… in 5.4 I also used FMovieSceneSpawnable::AddChildPossessable
in between to make it work but… FMovieSceneSpawnable do not work in 5.5.