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


C++ UMovieSceneTrack::GetAllSections方法代码示例

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


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

示例1: 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;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:59,代码来源:AttachTrackEditor.cpp

示例2: 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);
		}
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:30,代码来源:SectionDragOperations.cpp

示例3: 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();
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:20,代码来源:SequencerNodeTree.cpp


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