Ejemplo n.º 1
0
 virtual void Tick( const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime )
 {
     if (Sequencer.Pin()->IsShotFilteringOn())
     {
         TArray< TWeakObjectPtr<UMovieSceneSection> > FilterShots = Sequencer.Pin()->GetFilteringShotSections();
         // if there are filtering shots, continuously update the cached filter zones
         // we do this in tick, and cache it in order to make animation work properly
         CachedFilteredRanges.Empty();
         for (int32 i = 0; i < FilterShots.Num(); ++i)
         {
             UMovieSceneSection* Filter = FilterShots[i].Get();
             CachedFilteredRanges.Add(Filter->GetRange());
         }
     }
 }
TArray<UMovieSceneSection*> MovieSceneHelpers::GetTraversedSections( const TArray<UMovieSceneSection*>& Sections, float CurrentTime, float PreviousTime )
{
	TArray<UMovieSceneSection*> TraversedSections;

	bool bPlayingBackwards = CurrentTime - PreviousTime < 0.0f;
	
	float MaxTime = bPlayingBackwards ? PreviousTime : CurrentTime;
	float MinTime = bPlayingBackwards ? CurrentTime : PreviousTime;

	TRange<float> SliderRange(MinTime, MaxTime);

	for( int32 SectionIndex = 0; SectionIndex < Sections.Num(); ++SectionIndex )
	{
		UMovieSceneSection* Section = Sections[SectionIndex];
		if( Section->GetStartTime() == CurrentTime || SliderRange.Overlaps( TRange<float>( Section->GetRange() ) ) )
		{
			TraversedSections.Add( Section );
		}
	}

	return TraversedSections;
}