2019-12-27 09:26:59 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2018-05-29 18:32:14 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "UObject/ObjectMacros.h"
|
|
|
|
|
#include "MovieSceneSection.h"
|
|
|
|
|
#include "GeometryCacheComponent.h"
|
2019-03-11 18:57:59 -04:00
|
|
|
#include "GeometryCache.h"
|
2018-05-29 18:32:14 -04:00
|
|
|
#include "Channels/MovieSceneFloatChannel.h"
|
2018-06-13 11:37:42 -04:00
|
|
|
#include "UObject/SoftObjectPath.h"
|
2018-05-29 18:32:14 -04:00
|
|
|
#include "MovieSceneGeometryCacheSection.generated.h"
|
|
|
|
|
|
|
|
|
|
USTRUCT()
|
2019-03-11 18:57:59 -04:00
|
|
|
struct GEOMETRYCACHETRACKS_API FMovieSceneGeometryCacheParams
|
2018-05-29 18:32:14 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
FMovieSceneGeometryCacheParams();
|
|
|
|
|
|
|
|
|
|
/** Gets the animation sequence length, not modified by play rate */
|
2019-03-11 18:57:59 -04:00
|
|
|
float GetSequenceLength() const;
|
|
|
|
|
/** The animation this section plays */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "GeometryCache", DisplayName = "Geometry Cache")
|
2021-01-27 17:40:25 -04:00
|
|
|
TObjectPtr<UGeometryCache> GeometryCacheAsset;
|
2018-05-29 18:32:14 -04:00
|
|
|
|
2019-09-10 11:35:20 -04:00
|
|
|
/** The offset for the first loop of the animation clip */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category = "GeometryCache")
|
|
|
|
|
FFrameNumber FirstLoopStartFrameOffset;
|
2018-05-29 18:32:14 -04:00
|
|
|
|
|
|
|
|
/** The offset into the beginning of the animation clip */
|
2019-02-27 10:40:38 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = "GeometryCache")
|
2019-01-10 17:26:53 -05:00
|
|
|
FFrameNumber StartFrameOffset;
|
2019-02-27 10:40:38 -05:00
|
|
|
|
2018-05-29 18:32:14 -04:00
|
|
|
/** The offset into the end of the animation clip */
|
2019-02-27 10:40:38 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = "GeometryCache")
|
2019-01-10 17:26:53 -05:00
|
|
|
FFrameNumber EndFrameOffset;
|
2019-02-27 10:40:38 -05:00
|
|
|
|
2018-05-29 18:32:14 -04:00
|
|
|
/** The playback rate of the animation clip */
|
2019-02-27 10:40:38 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = "GeometryCache")
|
2018-05-29 18:32:14 -04:00
|
|
|
float PlayRate;
|
|
|
|
|
|
|
|
|
|
/** Reverse the playback of the animation clip */
|
2019-02-27 10:40:38 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = "Animation")
|
|
|
|
|
uint32 bReverse : 1;
|
2018-05-29 18:32:14 -04:00
|
|
|
|
2019-01-10 17:26:53 -05:00
|
|
|
UPROPERTY()
|
|
|
|
|
float StartOffset_DEPRECATED;
|
2019-02-27 10:40:38 -05:00
|
|
|
|
2019-01-10 17:26:53 -05:00
|
|
|
UPROPERTY()
|
|
|
|
|
float EndOffset_DEPRECATED;
|
2019-02-27 10:40:38 -05:00
|
|
|
|
2019-03-11 18:57:59 -04:00
|
|
|
UPROPERTY()
|
|
|
|
|
FSoftObjectPath GeometryCache_DEPRECATED;
|
2018-05-29 18:32:14 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Movie scene section that control geometry cache playback
|
|
|
|
|
*/
|
2019-02-27 10:40:38 -05:00
|
|
|
UCLASS(MinimalAPI)
|
2018-05-29 18:32:14 -04:00
|
|
|
class UMovieSceneGeometryCacheSection
|
|
|
|
|
: public UMovieSceneSection
|
|
|
|
|
{
|
|
|
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-02-27 10:40:38 -05:00
|
|
|
UPROPERTY(EditAnywhere, Category = "Animation", meta = (ShowOnlyInnerProperties))
|
2018-05-29 18:32:14 -04:00
|
|
|
FMovieSceneGeometryCacheParams Params;
|
|
|
|
|
|
|
|
|
|
/** Get Frame Time as Animation Time*/
|
2019-03-11 18:57:59 -04:00
|
|
|
virtual float MapTimeToAnimation(float ComponentDuration, FFrameTime InPosition, FFrameRate InFrameRate) const;
|
2018-05-29 18:32:14 -04:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
//~ UMovieSceneSection interface
|
|
|
|
|
virtual TOptional<TRange<FFrameNumber> > GetAutoSizeRange() const override;
|
2019-09-10 11:35:20 -04:00
|
|
|
virtual void TrimSection(FQualifiedFrameTime TrimTime, bool bTrimLeft, bool bDeleteKeys) override;
|
|
|
|
|
virtual UMovieSceneSection* SplitSection(FQualifiedFrameTime SplitTime, bool bDeleteKeys) override;
|
2018-05-29 18:32:14 -04:00
|
|
|
virtual void GetSnapTimes(TArray<FFrameNumber>& OutSnapTimes, bool bGetSectionBorders) const override;
|
|
|
|
|
virtual TOptional<FFrameTime> GetOffsetTime() const override;
|
2021-08-04 17:46:20 -04:00
|
|
|
virtual void MigrateFrameTimes(FFrameRate SourceRate, FFrameRate DestinationRate) override;
|
2018-05-29 18:32:14 -04:00
|
|
|
|
|
|
|
|
/** ~UObject interface */
|
2019-01-10 17:26:53 -05:00
|
|
|
virtual void PostLoad() override;
|
2018-05-29 18:32:14 -04:00
|
|
|
virtual void Serialize(FArchive& Ar) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
//~ UObject interface
|
|
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
|
2019-12-13 11:07:03 -05:00
|
|
|
virtual void PreEditChange(FProperty* PropertyAboutToChange) override;
|
2018-05-29 18:32:14 -04:00
|
|
|
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
2020-09-24 00:43:27 -04:00
|
|
|
public:
|
2018-05-29 18:32:14 -04:00
|
|
|
float PreviousPlayRate;
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
};
|