当前位置: 首页>>代码示例>>C++>>正文


C++ UMovieScene::Modify方法代码示例

本文整理汇总了C++中UMovieScene::Modify方法的典型用法代码示例。如果您正苦于以下问题:C++ UMovieScene::Modify方法的具体用法?C++ UMovieScene::Modify怎么用?C++ UMovieScene::Modify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UMovieScene的用法示例。


在下文中一共展示了UMovieScene::Modify方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HandleAddSlomoTrackMenuEntryExecute

void FSlomoTrackEditor::HandleAddSlomoTrackMenuEntryExecute()
{
	UMovieScene* MovieScene = GetFocusedMovieScene();

	if (MovieScene == nullptr)
	{
		return;
	}

	UMovieSceneTrack* SlomoTrack = MovieScene->FindMasterTrack<UMovieSceneSlomoTrack>();

	if (SlomoTrack != nullptr)
	{
		return;
	}

	const FScopedTransaction Transaction(NSLOCTEXT("Sequencer", "AddSlomoTrack_Transaction", "Add Play Rate Track"));

	MovieScene->Modify();
		
	SlomoTrack = FindOrCreateMasterTrack<UMovieSceneSlomoTrack>().Track;
	ensure(SlomoTrack);

	UMovieSceneSection* NewSection = SlomoTrack->CreateNewSection();
	ensure(NewSection);

	SlomoTrack->AddSection(*NewSection);

	GetSequencer()->NotifyMovieSceneDataChanged();
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:30,代码来源:SlomoTrackEditor.cpp

示例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;
}
开发者ID:johndpope,项目名称:UE4,代码行数:55,代码来源:Sequencer.cpp

示例3: FindOrCreateCameraCutTrack

UMovieSceneCameraCutTrack* FCameraCutTrackEditor::FindOrCreateCameraCutTrack()
{
	UMovieScene* FocusedMovieScene = GetFocusedMovieScene();
	UMovieSceneTrack* CameraCutTrack = FocusedMovieScene->GetCameraCutTrack();

	if (CameraCutTrack == nullptr)
	{
		const FScopedTransaction Transaction(LOCTEXT("AddCameraCutTrack_Transaction", "Add Camera Cut Track"));
		FocusedMovieScene->Modify();
		
		CameraCutTrack = FocusedMovieScene->AddCameraCutTrack(UMovieSceneCameraCutTrack::StaticClass());
	}

	return CastChecked<UMovieSceneCameraCutTrack>(CameraCutTrack);
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:15,代码来源:CameraCutTrackEditor.cpp

示例4: OnActorsDropped

void FSequencer::OnActorsDropped( const TArray<TWeakObjectPtr<AActor> >& Actors )
{
	bool bPossessableAdded = false;
	for( TWeakObjectPtr<AActor> WeakActor : Actors )
	{
		AActor* Actor = WeakActor.Get();
		if( Actor != NULL )
		{
			// Grab the MovieScene that is currently focused.  We'll add our Blueprint as an inner of the
			// MovieScene asset.
			UMovieScene* OwnerMovieScene = GetFocusedMovieScene();
			
			// @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
				OwnerMovieScene->Modify();
				
				const FGuid PossessableGuid = OwnerMovieScene->AddPossessable( Actor->GetActorLabel(), Actor->GetClass() );
				 
				if ( IsShotFilteringOn() )
				{
					AddUnfilterableObject(PossessableGuid);
				}
				
				ObjectBindingManager->BindPossessableObject( PossessableGuid, *Actor );
				
				bPossessableAdded = true;
			}
		}
	}
	
	if( bPossessableAdded )
	{
		SpawnOrDestroyPuppetObjects( GetFocusedMovieSceneInstance() );
		
		NotifyMovieSceneDataChanged();
	}
}
开发者ID:johndpope,项目名称:UE4,代码行数:41,代码来源:Sequencer.cpp

示例5: AddSubMovieScene

void FSequencer::AddSubMovieScene( UMovieScene* SubMovieScene )
{
	// @todo Sequencer - sub-moviescenes This should be moved to the sub-moviescene editor
	SubMovieScene->SetFlags( RF_Transactional );
	
	// Grab the MovieScene that is currently focused.  THis is the movie scene that will contain the sub-moviescene
	UMovieScene* OwnerMovieScene = GetFocusedMovieScene();

	// @todo sequencer: Undo doesn't seem to be working at all
	const FScopedTransaction Transaction( LOCTEXT("UndoAddingObject", "Add Object to MovieScene") );

	OwnerMovieScene->Modify();

	UMovieSceneTrack* Type = OwnerMovieScene->FindMasterTrack( USubMovieSceneTrack::StaticClass() ) ;
	if( !Type )
	{
		Type = OwnerMovieScene->AddMasterTrack( USubMovieSceneTrack::StaticClass() );
	}

	USubMovieSceneTrack* SubMovieSceneType = CastChecked<USubMovieSceneTrack>( Type );

	SubMovieSceneType->AddMovieSceneSection( SubMovieScene, ScrubPosition );
}
开发者ID:johndpope,项目名称:UE4,代码行数:23,代码来源:Sequencer.cpp

