Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki
+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
+ Bone animation tracks (FBoneAnimationTrack)
+ Key data (coarse)
+ Name
+ Bone tree index
+ Curve data (FAnimationCurveData)
+ Float Curves
+ Transform Curves
+ Play length
+ Sampling rate
+ Used for deriving the expected number of keys/frames when combined with the PlayLength
+ Transient data for supporting backwards compatibility APIs
+ (Dynamic) delegate which broadcasts the mutation Notifies
+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
+ API functionality allows to transform the contained data in all ways currently expected in the engine.
+ Any mutation will add an undo/redo-able FChange object into the transaction buffer
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
+ Broadcasts change notifies alongside a payload object containing details about the change
+ Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
+ Almost all functionality is exposed to both Blueprint and Python scripting
+ Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
+ Undo/redo actions
+ Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer
+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data
+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
+ Allows for targetting a specific RichCurve as part of a TransformCurve
+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies
+ Added CanTransact to UEngine, returns whether or not a transaction can be made
+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value
+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel
* Animation Sequence Base
+ virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
+ virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
+ Added UAnimDataModel sub-object (editor only)
+ Added UAnimDataController instance (transient and editor only)
+ FAnimationDataNotifyCollector to keep track of model bracketed notifies
* Deprecated
* SetSequenceLength()
* RefreshCurveData()
* MarkRawDataAsModified()
* RegisterOnAnimCurvesChanged()
* UnregisterOnAnimCurvesChanged()
* UnregisterOnAnimTrackCurvesChanged()
* RegisterOnAnimTrackCurvesChanged()
* Public access to RawCurveData
* Animation Sequence
+ Implements PopulateModel/OnModelModified for AnimationSequence related data
+ Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
+ Added NumberOfSampledKeys (editor only), populated by resampling process
+ Added NumberOfSampledFrames (editor only), populated by resampling process
+ Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
+ Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
* Deprecated
* SetNumberOfSampledKeys()
* MarkRawDataAsModified()
* GetRawAnimationData()
* GetAnimationTrackNames()
* AddNewRawTrack()
* GetRawTrackToSkeletonMapTable()
* GetRawAnimationTrack()
* GetRawAnimationTrack()
* UpdateFrameRate()
* ExtractBoneTransform()
* CompressRawAnimData()
* GetSkeletonIndexFromRawDataTrackIndex()
* RecycleAnimSequence()
* CleanAnimSequenceForImport()
* CopyNotifies()
* PostProcessSequence()
* AddLoopingInterpolation()
* RemoveAllTracks()
* DoesContainTransformCurves()
* InsertFramesToRawAnimData()
* CropRawAnimData()
* RemoveTrack()
* InsertTrack()
* ResizeSequence()
* Non-editor access to GetUncompressedRawSize()
* Non-editor access to GetApproxRawSize()
* Public access to UpdateCompressedCurveName()
* NumberOfKeys
* SamplingFrameRate
* TrackToSkeletonMapTable
* RawAnimationData
* AnimationTrackNames
* Animation Streamable
* Model from source Sequence is duplicated rather than copying animation data
* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)
+ Added automated test for
+ All script exposed controller functionality
+ Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data
+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
+ Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
+ Key reduction
+ Invalid track (missing bone from skeleton) removal
+ Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)
* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
* Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
+ Any mutations now go through the controller API
+ Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
+ Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
+ Registers to the outer AnimModel's notify event, used for updating the cached curve data
+ Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
* Not-ideal but point that I got to for V1
* Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel
* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
* Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes
[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Misc/Change.h"
|
|
|
|
|
|
|
|
|
|
#include "Animation/AnimData/AnimDataModel.h"
|
|
|
|
|
#include "Animation/AnimTypes.h"
|
|
|
|
|
#include "Misc/FrameRate.h"
|
|
|
|
|
|
|
|
|
|
class UObject;
|
|
|
|
|
class UAnimDataModel;
|
|
|
|
|
class UAnimDataController;
|
|
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
|
|
|
|
|
namespace UE {
|
|
|
|
|
|
|
|
|
|
namespace Anim {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* UAnimDataController instanced FChange-based objects used for storing mutations to an UAnimDataModel within the Transaction Buffer.
|
|
|
|
|
* Each Action class represents an (invertable) operation mutating an UAnimDataModel object utilizing a UAnimDataController. Allowing
|
|
|
|
|
* for a more granular approach to undo/redo-ing changes while also allowing for script-based interoperability.
|
|
|
|
|
*/
|
|
|
|
|
class FAnimDataBaseAction : public FSwapChange
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual TUniquePtr<FChange> Execute(UObject* Object) final;
|
|
|
|
|
virtual ~FAnimDataBaseAction() {}
|
|
|
|
|
virtual FString ToString() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) = 0;
|
|
|
|
|
virtual FString ToStringInternal() const = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FOpenBracketAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FOpenBracketAction(const FString& InDescription) : Description(InDescription) {}
|
|
|
|
|
virtual ~FOpenBracketAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FOpenBracketAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FString Description;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FCloseBracketAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FCloseBracketAction(const FString& InDescription) : Description(InDescription) {}
|
|
|
|
|
virtual ~FCloseBracketAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FCloseBracketAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FString Description;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FAddTrackAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddTrackAction(const FBoneAnimationTrack& Track, int32 TrackIndex);
|
|
|
|
|
virtual ~FAddTrackAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddTrackAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FName Name;
|
|
|
|
|
int32 BoneTreeIndex;
|
|
|
|
|
FRawAnimSequenceTrack Data;
|
|
|
|
|
int32 TrackIndex;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FRemoveTrackAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FRemoveTrackAction(const FBoneAnimationTrack& Track, int32 TrackIndex);
|
|
|
|
|
virtual ~FRemoveTrackAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FRemoveTrackAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FName Name;
|
|
|
|
|
int32 TrackIndex;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetTrackKeysAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetTrackKeysAction(const FBoneAnimationTrack& Track);
|
|
|
|
|
virtual ~FSetTrackKeysAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetTrackKeysAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FName Name;
|
|
|
|
|
int32 TrackIndex;
|
|
|
|
|
|
|
|
|
|
FRawAnimSequenceTrack TrackData;
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-21 08:40:20 -04:00
|
|
|
class FResizePlayLengthAction : public FAnimDataBaseAction
|
Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki
+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
+ Bone animation tracks (FBoneAnimationTrack)
+ Key data (coarse)
+ Name
+ Bone tree index
+ Curve data (FAnimationCurveData)
+ Float Curves
+ Transform Curves
+ Play length
+ Sampling rate
+ Used for deriving the expected number of keys/frames when combined with the PlayLength
+ Transient data for supporting backwards compatibility APIs
+ (Dynamic) delegate which broadcasts the mutation Notifies
+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
+ API functionality allows to transform the contained data in all ways currently expected in the engine.
+ Any mutation will add an undo/redo-able FChange object into the transaction buffer
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
+ Broadcasts change notifies alongside a payload object containing details about the change
+ Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
+ Almost all functionality is exposed to both Blueprint and Python scripting
+ Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
+ Undo/redo actions
+ Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer
+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data
+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
+ Allows for targetting a specific RichCurve as part of a TransformCurve
+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies
+ Added CanTransact to UEngine, returns whether or not a transaction can be made
+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value
+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel
* Animation Sequence Base
+ virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
+ virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
+ Added UAnimDataModel sub-object (editor only)
+ Added UAnimDataController instance (transient and editor only)
+ FAnimationDataNotifyCollector to keep track of model bracketed notifies
* Deprecated
* SetSequenceLength()
* RefreshCurveData()
* MarkRawDataAsModified()
* RegisterOnAnimCurvesChanged()
* UnregisterOnAnimCurvesChanged()
* UnregisterOnAnimTrackCurvesChanged()
* RegisterOnAnimTrackCurvesChanged()
* Public access to RawCurveData
* Animation Sequence
+ Implements PopulateModel/OnModelModified for AnimationSequence related data
+ Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
+ Added NumberOfSampledKeys (editor only), populated by resampling process
+ Added NumberOfSampledFrames (editor only), populated by resampling process
+ Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
+ Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
* Deprecated
* SetNumberOfSampledKeys()
* MarkRawDataAsModified()
* GetRawAnimationData()
* GetAnimationTrackNames()
* AddNewRawTrack()
* GetRawTrackToSkeletonMapTable()
* GetRawAnimationTrack()
* GetRawAnimationTrack()
* UpdateFrameRate()
* ExtractBoneTransform()
* CompressRawAnimData()
* GetSkeletonIndexFromRawDataTrackIndex()
* RecycleAnimSequence()
* CleanAnimSequenceForImport()
* CopyNotifies()
* PostProcessSequence()
* AddLoopingInterpolation()
* RemoveAllTracks()
* DoesContainTransformCurves()
* InsertFramesToRawAnimData()
* CropRawAnimData()
* RemoveTrack()
* InsertTrack()
* ResizeSequence()
* Non-editor access to GetUncompressedRawSize()
* Non-editor access to GetApproxRawSize()
* Public access to UpdateCompressedCurveName()
* NumberOfKeys
* SamplingFrameRate
* TrackToSkeletonMapTable
* RawAnimationData
* AnimationTrackNames
* Animation Streamable
* Model from source Sequence is duplicated rather than copying animation data
* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)
+ Added automated test for
+ All script exposed controller functionality
+ Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data
+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
+ Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
+ Key reduction
+ Invalid track (missing bone from skeleton) removal
+ Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)
* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
* Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
+ Any mutations now go through the controller API
+ Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
+ Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
+ Registers to the outer AnimModel's notify event, used for updating the cached curve data
+ Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
* Not-ideal but point that I got to for V1
* Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel
* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
* Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes
[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
|
|
|
{
|
|
|
|
|
public:
|
2021-01-21 08:40:20 -04:00
|
|
|
explicit FResizePlayLengthAction(const UAnimDataModel* InModel, float t0, float t1);
|
|
|
|
|
virtual ~FResizePlayLengthAction() {}
|
Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki
+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
+ Bone animation tracks (FBoneAnimationTrack)
+ Key data (coarse)
+ Name
+ Bone tree index
+ Curve data (FAnimationCurveData)
+ Float Curves
+ Transform Curves
+ Play length
+ Sampling rate
+ Used for deriving the expected number of keys/frames when combined with the PlayLength
+ Transient data for supporting backwards compatibility APIs
+ (Dynamic) delegate which broadcasts the mutation Notifies
+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
+ API functionality allows to transform the contained data in all ways currently expected in the engine.
+ Any mutation will add an undo/redo-able FChange object into the transaction buffer
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
+ Broadcasts change notifies alongside a payload object containing details about the change
+ Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
+ Almost all functionality is exposed to both Blueprint and Python scripting
+ Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
+ Undo/redo actions
+ Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer
+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data
+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
+ Allows for targetting a specific RichCurve as part of a TransformCurve
+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies
+ Added CanTransact to UEngine, returns whether or not a transaction can be made
+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value
+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel
* Animation Sequence Base
+ virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
+ virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
+ Added UAnimDataModel sub-object (editor only)
+ Added UAnimDataController instance (transient and editor only)
+ FAnimationDataNotifyCollector to keep track of model bracketed notifies
* Deprecated
* SetSequenceLength()
* RefreshCurveData()
* MarkRawDataAsModified()
* RegisterOnAnimCurvesChanged()
* UnregisterOnAnimCurvesChanged()
* UnregisterOnAnimTrackCurvesChanged()
* RegisterOnAnimTrackCurvesChanged()
* Public access to RawCurveData
* Animation Sequence
+ Implements PopulateModel/OnModelModified for AnimationSequence related data
+ Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
+ Added NumberOfSampledKeys (editor only), populated by resampling process
+ Added NumberOfSampledFrames (editor only), populated by resampling process
+ Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
+ Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
* Deprecated
* SetNumberOfSampledKeys()
* MarkRawDataAsModified()
* GetRawAnimationData()
* GetAnimationTrackNames()
* AddNewRawTrack()
* GetRawTrackToSkeletonMapTable()
* GetRawAnimationTrack()
* GetRawAnimationTrack()
* UpdateFrameRate()
* ExtractBoneTransform()
* CompressRawAnimData()
* GetSkeletonIndexFromRawDataTrackIndex()
* RecycleAnimSequence()
* CleanAnimSequenceForImport()
* CopyNotifies()
* PostProcessSequence()
* AddLoopingInterpolation()
* RemoveAllTracks()
* DoesContainTransformCurves()
* InsertFramesToRawAnimData()
* CropRawAnimData()
* RemoveTrack()
* InsertTrack()
* ResizeSequence()
* Non-editor access to GetUncompressedRawSize()
* Non-editor access to GetApproxRawSize()
* Public access to UpdateCompressedCurveName()
* NumberOfKeys
* SamplingFrameRate
* TrackToSkeletonMapTable
* RawAnimationData
* AnimationTrackNames
* Animation Streamable
* Model from source Sequence is duplicated rather than copying animation data
* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)
+ Added automated test for
+ All script exposed controller functionality
+ Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data
+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
+ Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
+ Key reduction
+ Invalid track (missing bone from skeleton) removal
+ Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)
* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
* Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
+ Any mutations now go through the controller API
+ Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
+ Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
+ Registers to the outer AnimModel's notify event, used for updating the cached curve data
+ Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
* Not-ideal but point that I got to for V1
* Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel
* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
* Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes
[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
|
|
|
protected:
|
2021-01-21 08:40:20 -04:00
|
|
|
FResizePlayLengthAction() {}
|
Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki
+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
+ Bone animation tracks (FBoneAnimationTrack)
+ Key data (coarse)
+ Name
+ Bone tree index
+ Curve data (FAnimationCurveData)
+ Float Curves
+ Transform Curves
+ Play length
+ Sampling rate
+ Used for deriving the expected number of keys/frames when combined with the PlayLength
+ Transient data for supporting backwards compatibility APIs
+ (Dynamic) delegate which broadcasts the mutation Notifies
+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
+ API functionality allows to transform the contained data in all ways currently expected in the engine.
+ Any mutation will add an undo/redo-able FChange object into the transaction buffer
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
+ Broadcasts change notifies alongside a payload object containing details about the change
+ Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
+ Almost all functionality is exposed to both Blueprint and Python scripting
+ Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
+ Undo/redo actions
+ Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer
+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data
+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
+ Allows for targetting a specific RichCurve as part of a TransformCurve
+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies
+ Added CanTransact to UEngine, returns whether or not a transaction can be made
+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value
+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel
* Animation Sequence Base
+ virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
+ virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
+ Added UAnimDataModel sub-object (editor only)
+ Added UAnimDataController instance (transient and editor only)
+ FAnimationDataNotifyCollector to keep track of model bracketed notifies
* Deprecated
* SetSequenceLength()
* RefreshCurveData()
* MarkRawDataAsModified()
* RegisterOnAnimCurvesChanged()
* UnregisterOnAnimCurvesChanged()
* UnregisterOnAnimTrackCurvesChanged()
* RegisterOnAnimTrackCurvesChanged()
* Public access to RawCurveData
* Animation Sequence
+ Implements PopulateModel/OnModelModified for AnimationSequence related data
+ Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
+ Added NumberOfSampledKeys (editor only), populated by resampling process
+ Added NumberOfSampledFrames (editor only), populated by resampling process
+ Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
+ Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
* Deprecated
* SetNumberOfSampledKeys()
* MarkRawDataAsModified()
* GetRawAnimationData()
* GetAnimationTrackNames()
* AddNewRawTrack()
* GetRawTrackToSkeletonMapTable()
* GetRawAnimationTrack()
* GetRawAnimationTrack()
* UpdateFrameRate()
* ExtractBoneTransform()
* CompressRawAnimData()
* GetSkeletonIndexFromRawDataTrackIndex()
* RecycleAnimSequence()
* CleanAnimSequenceForImport()
* CopyNotifies()
* PostProcessSequence()
* AddLoopingInterpolation()
* RemoveAllTracks()
* DoesContainTransformCurves()
* InsertFramesToRawAnimData()
* CropRawAnimData()
* RemoveTrack()
* InsertTrack()
* ResizeSequence()
* Non-editor access to GetUncompressedRawSize()
* Non-editor access to GetApproxRawSize()
* Public access to UpdateCompressedCurveName()
* NumberOfKeys
* SamplingFrameRate
* TrackToSkeletonMapTable
* RawAnimationData
* AnimationTrackNames
* Animation Streamable
* Model from source Sequence is duplicated rather than copying animation data
* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)
+ Added automated test for
+ All script exposed controller functionality
+ Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data
+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
+ Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
+ Key reduction
+ Invalid track (missing bone from skeleton) removal
+ Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)
* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
* Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
+ Any mutations now go through the controller API
+ Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
+ Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
+ Registers to the outer AnimModel's notify event, used for updating the cached curve data
+ Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
* Not-ideal but point that I got to for V1
* Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel
* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
* Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes
[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
float Length;
|
2021-01-21 08:40:20 -04:00
|
|
|
float T0;
|
|
|
|
|
float T1;
|
Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki
+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
+ Bone animation tracks (FBoneAnimationTrack)
+ Key data (coarse)
+ Name
+ Bone tree index
+ Curve data (FAnimationCurveData)
+ Float Curves
+ Transform Curves
+ Play length
+ Sampling rate
+ Used for deriving the expected number of keys/frames when combined with the PlayLength
+ Transient data for supporting backwards compatibility APIs
+ (Dynamic) delegate which broadcasts the mutation Notifies
+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
+ API functionality allows to transform the contained data in all ways currently expected in the engine.
+ Any mutation will add an undo/redo-able FChange object into the transaction buffer
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
+ Broadcasts change notifies alongside a payload object containing details about the change
+ Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
+ Almost all functionality is exposed to both Blueprint and Python scripting
+ Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
+ Undo/redo actions
+ Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer
+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data
+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
+ Allows for targetting a specific RichCurve as part of a TransformCurve
+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies
+ Added CanTransact to UEngine, returns whether or not a transaction can be made
+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value
+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel
* Animation Sequence Base
+ virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
+ virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
+ Added UAnimDataModel sub-object (editor only)
+ Added UAnimDataController instance (transient and editor only)
+ FAnimationDataNotifyCollector to keep track of model bracketed notifies
* Deprecated
* SetSequenceLength()
* RefreshCurveData()
* MarkRawDataAsModified()
* RegisterOnAnimCurvesChanged()
* UnregisterOnAnimCurvesChanged()
* UnregisterOnAnimTrackCurvesChanged()
* RegisterOnAnimTrackCurvesChanged()
* Public access to RawCurveData
* Animation Sequence
+ Implements PopulateModel/OnModelModified for AnimationSequence related data
+ Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
+ Added NumberOfSampledKeys (editor only), populated by resampling process
+ Added NumberOfSampledFrames (editor only), populated by resampling process
+ Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
+ Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
* Deprecated
* SetNumberOfSampledKeys()
* MarkRawDataAsModified()
* GetRawAnimationData()
* GetAnimationTrackNames()
* AddNewRawTrack()
* GetRawTrackToSkeletonMapTable()
* GetRawAnimationTrack()
* GetRawAnimationTrack()
* UpdateFrameRate()
* ExtractBoneTransform()
* CompressRawAnimData()
* GetSkeletonIndexFromRawDataTrackIndex()
* RecycleAnimSequence()
* CleanAnimSequenceForImport()
* CopyNotifies()
* PostProcessSequence()
* AddLoopingInterpolation()
* RemoveAllTracks()
* DoesContainTransformCurves()
* InsertFramesToRawAnimData()
* CropRawAnimData()
* RemoveTrack()
* InsertTrack()
* ResizeSequence()
* Non-editor access to GetUncompressedRawSize()
* Non-editor access to GetApproxRawSize()
* Public access to UpdateCompressedCurveName()
* NumberOfKeys
* SamplingFrameRate
* TrackToSkeletonMapTable
* RawAnimationData
* AnimationTrackNames
* Animation Streamable
* Model from source Sequence is duplicated rather than copying animation data
* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)
+ Added automated test for
+ All script exposed controller functionality
+ Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data
+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
+ Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
+ Key reduction
+ Invalid track (missing bone from skeleton) removal
+ Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)
* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
* Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
+ Any mutations now go through the controller API
+ Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
+ Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
+ Registers to the outer AnimModel's notify event, used for updating the cached curve data
+ Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
* Not-ideal but point that I got to for V1
* Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel
* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
* Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes
[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetFrameRateAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetFrameRateAction(const UAnimDataModel* InModel);
|
|
|
|
|
virtual ~FSetFrameRateAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetFrameRateAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FFrameRate FrameRate;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FAddCurveAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddCurveAction(const FAnimationCurveIdentifier& InCurveId, int32 InFlags) : CurveId(InCurveId), Flags(InFlags) {}
|
|
|
|
|
|
|
|
|
|
virtual ~FAddCurveAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddCurveAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
int32 Flags;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FAddFloatCurveAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddFloatCurveAction(const FAnimationCurveIdentifier& InCurveId, int32 InFlags, const TArray<FRichCurveKey>& InKeys, const FLinearColor& InColor) : CurveId(InCurveId), Flags(InFlags), Keys(InKeys), Color(InColor) {}
|
|
|
|
|
virtual ~FAddFloatCurveAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddFloatCurveAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
int32 Flags;
|
|
|
|
|
TArray<FRichCurveKey> Keys;
|
|
|
|
|
FLinearColor Color;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FAddTransformCurveAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddTransformCurveAction(const FAnimationCurveIdentifier& InCurveId, int32 InFlags, const FTransformCurve& InTransformCurve);
|
|
|
|
|
virtual ~FAddTransformCurveAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddTransformCurveAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
int32 Flags;
|
|
|
|
|
|
|
|
|
|
TArray<FRichCurveKey> SubCurveKeys[9];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FRemoveCurveAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FRemoveCurveAction(const FAnimationCurveIdentifier& InCurveId) : CurveId(InCurveId) {}
|
|
|
|
|
virtual ~FRemoveCurveAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FRemoveCurveAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetCurveFlagsAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetCurveFlagsAction(const FAnimationCurveIdentifier& InCurveId, int32 InFlags, ERawCurveTrackTypes InCurveType) : CurveId(InCurveId), Flags(InFlags), CurveType(InCurveType) {}
|
|
|
|
|
virtual ~FSetCurveFlagsAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetCurveFlagsAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
int32 Flags;
|
|
|
|
|
ERawCurveTrackTypes CurveType;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FRenameCurveAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FRenameCurveAction(const FAnimationCurveIdentifier& InCurveId, const FAnimationCurveIdentifier& InNewCurveId) : CurveId(InCurveId), NewCurveId(InNewCurveId) {}
|
|
|
|
|
virtual ~FRenameCurveAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FRenameCurveAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
FAnimationCurveIdentifier NewCurveId;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FScaleCurveAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FScaleCurveAction(const FAnimationCurveIdentifier& InCurveId, float InOrigin, float InFactor, ERawCurveTrackTypes InCurveType);
|
|
|
|
|
virtual ~FScaleCurveAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FScaleCurveAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
ERawCurveTrackTypes CurveType;
|
|
|
|
|
float Origin;
|
|
|
|
|
float Factor;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FAddRichCurveKeyAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddRichCurveKeyAction(const FAnimationCurveIdentifier& InCurveId, const FRichCurveKey& InKey) : CurveId(InCurveId), Key(InKey) {}
|
|
|
|
|
virtual ~FAddRichCurveKeyAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddRichCurveKeyAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
ERawCurveTrackTypes CurveType;
|
|
|
|
|
FRichCurveKey Key;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetRichCurveKeyAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetRichCurveKeyAction(const FAnimationCurveIdentifier& InCurveId, const FRichCurveKey& InKey) : CurveId(InCurveId), Key(InKey) {}
|
|
|
|
|
virtual ~FSetRichCurveKeyAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetRichCurveKeyAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
FRichCurveKey Key;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FRemoveRichCurveKeyAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FRemoveRichCurveKeyAction(const FAnimationCurveIdentifier& InCurveId, const float InTime) : CurveId(InCurveId), Time(InTime) {}
|
|
|
|
|
virtual ~FRemoveRichCurveKeyAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FRemoveRichCurveKeyAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
float Time;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetRichCurveKeysAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetRichCurveKeysAction(const FAnimationCurveIdentifier& InCurveId, const TArray<FRichCurveKey>& InKeys) : CurveId(InCurveId), Keys(InKeys) {}
|
|
|
|
|
virtual ~FSetRichCurveKeysAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetRichCurveKeysAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
TArray<FRichCurveKey> Keys;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetCurveColorAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetCurveColorAction(const FAnimationCurveIdentifier& InCurveId, const FLinearColor& InColor) : CurveId(InCurveId), Color(InColor) {}
|
|
|
|
|
virtual ~FSetCurveColorAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetCurveColorAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationCurveIdentifier CurveId;
|
|
|
|
|
FLinearColor Color;
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-02 09:04:09 -04:00
|
|
|
class FAddAtributeAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddAtributeAction(const FAnimatedBoneAttribute& InAttribute);
|
|
|
|
|
virtual ~FAddAtributeAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddAtributeAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationAttributeIdentifier AttributeId;
|
|
|
|
|
TArray<FAttributeKey> Keys;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FRemoveAtributeAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FRemoveAtributeAction(const FAnimationAttributeIdentifier& InAttributeId) : AttributeId(InAttributeId) {}
|
|
|
|
|
virtual ~FRemoveAtributeAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FRemoveAtributeAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationAttributeIdentifier AttributeId;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FAddAtributeKeyAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FAddAtributeKeyAction(const FAnimationAttributeIdentifier& InAttributeId, const FAttributeKey& InKey) : AttributeId(InAttributeId), Key(InKey) {}
|
|
|
|
|
virtual ~FAddAtributeKeyAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FAddAtributeKeyAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationAttributeIdentifier AttributeId;
|
|
|
|
|
FAttributeKey Key;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetAtributeKeyAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetAtributeKeyAction(const FAnimationAttributeIdentifier& InAttributeId, const FAttributeKey& InKey) : AttributeId(InAttributeId), Key(InKey) {}
|
|
|
|
|
virtual ~FSetAtributeKeyAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetAtributeKeyAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationAttributeIdentifier AttributeId;
|
|
|
|
|
FAttributeKey Key;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FRemoveAtributeKeyAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FRemoveAtributeKeyAction(const FAnimationAttributeIdentifier& InAttributeId, float InTime) : AttributeId(InAttributeId), Time(InTime) {}
|
|
|
|
|
virtual ~FRemoveAtributeKeyAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FRemoveAtributeKeyAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationAttributeIdentifier AttributeId;
|
|
|
|
|
float Time;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class FSetAtributeKeysAction : public FAnimDataBaseAction
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit FSetAtributeKeysAction(const FAnimatedBoneAttribute& InAttribute);
|
|
|
|
|
virtual ~FSetAtributeKeysAction() {}
|
|
|
|
|
protected:
|
|
|
|
|
FSetAtributeKeysAction() {}
|
|
|
|
|
virtual TUniquePtr<FChange> ExecuteInternal(UAnimDataModel* Model, UAnimDataController* Controller) override;
|
|
|
|
|
virtual FString ToStringInternal() const override;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
FAnimationAttributeIdentifier AttributeId;
|
|
|
|
|
TArray<FAttributeKey> Keys;
|
|
|
|
|
};
|
|
|
|
|
|
Animation data MVC refactor
#jira UE-104234
#rb Thomas.Sarkanen, Martin.Wilson, Alexis.Matte, Michael.Zyracki
+ Introduced UAnimDataModel, this currently represents the source data for bone and curve animation. It contains:
+ Bone animation tracks (FBoneAnimationTrack)
+ Key data (coarse)
+ Name
+ Bone tree index
+ Curve data (FAnimationCurveData)
+ Float Curves
+ Transform Curves
+ Play length
+ Sampling rate
+ Used for deriving the expected number of keys/frames when combined with the PlayLength
+ Transient data for supporting backwards compatibility APIs
+ (Dynamic) delegate which broadcasts the mutation Notifies
+ Introduced UAnimDataController, this has sole authority over mutating data contained by UAnimDataModel
+ API functionality allows to transform the contained data in all ways currently expected in the engine.
+ Any mutation will add an undo/redo-able FChange object into the transaction buffer
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
+ Broadcasts change notifies alongside a payload object containing details about the change
+ Interested systems/objects can register to these changes through UAnimDataModel::OnModelModified event
+ Almost all functionality is exposed to both Blueprint and Python scripting
+ Allows for opening 'Brackets', these define the beginning and end of a chain of mutations. Allowing anything registered to OnModelModified to halt responding to the notifies until the (top-level) bracket is closed
+ Undo/redo actions
+ Each mutation to the UAnimDataModel is covered by a 'Action' which is based of FChange and is used to insert a undo/redo-able operation into the transactions buffer
+ Introduced EAnimDataModelNotifType and per-notify payload types. These are used to update views, and any model derived data
+ Introduced FAnimationCurveIdentifier, exposed to scripting, this is used for referencing a curve by name and type when passed to the controller
+ Allows for targetting a specific RichCurve as part of a TransformCurve
+ Introduced FAnimationDataNotifyCollectorused for keeping track of which notifies of type EAnimDataModelNotifType are broadcasted between top-level EAnimDataModelNotifType::BracketOpened and EAnimDataModelNotifType::BracketClosed notifies
+ Added CanTransact to UEngine, returns whether or not a transaction can be made
+ Added UAnimCompositeBase::SetCompositeLength, used for runtime changing of play length value
+ Animation Sequence helpers, containing 'helper' functionality for both AnimSequence and AnimDataModel
* Animation Sequence Base
+ virtual PopulateModel, called during upgrade path for converting existing (legacy) data to the new UAnimDataModel data
+ virtual OnModelModified, registered to the Model's OnModified event to handle any Notifies and payloads
+ Added UAnimDataModel sub-object (editor only)
+ Added UAnimDataController instance (transient and editor only)
+ FAnimationDataNotifyCollector to keep track of model bracketed notifies
* Deprecated
* SetSequenceLength()
* RefreshCurveData()
* MarkRawDataAsModified()
* RegisterOnAnimCurvesChanged()
* UnregisterOnAnimCurvesChanged()
* UnregisterOnAnimTrackCurvesChanged()
* RegisterOnAnimTrackCurvesChanged()
* Public access to RawCurveData
* Animation Sequence
+ Implements PopulateModel/OnModelModified for AnimationSequence related data
+ Added TargetFrameRate, currently locked to the initial sampling rate, but allows for resampling the UAnimDataModel data according to the set rate
+ Added NumberOfSampledKeys (editor only), populated by resampling process
+ Added NumberOfSampledFrames (editor only), populated by resampling process
+ Added ResampledAnimationTrackData (editor only and transient), populated by resampling process
+ Added bBlockCompressionRequests (editor only), used for blocking compression during automation tests
* Deprecated
* SetNumberOfSampledKeys()
* MarkRawDataAsModified()
* GetRawAnimationData()
* GetAnimationTrackNames()
* AddNewRawTrack()
* GetRawTrackToSkeletonMapTable()
* GetRawAnimationTrack()
* GetRawAnimationTrack()
* UpdateFrameRate()
* ExtractBoneTransform()
* CompressRawAnimData()
* GetSkeletonIndexFromRawDataTrackIndex()
* RecycleAnimSequence()
* CleanAnimSequenceForImport()
* CopyNotifies()
* PostProcessSequence()
* AddLoopingInterpolation()
* RemoveAllTracks()
* DoesContainTransformCurves()
* InsertFramesToRawAnimData()
* CropRawAnimData()
* RemoveTrack()
* InsertTrack()
* ResizeSequence()
* Non-editor access to GetUncompressedRawSize()
* Non-editor access to GetApproxRawSize()
* Public access to UpdateCompressedCurveName()
* NumberOfKeys
* SamplingFrameRate
* TrackToSkeletonMapTable
* RawAnimationData
* AnimationTrackNames
* Animation Streamable
* Model from source Sequence is duplicated rather than copying animation data
* Deprecated ERawCurveTrackTypes::RCT_Vector (marked as hidden)
+ Added automated test for
+ All script exposed controller functionality
+ Undo/redo actions
* Updated existing AnimSequence tests with deprecation and new expected data
+ Base data for compression is now populated from the 'resampled' version stored on the AnimSequence
+ Data cleanup and validation is now performed during compression
+ Track sanitization is now performed during compression (normalizing Quats and clamping near-zero values to zero)
+ Key reduction
+ Invalid track (missing bone from skeleton) removal
+ Curve name validation against skeleton
* Replaced RawCurves with Float curves
* Updated DDC key
- Removed all Guid generation related functionality (now part of the model)
* AnimSequenceBase model registers to AnimModel's notify event, used for refreshing the tracks
* Replaces the in-place calling of RefreshTracks()
* All curve tracks now hold a const CurveType* rather than a CurveType*/& for introspection of its data
+ Any mutations now go through the controller API
+ Uses AnimationCurveIdentifier to set Transform's per-channel tracks
* RichCurveEditorModelNamed conformed to model/controller
+ Any modifications are applied to an temporary CurveType which always contains a copy of the const-ptr after any previous mutation
+ Registers to the outer AnimModel's notify event, used for updating the cached curve data
+ Registers to CurveModifiedDelegate, used for copying the temp curve data to the model using SetCurveKeys
* Not-ideal but point that I got to for V1
* Would be replaced with either refactoring FRichCurve to be MVC like, or by calling UAnimDataController functionality from an implementation of FRichCurveEditorModel
* Mark FChange overrides as final for swap/command change permutations
* Changed FCompoundChange GetDescription to return concatenation of all sub-changes
* Added GetDescription to FTransaction which returns the ToString() value of any contained FChange entries.
* Entries in SUndoHistory tab now have a ToolTip showing the GetDescription() value
+ FChangeTransactor helper object allows for keeping track of (compounded) FChange's and inserting them into GUndo
* Deprecation handling, conforming code to new APIs and exposing structure/objects/properties to scripting
* Conforming AnimSequence importing from FBX to Model/Controller changes
[CL 15106211 by Jurre deBaare in ue5-main branch]
2021-01-15 06:41:11 -04:00
|
|
|
} // namespace Anim
|
|
|
|
|
|
|
|
|
|
} // namespace UE
|
|
|
|
|
|
|
|
|
|
#endif // WITH_EDITOR
|