Adding a Component to Sequencer

Hi,

Does anyone know how to add a component in the sequencer in c++?

So far I can add…

  • Cameras / Actors (using AddPossessable / BindPossessableObject
  • Tracks such as Transform (using AddTrack and AddSection)

However I can’t seem to work out how to add the component reference. – I have tried back-tracking through the GUI code, but didn’t get anywhere beyond drilling down into some of the functions from LevelSequenceEditorToolkit.cpp, beginning with this key line.

FUIAction AddComponentAction(FExecuteAction::CreateSP(this, &FLevelSequenceEditorToolkit::HandleAddComponentActionExecute, Component));

135131-cameracompoinent.png

Any ideas?

Answered my own question:

Need to use ->SetParent(Guid) with a FMovieScenePossessable

OK, but I can’t seem to figure out how to add the focal length, aperture, etc.

135210-cameracompoinent2.png

Anyone have any ideas?

It appears it might be a UMovieScenePropertyTrack, but I have no idea how to add these as a track without it crashing

Resolved this.

Seems to be a major issue with Sequencer code relying on the presence / visibility of UI elements.

Which seems strange as front-end and back-end should usually be mutually exclusive to some degree.

Somehow using SetParent(PranetGuid), breaks the object reference to the component. Whereas without setting the parent keeps the reference to the camera component? Any idea why its happening?
I am using 4.16.

Just as a future note, when you “Resolved this.” it would be helpful for the community if you reviewed and edited your original post to maybe restate the problem more clearly and more importantly, what exactly resolved it for you and if the issue was a misunderstanding on your part or a problem with the API (potentially opening a bug and linking to it). As it stands reading through this now, there is a problem, some potential fixes and conversation and you saying you resolved it. Fin.

Hi, I have same questions. I don’t know how to add property as key frame. Could you please share your idea? Thank you!

Code:

//	UMovieScene* Movie = WidgetAnim->GetMovieScene();
//	FGuid TrackComponent_Guid = Movie->AddPossessable(TEXT("TextTrack"), RootPanel->GetClass()); 
//	UMovieScenePropertyTrack* Track = Movie->AddTrack<UMovieScenePropertyTrack>(TrackComponent_Guid);
//	Track->SetPropertyNameAndPath(TEXT("Render Opacity"), TEXT("Render Opacity"));
//	UMovieSceneFloatSection* FovSection = Cast<UMovieSceneFloatSection>(Track->CreateNewSection());
//	Track->AddSection(*FovSection);

Hi! I got the same problem. I want add a component to a track but I don’t know what the whole process is.