Announcement

Collapse
No announcement yet.

How to send specific data to new sequencer event system in c++ in 4.21

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to send specific data to new sequencer event system in c++ in 4.21

    Hi there!
    We are currently trying to generate sequences from C++ to handle our dialogs. We need to send an event everytime we want to display a new dialog line on screen. We want to give to this event some data like the name of the speaker or the dialog line's text. In 4.20, Sequencer events used structs as parameters, you could populate them with the data you wanted to send with your event. (I couldn't get it to work 100% with C++ but I was close) Now in 4.21, an event just triggers a function in a LevelSequenceDirector and I don't see how you can send it data. These function can have a UObject parameter but I can't find a way to populate it with the data I want when generating my sequence. I really don't want to have to parse my dialog at runtime to find which line to display.
    Does someone know how to send data to Sequencer events in a 4.21 fashion ? =) I don't know if it was clear, I'm ready to answer question, any help is appreciated!
    Here is how I currenlty go about adding event keys right now. It creates the event keys, tell him the name of the event with a UObject parameter, but I don't know how to populate it with specific data per event key :
    Code:
      // Get the event section's data to populate with keys
      FMovieSceneEventChannel* EventChannel = EventSection->GetChannelProxy().GetChannel<FMovieSceneEventChannel>(0);
      TMovieSceneChannelData<FMovieSceneEvent> EventData = EventChannel->GetData();
    
      FMovieSceneEvent Event;
    
      FMovieSceneSequenceEditor* SequenceEditor = FMovieSceneSequenceEditor::Find(EventSection->GetTypedOuter<UMovieSceneSequence>());
      UK2Node_FunctionEntry* NewEndpoint = SequenceEditor->CreateEventEndpoint(EventSection->GetTypedOuter<UMovieSceneSequence(),"SEQ_DisplayLine");
    
      // create the input parameter pin
      FEdGraphPinType PinType;
      UClass* PinClassType = this->GetClass();
      PinType.PinCategory = PinClassType->IsChildOf(UInterface::StaticClass()) ? UEdGraphSchema_K2::PC_Interface : UEdGraphSchema_K2::PC_Object;
      PinType.PinSubCategoryObject = PinClassType;
    
      NewEndpoint->CreateUserDefinedPin(FMovieSceneSequenceEditor::TargetPinName, PinType, EGPD_Output, true);
      NewEndpoint->ReconstructNode();
    
      FMovieSceneSequenceEditor::BindEventToEndpoint(EventSection, &Event, NewEndpoint);
    
      //Create one event per dialog line
      for (int i = 0; i < DialogToGenerate->GetNumberOfLines(); ++i)
      {
          EventData.UpdateOrAddKey(i*24000, Event);
      }
    Thanks!
    Last edited by GAlmyre; 11-15-2018, 05:26 AM. Reason: Added tags
Working...
X