void UMovieSceneActorReferenceSection::GetKeyHandles(TSet<FKeyHandle>& OutKeyHandles, TRange<float> TimeRange) const
{
	if (!TimeRange.Overlaps(GetRange()))
	{
		return;
	}

	for ( auto It( ActorGuidIndexCurve.GetKeyHandleIterator() ); It; ++It )
	{
		float Time = ActorGuidIndexCurve.GetKeyTime( It.Key() );
		if (TimeRange.Contains(Time))
		{
			OutKeyHandles.Add(It.Key());
		}
	}
}
Example #2
0
const UMovieSceneSection* UMovieSceneSection::OverlapsWithSections(const TArray<UMovieSceneSection*>& Sections, int32 TrackDelta, float TimeDelta) const
{
	int32 NewTrackIndex = RowIndex + TrackDelta;
	TRange<float> NewSectionRange = TRange<float>(StartTime + TimeDelta, EndTime + TimeDelta);
	for (int32 SectionIndex = 0; SectionIndex < Sections.Num(); ++SectionIndex)
	{
		const UMovieSceneSection* InSection = Sections[SectionIndex];
		if (this != InSection && InSection->GetRowIndex() == NewTrackIndex)
		{
			if (NewSectionRange.Overlaps(InSection->GetRange()))
			{
				return InSection;
			}
		}
	}
	return NULL;
}
bool FMovieSceneCinematicShotTrackInstance::ShouldEvaluateIfOverlapping(const TArray<UMovieSceneSection*>& TraversedSections, UMovieSceneSection* Section) const
{
	// Check with this shot's exclusive upper bound for when shots are adjacent to each other but on different rows.
	TRange<float> ThisSectionWithExclusiveUpper = TRange<float>(Section->GetRange().GetLowerBoundValue(), Section->GetRange().GetUpperBoundValue());

	// Only evaluate the top most row on overlapping cinematic shot sections. Disregard overlap priority.
	const bool bShouldRemove = TraversedSections.ContainsByPredicate([=](UMovieSceneSection* OtherSection){
		if (Section->GetRowIndex() > OtherSection->GetRowIndex() &&
			ThisSectionWithExclusiveUpper.Overlaps(OtherSection->GetRange()))
		{
			return true;
		}
		return false;
	});

	return bShouldRemove;
}
Example #4
0
bool FSequencer::IsSectionVisible(UMovieSceneSection* Section) const
{
	// if no shots are being filtered, don't filter at all
	bool bShowAll = !IsShotFilteringOn();

	bool bIsAShotSection = Section->IsA<UMovieSceneShotSection>();

	bool bIsUnfilterable = UnfilterableSections.Find(Section) != INDEX_NONE;

	// do not draw if not within the filtering shot sections
	TRange<float> SectionRange = Section->GetRange();
	bool bIsVisible = bShowAll || bIsAShotSection || bIsUnfilterable;
	for (int32 i = 0; i < FilteringShots.Num() && !bIsVisible; ++i)
	{
		TRange<float> ShotRange = FilteringShots[i]->GetRange();
		bIsVisible |= SectionRange.Overlaps(ShotRange);
	}

	return bIsVisible;
}
bool FMoveSection::IsSectionAtNewLocationValid(UMovieSceneSection* InSection, int32 RowIndex, float DeltaTime, TSharedPtr<FTrackNode> SequencerNode) const
{
	// Also get the closest borders on either side
	const TArray< TSharedRef<ISequencerSection> >& Sections = SequencerNode->GetSections();
	for (int32 SectionIndex = 0; SectionIndex < Sections.Num(); ++SectionIndex)
	{
		const UMovieSceneSection* MovieSection = Sections[SectionIndex]->GetSectionObject();
		if (InSection != MovieSection && MovieSection->GetRowIndex() == RowIndex)
		{
			TRange<float> OffsetSectionRange = TRange<float>(
				InSection->GetRange().GetLowerBoundValue() + DeltaTime,
				InSection->GetRange().GetUpperBoundValue() + DeltaTime);
			if (OffsetSectionRange.Overlaps(MovieSection->GetRange()))
			{
				return false;
			}
		}
	}
	return true;
}
const UMovieSceneSection* UMovieSceneSection::OverlapsWithSections(const TArray<UMovieSceneSection*>& Sections, int32 TrackDelta, float TimeDelta) const
{
	// Check overlaps with exclusive ranges so that sections can butt up against each other
	int32 NewTrackIndex = RowIndex + TrackDelta;
	TRange<float> NewSectionRange = TRange<float>(TRange<float>::BoundsType::Exclusive(StartTime + TimeDelta), TRange<float>::BoundsType::Exclusive(EndTime + TimeDelta));

	for (const auto Section : Sections)
	{
		check(Section);
		if ((this != Section) && (Section->GetRowIndex() == NewTrackIndex))
		{
			TRange<float> ExclusiveSectionRange = TRange<float>(TRange<float>::BoundsType::Exclusive(Section->GetRange().GetLowerBoundValue()), TRange<float>::BoundsType::Exclusive(Section->GetRange().GetUpperBoundValue()));
			if (NewSectionRange.Overlaps(ExclusiveSectionRange))
			{
				return Section;
			}
		}
	}

	return nullptr;
}
void UMovieSceneComposurePostMoveSettingsSection::GetKeyHandles(TSet<FKeyHandle>& OutKeyHandles, TRange<float> TimeRange) const
{
	if (!TimeRange.Overlaps(GetRange()))
	{
		return;
	}

	TArray<const FRichCurve*> AllCurves;
	GetAllCurves(AllCurves);

	for (const FRichCurve* Curve : AllCurves)
	{
		for (auto It(Curve->GetKeyHandleIterator()); It; ++It)
		{
			float Time = Curve->GetKeyTime(It.Key());
			if (TimeRange.Contains(Time))
			{
				OutKeyHandles.Add(It.Key());
			}
		}
	}
}