本文整理汇总了C++中UMovieScene::GetPlaybackRange方法的典型用法代码示例。如果您正苦于以下问题:C++ UMovieScene::GetPlaybackRange方法的具体用法?C++ UMovieScene::GetPlaybackRange怎么用?C++ UMovieScene::GetPlaybackRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UMovieScene
的用法示例。
在下文中一共展示了UMovieScene::GetPlaybackRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdatePassSingle
void FMovieSceneSequenceInstance::UpdatePassSingle( EMovieSceneUpdateData& UpdateData, class IMovieScenePlayer& Player )
{
if(MovieSceneSequence.IsValid())
{
// Refresh time range so that spawnables can be created if they fall within the playback range, or destroyed if not
UMovieScene* MovieScene = MovieSceneSequence->GetMovieScene();
TimeRange = MovieScene->GetPlaybackRange();
TArray<TWeakObjectPtr<UObject>> NoObjects;
// update each master track
for( FMovieSceneInstanceMap::TIterator It( MasterTrackInstances ); It; ++It )
{
if (It.Value()->HasUpdatePasses() & UpdateData.UpdatePass && It.Value() != CameraCutTrackInstance)
{
It.Value()->Update( UpdateData, NoObjects, Player, *this);
}
}
// update tracks bound to objects
TMap<FGuid, FMovieSceneObjectBindingInstance>::TIterator ObjectIt = ObjectBindingInstances.CreateIterator();
for(; ObjectIt; ++ObjectIt )
{
FMovieSceneObjectBindingInstance& ObjectBindingInstance = ObjectIt.Value();
for( FMovieSceneInstanceMap::TIterator It = ObjectBindingInstance.TrackInstances.CreateIterator(); It; ++It )
{
if (It.Value()->HasUpdatePasses() & UpdateData.UpdatePass && It.Value() != CameraCutTrackInstance)
{
It.Value()->Update( UpdateData, ObjectBindingInstance.RuntimeObjects, Player, *this );
}
}
}
// update camera cut track last to make sure spawnable cameras are there, and to override sub-shots
if (CameraCutTrackInstance.IsValid())
{
if (CameraCutTrackInstance->HasUpdatePasses() & UpdateData.UpdatePass)
{
CameraCutTrackInstance->Update(UpdateData, NoObjects, Player, *this );
}
}
}
}
示例2: RefreshInstance
void FMovieSceneSequenceInstance::RefreshInstance( IMovieScenePlayer& Player )
{
if(MovieSceneSequence.IsValid())
{
UMovieScene* MovieScene = MovieSceneSequence->GetMovieScene();
TimeRange = MovieScene->GetPlaybackRange();
UMovieSceneTrack* CameraCutTrack = MovieScene->GetCameraCutTrack();
if (CameraCutTrack != nullptr)
{
FMovieSceneInstanceMap CameraCutTrackInstanceMap;
if (CameraCutTrackInstance.IsValid())
{
CameraCutTrackInstanceMap.Add(CameraCutTrack, CameraCutTrackInstance);
}
TArray<TWeakObjectPtr<UObject>> Objects;
TArray<UMovieSceneTrack*> Tracks;
Tracks.Add(CameraCutTrack);
RefreshInstanceMap(Tracks, Objects, CameraCutTrackInstanceMap, Player);
CameraCutTrackInstance = CameraCutTrackInstanceMap.FindRef(CameraCutTrack);
}
else if(CameraCutTrackInstance.IsValid())
{
CameraCutTrackInstance->ClearInstance(Player, *this);
CameraCutTrackInstance.Reset();
}
// Get all the master tracks and create instances for them if needed
const TArray<UMovieSceneTrack*>& MasterTracks = MovieScene->GetMasterTracks();
TArray<TWeakObjectPtr<UObject>> Objects;
RefreshInstanceMap( MasterTracks, Objects, MasterTrackInstances, Player );
TSet< FGuid > FoundObjectBindings;
// Get all tracks for each object binding and create instances for them if needed
const TArray<FMovieSceneBinding>& ObjectBindings = MovieScene->GetBindings();
for( int32 BindingIndex = 0; BindingIndex < ObjectBindings.Num(); ++BindingIndex )
{
const FMovieSceneBinding& ObjectBinding = ObjectBindings[BindingIndex];
// Create an instance for this object binding
FMovieSceneObjectBindingInstance& BindingInstance = ObjectBindingInstances.FindOrAdd( ObjectBinding.GetObjectGuid() );
BindingInstance.ObjectGuid = ObjectBinding.GetObjectGuid();
FoundObjectBindings.Add( ObjectBinding.GetObjectGuid() );
// Populate the runtime objects for this instance of the binding.
// @todo sequencer: SubSequences: We need to know which actors were removed and which actors were added so we know which saved actor state to restore/create
BindingInstance.RuntimeObjects.Empty();
Player.GetRuntimeObjects( SharedThis( this ), BindingInstance.ObjectGuid, BindingInstance.RuntimeObjects );
// Refresh the instance's tracks
const TArray<UMovieSceneTrack*>& Tracks = ObjectBinding.GetTracks();
RefreshInstanceMap( Tracks, BindingInstance.RuntimeObjects, BindingInstance.TrackInstances, Player );
}
IMovieSceneSpawnRegister& SpawnRegister = Player.GetSpawnRegister();
// Remove object binding instances which are no longer bound
TMap<FGuid, FMovieSceneObjectBindingInstance>::TIterator It = ObjectBindingInstances.CreateIterator();
for( ; It; ++It )
{
if( !FoundObjectBindings.Contains( It.Key() ) )
{
SpawnRegister.DestroySpawnedObject(It.Key(), *this, Player);
// The instance no longer is bound to an existing guid
It.RemoveCurrent();
}
}
}
}