本文整理汇总了C++中UMovieSceneTrack类的典型用法代码示例。如果您正苦于以下问题:C++ UMovieSceneTrack类的具体用法?C++ UMovieSceneTrack怎么用?C++ UMovieSceneTrack使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UMovieSceneTrack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFocusedMovieScene
void FSequencer::DeleteSection(class UMovieSceneSection* Section)
{
UMovieScene* MovieScene = GetFocusedMovieScene();
bool bAnythingRemoved = false;
UMovieSceneTrack* Track = CastChecked<UMovieSceneTrack>( Section->GetOuter() );
// If this check fails then the section is outered to a type that doesnt know about the section
//checkSlow( Track->HasSection(Section) );
Track->SetFlags( RF_Transactional );
FScopedTransaction DeleteSectionTransaction( NSLOCTEXT("Sequencer", "DeleteSection_Transaction", "Delete Section") );
Track->Modify();
Track->RemoveSection(Section);
bAnythingRemoved = true;
if( bAnythingRemoved )
{
UpdateRuntimeInstances();
}
}
示例2: check
UMovieSceneTrack* UMovieScene::FindTrack( TSubclassOf<UMovieSceneTrack> TrackClass, const FGuid& ObjectGuid, FName UniqueTrackName ) const
{
UMovieSceneTrack* FoundTrack = NULL;
check( UniqueTrackName != NAME_None && ObjectGuid.IsValid() )
for( int32 ObjectBindingIndex = 0; ObjectBindingIndex < ObjectBindings.Num(); ++ObjectBindingIndex )
{
const FMovieSceneObjectBinding& ObjectBinding = ObjectBindings[ObjectBindingIndex];
if( ObjectBinding.GetObjectGuid() == ObjectGuid )
{
const TArray<UMovieSceneTrack*>& Tracks = ObjectBinding.GetTracks();
for( int32 TrackIndex = 0; TrackIndex < Tracks.Num(); ++TrackIndex )
{
UMovieSceneTrack* Track = Tracks[TrackIndex];
if( Track->GetClass() == TrackClass && Track->GetTrackName() == UniqueTrackName )
{
FoundTrack = Track;
break;
}
}
}
}
return FoundTrack;
}
示例3: SetFlags
UMovieSceneSection* UMovieSceneSection::SplitSection(float SplitTime)
{
if (!IsTimeWithinSection(SplitTime))
{
return nullptr;
}
SetFlags(RF_Transactional);
if (TryModify())
{
float SectionEndTime = GetEndTime();
// Trim off the right
SetEndTime(SplitTime);
// Create a new section
UMovieSceneTrack* Track = CastChecked<UMovieSceneTrack>(GetOuter());
Track->Modify();
UMovieSceneSection* NewSection = DuplicateObject<UMovieSceneSection>(this, Track);
check(NewSection);
NewSection->SetStartTime(SplitTime);
NewSection->SetEndTime(SectionEndTime);
Track->AddSection(*NewSection);
return NewSection;
}
return nullptr;
}
示例4: GetSectionSnapTimes
void FSequencerDragOperation::GetSectionSnapTimes(TArray<float>& OutSnapTimes, UMovieSceneSection* Section, TSharedPtr<FTrackNode> SequencerNode, bool bIgnoreOurSectionCustomSnaps)
{
// @todo Sequencer handle dilation snapping better
// Collect all the potential snap times from other section borders
const TArray< TSharedRef<ISequencerSection> >& Sections = SequencerNode->GetSections();
for (int32 SectionIndex = 0; SectionIndex < Sections.Num(); ++SectionIndex)
{
const UMovieSceneSection* InSection = Sections[SectionIndex]->GetSectionObject();
bool bIsThisSection = Section == InSection;
if (!bIgnoreOurSectionCustomSnaps || !bIsThisSection)
{
InSection->GetSnapTimes(OutSnapTimes, Section != InSection);
}
}
// snap to director track if it exists, and we are not the director track
UMovieSceneTrack* OuterTrack = Cast<UMovieSceneTrack>(Section->GetOuter());
UMovieScene* MovieScene = Cast<UMovieScene>(OuterTrack->GetOuter());
UMovieSceneTrack* ShotTrack = MovieScene->FindMasterTrack(UMovieSceneShotTrack::StaticClass());
if (ShotTrack && OuterTrack != ShotTrack)
{
const TArray<UMovieSceneSection*>& ShotSections = ShotTrack->GetAllSections();
for (int32 SectionIndex = 0; SectionIndex < ShotSections.Num(); ++SectionIndex)
{
auto Shot = ShotSections[SectionIndex];
Shot->GetSnapTimes(OutSnapTimes, true);
}
}
}
示例5: GetFocusedMovieScene
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();
}
示例6: FindOrCreateHandleToObject
bool F3DAttachTrackEditor::AddKeyInternal( float KeyTime, const TArray<TWeakObjectPtr<UObject>> Objects, const FName SocketName, const FName ComponentName, AActor* ParentActor)
{
bool bHandleCreated = false;
bool bTrackCreated = false;
bool bTrackModified = false;
FGuid ParentActorId;
if (ParentActor != nullptr)
{
FFindOrCreateHandleResult HandleResult = FindOrCreateHandleToObject(ParentActor);
ParentActorId = HandleResult.Handle;
bHandleCreated |= HandleResult.bWasCreated;
}
if (!ParentActorId.IsValid())
{
return false;
}
for( int32 ObjectIndex = 0; ObjectIndex < Objects.Num(); ++ObjectIndex )
{
UObject* Object = Objects[ObjectIndex].Get();
FFindOrCreateHandleResult HandleResult = FindOrCreateHandleToObject( Object );
FGuid ObjectHandle = HandleResult.Handle;
bHandleCreated |= HandleResult.bWasCreated;
if (ObjectHandle.IsValid())
{
FFindOrCreateTrackResult TrackResult = FindOrCreateTrackForObject( ObjectHandle, UMovieScene3DAttachTrack::StaticClass());
UMovieSceneTrack* Track = TrackResult.Track;
bTrackCreated |= TrackResult.bWasCreated;
if (ensure(Track))
{
// Clamp to next attach section's start time or the end of the current sequencer view range
float AttachEndTime = GetSequencer()->GetViewRange().GetUpperBoundValue();
for (int32 AttachSectionIndex = 0; AttachSectionIndex < Track->GetAllSections().Num(); ++AttachSectionIndex)
{
float StartTime = Track->GetAllSections()[AttachSectionIndex]->GetStartTime();
float EndTime = Track->GetAllSections()[AttachSectionIndex]->GetEndTime();
if (KeyTime < StartTime)
{
if (AttachEndTime > StartTime)
{
AttachEndTime = StartTime;
}
}
}
Cast<UMovieScene3DAttachTrack>(Track)->AddConstraint( KeyTime, AttachEndTime, SocketName, ComponentName, ParentActorId );
bTrackModified = true;
}
}
}
return bHandleCreated || bTrackCreated || bTrackModified;
}
示例7: RefreshInstanceMap
void FMovieSceneSequenceInstance::RefreshInstanceMap( const TArray<UMovieSceneTrack*>& Tracks, const TArray<TWeakObjectPtr<UObject>>& RuntimeObjects, FMovieSceneInstanceMap& TrackInstances, IMovieScenePlayer& Player )
{
// All the tracks we found during this pass
TSet< UMovieSceneTrack* > FoundTracks;
// For every track, check if it has an instance, if not create one, otherwise refresh that instance
for( int32 TrackIndex = 0; TrackIndex < Tracks.Num(); ++TrackIndex )
{
UMovieSceneTrack* Track = Tracks[TrackIndex];
// A new track has been encountered
FoundTracks.Add( Track );
// See if the track has an instance
TSharedPtr<IMovieSceneTrackInstance> Instance = TrackInstances.FindRef( Track );
if ( !Instance.IsValid() )
{
// The track does not have an instance, create one
Instance = Track->CreateInstance();
Instance->RefreshInstance( RuntimeObjects, Player, *this );
Instance->SaveState(RuntimeObjects, Player, *this);
TrackInstances.Add( Track, Instance );
}
else
{
// The track has an instance, refresh it
Instance->RefreshInstance( RuntimeObjects, Player, *this );
Instance->SaveState(RuntimeObjects, Player, *this);
}
}
// Remove entries which no longer have a track associated with them
FMovieSceneInstanceMap::TIterator It = TrackInstances.CreateIterator();
for( ; It; ++It )
{
if( !FoundTracks.Contains( It.Key().Get() ) )
{
It.Value()->ClearInstance( Player, *this );
// This track was not found in the moviescene's track list so it was removed.
It.RemoveCurrent();
}
}
// Sort based on evaluation order
TrackInstances.ValueSort(FTrackInstanceEvalSorter());
}
示例8: FindMasterTrack
UMovieSceneTrack* UMovieScene::FindMasterTrack( TSubclassOf<UMovieSceneTrack> TrackClass ) const
{
UMovieSceneTrack* FoundTrack = NULL;
for( int32 TrackIndex = 0; TrackIndex < MasterTracks.Num(); ++TrackIndex )
{
UMovieSceneTrack* Track = MasterTracks[TrackIndex];
if( Track->GetClass() == TrackClass )
{
FoundTrack = Track;
break;
}
}
return FoundTrack;
}
示例9: MakeShareable
TSharedRef<ISequencerSection> F2DTransformTrackEditor::MakeSectionInterface( UMovieSceneSection& SectionObject, UMovieSceneTrack& Track )
{
check( SupportsType( SectionObject.GetOuter()->GetClass() ) );
UClass* SectionClass = SectionObject.GetOuter()->GetClass();
return MakeShareable( new F2DTransformSection( SectionObject, Track.GetTrackName() ) );
}
示例10: GetRecordingSection
UMovieSceneSubSection* UMovieSceneSubSection::GetRecordingSection()
{
// check if the section is still valid and part of a track (i.e. it has not been deleted or GCed)
if(TheRecordingSection.IsValid())
{
UMovieSceneTrack* TrackOuter = Cast<UMovieSceneTrack>(TheRecordingSection->GetOuter());
if(TrackOuter)
{
if(TrackOuter->HasSection(*TheRecordingSection.Get()))
{
return TheRecordingSection.Get();
}
}
}
return nullptr;
}
示例11: OnEndDrag
void FMoveSection::OnEndDrag(TSharedPtr<FTrackNode> SequencerNode)
{
DraggedKeyHandles.Empty();
if (Section.IsValid())
{
SequencerNode->FixRowIndices();
UMovieSceneTrack* OuterTrack = Cast<UMovieSceneTrack>(Section->GetOuter());
if (OuterTrack)
{
OuterTrack->Modify();
OuterTrack->OnSectionMoved(*Section);
}
}
EndTransaction();
}
示例12: MakeSectionInterfaces
void FSequencerNodeTree::MakeSectionInterfaces( UMovieSceneTrack& Track, TSharedRef<FTrackNode>& SectionAreaNode )
{
const TArray<UMovieSceneSection*>& MovieSceneSections = Track.GetAllSections();
TSharedRef<FMovieSceneTrackEditor> Editor = FindOrAddTypeEditor( Track );
for (int32 SectionIndex = 0; SectionIndex < MovieSceneSections.Num(); ++SectionIndex )
{
UMovieSceneSection* SectionObject = MovieSceneSections[SectionIndex];
TSharedRef<ISequencerSection> Section = Editor->MakeSectionInterface( *SectionObject, &Track );
// Ask the section to generate it's inner layout
FSectionLayoutBuilder Builder( SectionAreaNode );
Section->GenerateSectionLayout( Builder );
SectionAreaNode->AddSection( Section );
}
SectionAreaNode->FixRowIndices();
}
示例13:
TSharedRef<FMovieSceneTrackEditor> FSequencerNodeTree::FindOrAddTypeEditor( UMovieSceneTrack& InTrack )
{
TSharedPtr<FMovieSceneTrackEditor> Editor = EditorMap.FindRef( &InTrack );
if( !Editor.IsValid() )
{
const TArray< TSharedPtr<FMovieSceneTrackEditor> >& TrackEditors = Sequencer.GetTrackEditors();
// Get a tool for each track
// @todo Sequencer - Should probably only need to get this once and it shouldnt be done here. It depends on when movie scene tool modules are loaded
TSharedPtr<FMovieSceneTrackEditor> SupportedTool;
for( int32 EditorIndex = 0; EditorIndex < TrackEditors.Num(); ++EditorIndex )
{
if( TrackEditors[EditorIndex]->SupportsType( InTrack.GetClass() ) )
{
Editor = TrackEditors[EditorIndex];
EditorMap.Add( &InTrack, Editor );
break;
}
}
}
return Editor.ToSharedRef();
}
示例14: MakeShareable
TSharedRef<ISequencerSection> FColorPropertyTrackEditor::MakeSectionInterface(UMovieSceneSection& SectionObject, UMovieSceneTrack& Track, FGuid ObjectBinding)
{
UMovieScenePropertyTrack* PropertyTrack = Cast<UMovieScenePropertyTrack>(&Track);
checkf(PropertyTrack != nullptr, TEXT("Incompatible track in FColorPropertyTrackEditor"));
return MakeShareable(new FColorPropertySection(GetSequencer().Get(), ObjectBinding, PropertyTrack->GetPropertyName(), PropertyTrack->GetPropertyPath(), SectionObject, Track.GetDisplayName()));
}
示例15: MakeShareable
TSharedRef<ISequencerSection> FSubMovieSceneTrackEditor::MakeSectionInterface( UMovieSceneSection& SectionObject, UMovieSceneTrack& Track )
{
return MakeShareable( new FSubMovieSceneSection( GetSequencer(), SectionObject, Track.GetTrackName() ) );
}