本文整理汇总了C++中UMovieScene::RemoveSpawnable方法的典型用法代码示例。如果您正苦于以下问题:C++ UMovieScene::RemoveSpawnable方法的具体用法?C++ UMovieScene::RemoveSpawnable怎么用?C++ UMovieScene::RemoveSpawnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMovieScene
的用法示例。
在下文中一共展示了UMovieScene::RemoveSpawnable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRequestNodeDeleted
void FSequencer::OnRequestNodeDeleted( TSharedRef<const FSequencerDisplayNode>& NodeToBeDeleted )
{
bool bAnySpawnablesRemoved = false;
bool bAnythingRemoved = false;
TSharedRef<FMovieSceneInstance> MovieSceneInstance = GetFocusedMovieSceneInstance();
UMovieScene* OwnerMovieScene = MovieSceneInstance->GetMovieScene();
// Only object nodes or section areas can be deleted
if( NodeToBeDeleted->GetType() == ESequencerNode::Object )
{
OwnerMovieScene->SetFlags( RF_Transactional );
const FGuid& BindingToRemove = StaticCastSharedRef<const FObjectBindingNode>( NodeToBeDeleted )->GetObjectBinding();
//@todo Sequencer - add transaction
// Try to remove as a spawnable first
bool bRemoved = OwnerMovieScene->RemoveSpawnable( BindingToRemove );
if( bRemoved )
{
bAnySpawnablesRemoved = true;
}
if( !bRemoved )
{
// The guid should be associated with a possessable if it wasnt a spawnable
bRemoved = OwnerMovieScene->RemovePossessable( BindingToRemove );
// @todo Sequencer - undo needs to work here
ObjectBindingManager->UnbindPossessableObjects( BindingToRemove );
// If this check fails the guid was not associated with a spawnable or possessable so there was an invalid guid being stored on a node
check( bRemoved );
}
bAnythingRemoved = true;
}
else if( NodeToBeDeleted->GetType() == ESequencerNode::Track )
{
TSharedRef<const FTrackNode> SectionAreaNode = StaticCastSharedRef<const FTrackNode>( NodeToBeDeleted );
UMovieSceneTrack* Track = SectionAreaNode->GetTrack();
UMovieScene* FocusedMovieScene = GetFocusedMovieScene();
FocusedMovieScene->SetFlags( RF_Transactional );
if( FocusedMovieScene->IsAMasterTrack( Track ) )
{
FocusedMovieScene->RemoveMasterTrack( Track );
}
else
{
FocusedMovieScene->RemoveTrack( Track );
}
bAnythingRemoved = true;
}
if( bAnythingRemoved )
{
if( bAnySpawnablesRemoved )
{
// @todo Sequencer Sub-MovieScenes needs to destroy objects for all movie scenes that had this node
SpawnOrDestroyPuppetObjects( MovieSceneInstance );
}
NotifyMovieSceneDataChanged();
}
}