I’m trying to use Sequencer programmatically. So I have the logic to add an actor to sequencer and enable Transform.
But I can not find the way how I could enable Mesh components to later keyframe them.
This is how I’m adding the Actor to sequencer with the transform details:
void ABP_model::AddActorToSequencer(ULevelSequence * LevelSequence, AActor * Actor) {
FGuid MyGuid = LevelSequence -> MovieScene -> AddPossessable(Actor -> GetActorLabel(), Actor -> GetClass());
UE_LOG(LogTemp, Warning, TEXT("Actor GUID %s"), * MyGuid.ToString());
if (Actor != nullptr) {
LevelSequence -> BindPossessableObject(MyGuid, * Actor, Actor -> GetWorld());
UE_LOG(LogTemp, Warning, TEXT("Actor is NOT NULL, adding to sequence"));
// adding transform track(property) to sequencer
UMovieSceneTrack * TransformTrack = LevelSequence -> MovieScene -> AddTrack(UMovieScene3DTransformTrack::StaticClass(), MyGuid);
UMovieScene3DTransformSection * TransformSection = Cast < UMovieScene3DTransformSection > (TransformTrack -> CreateNewSection());
TransformTrack -> AddSection( * TransformSection);
} else {
UE_LOG(LogTemp, Warning, TEXT("Actor is NULL"));
}
}
And this is how I’m trying to add the mesh components by name, based on this article: [How to add Properties to Sequencer? - Cinematics & Media - Epic Developer Community Forums][1]
// adding other properties
UMovieSceneTrack *FovTrack = LevelSequence->MovieScene->AddTrack(UMovieSceneFloatTrack::StaticClass(), MyGuid);
// FovTrack->SetPropertyAndPath("Body", "Body");
UMovieSceneFloatSection *FovSection = Cast<UMovieSceneFloatSection>(FovTrack->CreateNewSection());
FovTrack->AddSection(*FovSection);
And on the image, you can see the available meshes that I’d like to enable to be able to keyframe them.
Many thanks in advance