本文整理汇总了C++中UMovieScene::FindPossessable方法的典型用法代码示例。如果您正苦于以下问题:C++ UMovieScene::FindPossessable方法的具体用法?C++ UMovieScene::FindPossessable怎么用?C++ UMovieScene::FindPossessable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMovieScene
的用法示例。
在下文中一共展示了UMovieScene::FindPossessable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindObject
UObject* FMovieSceneSequenceInstance::FindObject(const FGuid& ObjectId, const IMovieScenePlayer& Player) const
{
if(MovieSceneSequence.IsValid())
{
// Attempt to find a possessable first
UMovieScene* MovieScene = MovieSceneSequence->GetMovieScene();
if (MovieScene != nullptr)
{
FMovieScenePossessable* Possessable = MovieScene->FindPossessable(ObjectId);
if (Possessable)
{
UObject* ParentObject = Player.GetPlaybackContext();
if (Possessable->GetParent().IsValid())
{
ParentObject = FindObject(Possessable->GetParent(), Player);
}
return MovieSceneSequence->FindPossessableObject(ObjectId, ParentObject);
}
else
{
return FindSpawnedObject(ObjectId);
}
}
}
return nullptr;
}
示例2: GetHandleToObject
FGuid FSequencer::GetHandleToObject( UObject* Object )
{
TSharedRef<FMovieSceneInstance> FocusedMovieSceneInstance = GetFocusedMovieSceneInstance();
UMovieScene* FocusedMovieScene = FocusedMovieSceneInstance->GetMovieScene();
FGuid ObjectGuid = ObjectBindingManager->FindGuidForObject( *FocusedMovieScene, *Object );
if (ObjectGuid.IsValid())
{
// Make sure that the possessable is still valid, if it's not remove the binding so new one
// can be created. This can happen due to undo.
FMovieScenePossessable* Possessable = FocusedMovieScene->FindPossessable(ObjectGuid);
if (Possessable == nullptr )
{
ObjectBindingManager->UnbindPossessableObjects(ObjectGuid);
ObjectGuid.Invalidate();
}
}
bool bPossessableAdded = false;
// If the object guid was not found attempt to add it
// Note: Only possessed actors can be added like this
if( !ObjectGuid.IsValid() && ObjectBindingManager->CanPossessObject( *Object ) )
{
// @todo sequencer: Undo doesn't seem to be working at all
const FScopedTransaction Transaction( LOCTEXT("UndoPossessingObject", "Possess Object with MovieScene") );
// Possess the object!
{
// Create a new possessable
FocusedMovieScene->Modify();
ObjectGuid = FocusedMovieScene->AddPossessable( Object->GetName(), Object->GetClass() );
if ( IsShotFilteringOn() )
{
AddUnfilterableObject(ObjectGuid);
}
ObjectBindingManager->BindPossessableObject( ObjectGuid, *Object );
bPossessableAdded = true;
}
}
if( bPossessableAdded )
{
SpawnOrDestroyPuppetObjects( GetFocusedMovieSceneInstance() );
NotifyMovieSceneDataChanged();
}
return ObjectGuid;
}
示例3: GetClassForObjectBinding
const UClass* FSequencerObjectBindingNode::GetClassForObjectBinding() const
{
UMovieScene* MovieScene = GetSequencer().GetFocusedMovieSceneSequence()->GetMovieScene();
FMovieSceneSpawnable* Spawnable = MovieScene->FindSpawnable(ObjectBinding);
FMovieScenePossessable* Possessable = MovieScene->FindPossessable(ObjectBinding);
// should exist, but also shouldn't be both a spawnable and a possessable
check((Spawnable != nullptr) ^ (Possessable != nullptr));
check((nullptr == Spawnable) || (nullptr != Spawnable->GetObjectTemplate()) );
const UClass* ObjectClass = Spawnable ? Spawnable->GetObjectTemplate()->GetClass() : Possessable->GetPossessedObjectClass();
return ObjectClass;
}
示例4: if
FSequencerObjectBindingNode::FSequencerObjectBindingNode(FName NodeName, const FText& InDisplayName, const FGuid& InObjectBinding, TSharedPtr<FSequencerDisplayNode> InParentNode, FSequencerNodeTree& InParentTree)
: FSequencerDisplayNode(NodeName, InParentNode, InParentTree)
, ObjectBinding(InObjectBinding)
, DefaultDisplayName(InDisplayName)
{
UMovieScene* MovieScene = GetSequencer().GetFocusedMovieSceneSequence()->GetMovieScene();
if (MovieScene->FindPossessable(ObjectBinding))
{
BindingType = EObjectBindingType::Possessable;
}
else if (MovieScene->FindSpawnable(ObjectBinding))
{
BindingType = EObjectBindingType::Spawnable;
}
else
{
BindingType = EObjectBindingType::Unknown;
}
}
示例5: ObjectReference
TSharedPtr<FMovieSceneAnimationSectionRecorder> UActorRecording::StartRecordingComponentProperties(const FName& BindingName, USceneComponent* SceneComponent, UObject* BindingContext, ULevelSequence* CurrentSequence, float CurrentSequenceTime, const FAnimationRecordingSettings& InAnimationSettings)
{
// first create a possessable for this component to be controlled by
UMovieScene* OwnerMovieScene = CurrentSequence->GetMovieScene();
const FGuid PossessableGuid = OwnerMovieScene->AddPossessable(BindingName.ToString(), SceneComponent->GetClass());
// Set up parent/child guids for possessables within spawnables
FMovieScenePossessable* ChildPossessable = OwnerMovieScene->FindPossessable(PossessableGuid);
if (ensure(ChildPossessable))
{
ChildPossessable->SetParent(Guid);
}
FMovieSceneSpawnable* ParentSpawnable = OwnerMovieScene->FindSpawnable(Guid);
if (ParentSpawnable)
{
ParentSpawnable->AddChildPossessable(PossessableGuid);
}
// BindingName must be the component's path relative to its owner Actor
FLevelSequenceObjectReference ObjectReference(FUniqueObjectGuid(), BindingName.ToString());
CurrentSequence->BindPossessableObject(PossessableGuid, ObjectReference);
// First try built-in animation recorder...
TSharedPtr<FMovieSceneAnimationSectionRecorder> AnimationRecorder = nullptr;
if (FSequenceRecorder::Get().GetAnimationRecorderFactory().CanRecordObject(SceneComponent))
{
AnimationRecorder = FSequenceRecorder::Get().GetAnimationRecorderFactory().CreateSectionRecorder(this, InAnimationSettings);
AnimationRecorder->CreateSection(SceneComponent, OwnerMovieScene, PossessableGuid, CurrentSequenceTime);
AnimationRecorder->Record(CurrentSequenceTime);
SectionRecorders.Add(AnimationRecorder);
}
// ...and transform...
if (FSequenceRecorder::Get().GetTransformRecorderFactory().CanRecordObject(SceneComponent))
{
TSharedPtr<IMovieSceneSectionRecorder> Recorder = FSequenceRecorder::Get().GetTransformRecorderFactory().CreateSectionRecorder(true, nullptr);
if (Recorder.IsValid())
{
Recorder->CreateSection(SceneComponent, OwnerMovieScene, PossessableGuid, CurrentSequenceTime);
Recorder->Record(CurrentSequenceTime);
SectionRecorders.Add(Recorder);
}
}
// ...now any external recorders
TArray<IMovieSceneSectionRecorderFactory*> ModularFeatures = IModularFeatures::Get().GetModularFeatureImplementations<IMovieSceneSectionRecorderFactory>(MovieSceneSectionRecorderFactoryName);
for (IMovieSceneSectionRecorderFactory* Factory : ModularFeatures)
{
if (Factory->CanRecordObject(SceneComponent))
{
TSharedPtr<IMovieSceneSectionRecorder> Recorder = Factory->CreateSectionRecorder(ActorSettings);
if (Recorder.IsValid())
{
Recorder->CreateSection(SceneComponent, OwnerMovieScene, PossessableGuid, CurrentSequenceTime);
Recorder->Record(CurrentSequenceTime);
SectionRecorders.Add(Recorder);
}
}
}
return AnimationRecorder;
}