Files
UnrealEngineUWP/Engine/Source/Runtime/MovieScene/Private/MovieScenePossessable.cpp
Max Chen 0167d4ea0f Sequencer: MVVM2 branch and Layer Bars
Copying //Tasks/UE5/Dev-SequencerMVVM2 to Main (//UE5/Main) @20364093

#preflight 628866dfb94f739b152c1e29
#preflight 628866e4585e8f793ee80943
#rb ludovic.chabant, andrew.rodham
#fyi ludovic.chabant, andrew.rodham, andrew.porter
#jira UE-105322

[CL 20364493 by Max Chen in ue5-main branch]
2022-05-25 10:39:33 -04:00

36 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MovieScenePossessable.h"
#include "MovieSceneSpawnableAnnotation.h"
#include "MovieSceneSequence.h"
#include "MovieSceneSequenceID.h"
#include "MovieScene.h"
#include "IMovieScenePlayer.h"
#include "EventHandlers/ISequenceDataEventHandler.h"
bool FMovieScenePossessable::BindSpawnableObject(FMovieSceneSequenceID SequenceID, UObject* Object, IMovieScenePlayer* Player)
{
TOptional<FMovieSceneSpawnableAnnotation> Spawnable = FMovieSceneSpawnableAnnotation::Find(Object);
if (Spawnable.IsSet())
{
// Check whether the spawnable is underneath the current sequence, if so, we can remap it to a local sequence ID
SetSpawnableObjectBindingID(UE::MovieScene::FRelativeObjectBindingID(SequenceID, Spawnable->SequenceID, Spawnable->ObjectBindingID, *Player));
return true;
}
return false;
}
void FMovieScenePossessable::SetParent(const FGuid& InParentGuid)
{
ParentGuid = InParentGuid;
}
void FMovieScenePossessable::SetParent(const FGuid& InParentGuid, UMovieScene* Owner)
{
if (ParentGuid != InParentGuid)
{
ParentGuid = InParentGuid;
Owner->EventHandlers.Trigger(&UE::MovieScene::ISequenceDataEventHandler::OnBindingParentChanged, Guid, InParentGuid);
}
}