示例6: Drop

void FSequencerFolderNode::Drop( const TArray<TSharedRef<FSequencerDisplayNode>>& DraggedNodes, EItemDropZone ItemDropZone )
{
	const FScopedTransaction Transaction( NSLOCTEXT( "SequencerFolderNode", "MoveIntoFolder", "Move items into folder." ) );
	GetFolder().SetFlags(RF_Transactional);
	GetFolder().Modify();
	for ( TSharedRef<FSequencerDisplayNode> DraggedNode : DraggedNodes )
	{
		TSharedPtr<FSequencerDisplayNode> ParentSeqNode = DraggedNode->GetParent();
		switch ( DraggedNode->GetType() )
		{
			case ESequencerNode::Folder:
			{
				TSharedRef<FSequencerFolderNode> DraggedFolderNode = StaticCastSharedRef<FSequencerFolderNode>( DraggedNode );
				UMovieScene* FocusedMovieScene = GetParentTree().GetSequencer().GetFocusedMovieSceneSequence()->GetMovieScene();

				if ( ItemDropZone == EItemDropZone::OntoItem )
				{
					GetFolder().AddChildFolder( &DraggedFolderNode->GetFolder() );
				}
				else
				{
					FocusedMovieScene->Modify();
					FocusedMovieScene->GetRootFolders().Add( &DraggedFolderNode->GetFolder() );
				}
				
				if ( ParentSeqNode.IsValid() )
				{
					checkf( ParentSeqNode->GetType() == ESequencerNode::Folder, TEXT( "Can not remove from unsupported parent node." ) );
					TSharedPtr<FSequencerFolderNode> ParentFolder = StaticCastSharedPtr<FSequencerFolderNode>( ParentSeqNode );
					ParentFolder->GetFolder().Modify();
					ParentFolder->GetFolder().RemoveChildFolder( &DraggedFolderNode->GetFolder() );
				}
				else
				{
					FocusedMovieScene->Modify();
					FocusedMovieScene->GetRootFolders().Remove( &DraggedFolderNode->GetFolder() );
				}

				break;
			}
			case ESequencerNode::Track:
			{
				TSharedRef<FSequencerTrackNode> DraggedTrackNode = StaticCastSharedRef<FSequencerTrackNode>( DraggedNode );
				
				if( ItemDropZone == EItemDropZone::OntoItem )
				{
					GetFolder().AddChildMasterTrack( DraggedTrackNode->GetTrack() );
				}
				
				if ( ParentSeqNode.IsValid() )
				{
					checkf( ParentSeqNode->GetType() == ESequencerNode::Folder, TEXT( "Can not remove from unsupported parent node." ) );
					TSharedPtr<FSequencerFolderNode> ParentFolder = StaticCastSharedPtr<FSequencerFolderNode>( ParentSeqNode );
					ParentFolder->GetFolder().Modify();
					ParentFolder->GetFolder().RemoveChildMasterTrack( DraggedTrackNode->GetTrack() );
				}

				break;
			}
			case ESequencerNode::Object:
			{
				TSharedRef<FSequencerObjectBindingNode> DraggedObjectBindingNode = StaticCastSharedRef<FSequencerObjectBindingNode>( DraggedNode );
				
				if ( ItemDropZone == EItemDropZone::OntoItem )
				{
					GetFolder().AddChildObjectBinding( DraggedObjectBindingNode->GetObjectBinding() );
				}

				if ( ParentSeqNode.IsValid() )
				{
					checkf( ParentSeqNode->GetType() == ESequencerNode::Folder, TEXT( "Can not remove from unsupported parent node." ) );
					TSharedPtr<FSequencerFolderNode> ParentFolder = StaticCastSharedPtr<FSequencerFolderNode>( ParentSeqNode );
					ParentFolder->GetFolder().Modify();
					ParentFolder->GetFolder().RemoveChildObjectBinding( DraggedObjectBindingNode->GetObjectBinding() );
				}

				break;
			}
		}
	}
	SetExpansionState( true );
	ParentTree.GetSequencer().NotifyMovieSceneDataChanged( EMovieSceneDataChangeType::MovieSceneStructureItemsChanged );
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:83,代码来源:SequencerFolderNode.cpp


注:本文中的UMovieScene::Modify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。