UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimationAsset.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
8#pragma once
9
10#include "CoreMinimal.h"
11#include "Animation/AnimTypes.h"
13#include "UObject/Object.h"
14#include "Misc/Guid.h"
17#include "AnimInterpFilter.h"
18#include "AnimEnums.h"
20#if WITH_EDITOR
21#include "IO/IoHash.h"
22#endif // WITH_EDITOR
23#include "AnimationAsset.generated.h"
24
25class UAnimMetaData;
26class UAnimMontage;
28class UAssetUserData;
29class USkeleton;
31class UBlendSpace;
32class UPoseAsset;
34class USkeletalMesh;
35class ITargetPlatform;
37namespace SmartName
38{
40}
41
42namespace UE { namespace Anim {
44}}
45
47{
48 enum Type
49 {
52 };
53};
54
65
67{
68 //Current Position in marker space, equivalent to TimeAccumulator
71
72 bool IsValid(bool bLooping) const
73 {
75 return PreviousMarker.MarkerIndex > Threshold && NextMarker.MarkerIndex > Threshold;
76 }
77
79
81 FString ToString() const
82 {
83 return FString::Printf(TEXT("[PreviousMarker Index/Time %i/%.2f, NextMarker Index/Time %i/%.2f]"), PreviousMarker.MarkerIndex, PreviousMarker.TimeToMarker, NextMarker.MarkerIndex, NextMarker.TimeToMarker);
84 }
85};
86
98{
99public:
100 void Set(float InPrevious, float InDelta)
101 {
102 Previous = InPrevious;
103 Delta = InDelta;
104 bPreviousIsValid = true;
105 }
106 void SetPrevious(float InPrevious) { Previous = InPrevious; bPreviousIsValid = true; }
107 float GetPrevious() const { return Previous; }
108 bool IsPreviousValid() const { return bPreviousIsValid; }
109
110 float Delta = 0.f;
111
112 FDeltaTimeRecord() = default;
113 explicit FDeltaTimeRecord(float InDeltaTime) : Delta(InDeltaTime), Previous(0.f) {}
114private:
115 float Previous = 0.f;
116 bool bPreviousIsValid = false; // Will be set to true when Previous has been set
117};
118
120USTRUCT(BlueprintType)
122{
124
125 UPROPERTY()
126 int32 SampleDataIndex;
127
128 UPROPERTY()
130
131 UPROPERTY()
132 float TotalWeight;
133
134 // Rate of change of the Weight - used in smoothed BlendSpace blends
135 UPROPERTY()
136 float WeightRate;
137
138 UPROPERTY()
139 float Time;
140
141 UPROPERTY()
142 float PreviousTime;
143
144 // We may merge multiple samples if they use the same animation
145 // Calculate the combined sample play rate here
146 UPROPERTY()
147 float SamplePlayRate;
148
149 FDeltaTimeRecord DeltaTimeRecord;
150
151 FMarkerTickRecord MarkerTickRecord;
152
153 // transient per-bone interpolation data
154 TArray<float> PerBoneBlendData;
155
156 // transient per-bone weight rate - only allocated when used
157 TArray<float> PerBoneWeightRate;
158
160 : SampleDataIndex(0)
161 , Animation(nullptr)
162 , TotalWeight(0.f)
163 , WeightRate(0.f)
164 , Time(0.f)
165 , PreviousTime(0.f)
166 , SamplePlayRate(0.0f)
167 , DeltaTimeRecord()
168 {
169 }
170
172 : SampleDataIndex(Index)
173 , Animation(nullptr)
174 , TotalWeight(0.f)
175 , WeightRate(0.f)
176 , Time(0.f)
177 , PreviousTime(0.f)
178 , SamplePlayRate(0.0f)
179 , DeltaTimeRecord()
180 {
181 }
182
183 bool operator==( const FBlendSampleData& Other ) const
184 {
185 // if same position, it's same point
186 return (Other.SampleDataIndex== SampleDataIndex);
187 }
188 void AddWeight(float Weight)
189 {
190 TotalWeight += Weight;
191 }
192
193 UE_DEPRECATED(5.0, "GetWeight() was renamed to GetClampedWeight()")
194 float GetWeight() const
195 {
196 return GetClampedWeight();
197 }
198
199 float GetClampedWeight() const
200 {
201 return FMath::Clamp<float>(TotalWeight, 0.f, 1.f);
202 }
203
204 static void ENGINE_API NormalizeDataWeight(TArray<FBlendSampleData>& SampleDataList);
205};
206
207USTRUCT()
209{
211
213
215 {
216 }
217
219 {
220 return FVector(
221 FilterPerAxis.Num() > 0 ? FilterPerAxis[0].LastOutput : 0.0f,
222 FilterPerAxis.Num() > 1 ? FilterPerAxis[1].LastOutput : 0.0f,
223 FilterPerAxis.Num() > 2 ? FilterPerAxis[2].LastOutput : 0.0f);
224 }
225};
226
227/*
228 * Pose Curve container for extraction
229 * This is used by pose anim node
230 * Saves Name/PoseIndex/Value of the curve
231 */
233{
234 UE_DEPRECATED(5.3, "UID is no longer used.")
236
237 // The name of the curve
239 // PoseIndex of pose asset it's dealing with
240 // used to extract pose value fast
242 // Curve Value
243 float Value;
244
246 : Name(NAME_None)
248 , Value(0.f)
249 {}
250
252 : Name(InName)
254 , Value(InValue)
255 {}
256
257 UE_DEPRECATED(5.3, "Please use the constructor that takes an FName.")
263};
264
267{
270
273
276
279
285
292
300
301#if WITH_EDITOR
302 bool bIgnoreRootLock;
303
304 // Experimental
306
307 // Flag when set will enforce evaluation/sampling of, specific, compressed animation data, will assert if it is missing (user is responsible for ensuring the data was previously requested/resident)
309 // Used in combination with bForceSampleCompressedData, forcing a specific target platform hash with corresponding compressed data to sample (retrieved using UAnimSequence::GetDerivedDataKeyHash)
311 // Used in combination with bForceSampleCompressedData, forcing a specific target platform its compressed data to sample
312 const ITargetPlatform* TargetPlatform = nullptr;
313#endif
314
315 UE_DEPRECATED(5.1, "FAnimExtractContext construct with float-based time value is deprecated, use other signature")
330
345
346 bool IsBoneRequired(int32 BoneIndex) const
347 {
348 if (BoneIndex >= BonesRequired.Num())
349 {
350 return true;
351 }
352
353 return BonesRequired[BoneIndex];
354 }
355};
356
357//Represent a current play position in an animation
358//based on sync markers
359USTRUCT(BlueprintType)
361{
363
364
365 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Sync)
366 FName PreviousMarkerName;
367
369 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Sync)
370 FName NextMarkerName;
371
376 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Sync)
377 float PositionBetweenMarkers;
378
380 bool IsValid() const { return (PreviousMarkerName != NAME_None && NextMarkerName != NAME_None); }
381
383 : PositionBetweenMarkers(0.0f)
384 {}
385
387 : PreviousMarkerName(InPrevMarkerName)
388 , NextMarkerName(InNextMarkerName)
389 , PositionBetweenMarkers(InAlpha)
390 {}
391
393 FString ToString() const
394 {
395 return FString::Printf(TEXT("[PreviousMarker %s, NextMarker %s] : %0.2f "), *PreviousMarkerName.ToString(), *NextMarkerName.ToString(), PositionBetweenMarkers);
396 }
397};
398
405
409USTRUCT()
411{
413
414 UPROPERTY()
415 TObjectPtr<class UAnimationAsset> SourceAsset = nullptr;
416
417 float* TimeAccumulator = nullptr;
418 float PlayRateMultiplier = 1.0f;
419 float EffectiveBlendWeight = 0.0f;
420 float RootMotionWeightModifier = 1.0f;
421
422 bool bLooping = false;
423 bool bIsEvaluator = false;
424 bool bRequestedInertialization = false;
425 bool bOverridePositionWhenJoiningSyncGroupAsLeader = false;
426 bool bIsExclusiveLeader = false;
427 bool bActiveContext = true;
428
429 const UMirrorDataTable* MirrorDataTable = nullptr;
430
431 TSharedPtr<TArray<TUniquePtr<const UE::Anim::IAnimNotifyEventContextDataInterface>>> ContextData;
432
433 union
434 {
435 struct
436 {
443 } BlendSpace;
444
445 struct
446 {
447 float CurrentPosition; // montage doesn't use accumulator, but this
450 };
451
452 // Asset players (and other nodes) have ownership of their respective DeltaTimeRecord value/state,
453 // while an asset's tick update will forward the time-line through the tick record
454 FDeltaTimeRecord* DeltaTimeRecord = nullptr;
455
456 // marker sync related data
457 FMarkerTickRecord* MarkerTickRecord = nullptr;
458 bool bCanUseMarkerSync = false;
459 float LeaderScore = 0.0f;
460
461 // Return the root motion weight for this tick record
462 float GetRootMotionWeight() const { return EffectiveBlendWeight * RootMotionWeightModifier; }
463
464private:
465 void AllocateContextDataContainer();
466
467public:
468 FAnimTickRecord() = default;
469
470 // Create a tick record for an anim sequence
471 UE_DEPRECATED(5.2, "Please use the anim sequence FAnimTickRecord constructor which adds bInIsEvaluator (defaulted to false)")
473
474 // Create a tick record for an anim sequence
476
477 // Create a tick record for a blendspace
481
482 // Create a tick record for a montage
483 UE_DEPRECATED(5.0, "Please use the montage FAnimTickRecord constructor which removes InPreviousPosition and InMoveDelta")
485
486 // Create a tick record for a montage
488
489 // Create a tick record for a pose asset
491
492 // Gather any data from the current update context
493 ENGINE_API void GatherContextData(const FAnimationUpdateContext& InContext);
494
495 // Explicitly add typed context data to the tick record
497 void MakeContextData(TArgs&&... Args)
498 {
499 static_assert(TPointerIsConvertibleFromTo<Type, const UE::Anim::IAnimNotifyEventContextDataInterface>::Value, "'Type' template parameter to MakeContextData must be derived from IAnimNotifyEventContextDataInterface");
500 if (!ContextData.IsValid())
501 {
502 AllocateContextDataContainer();
503 }
504
505 ContextData->Add(MakeUnique<Type>(Forward<TArgs>(Args)...));
506 }
507
509 bool operator <(const FAnimTickRecord& Other) const { return LeaderScore > Other.LeaderScore; }
510};
511
513{
514public:
515
517
521
523 : ValidMarkers(&DefaultMarkerNames)
524 {}
525
527 {
528 MarkerSyncStartPostion = SyncPosition;
529 }
530
532 {
533 MarkerSyncEndPostion = SyncPosition;
534 }
535
537 {
538 return MarkerSyncStartPostion;
539 }
540
542 {
543 return MarkerSyncEndPostion;
544 }
545
547 {
548 return *ValidMarkers;
549 }
550
552 {
553 return MarkerSyncStartPostion.IsValid();
554 }
555
557 {
558 // does it have proper end position
559 return MarkerSyncEndPostion.IsValid();
560 }
561
563
565 FString ToString() const
566 {
567 FString MarkerString;
568
569 for (const auto& ValidMarker : *ValidMarkers)
570 {
571 MarkerString.Append(FString::Printf(TEXT("%s,"), *ValidMarker.ToString()));
572 }
573
574 return FString::Printf(TEXT(" - Sync Start Position : %s\n - Sync End Position : %s\n - Markers : %s"),
575 *MarkerSyncStartPostion.ToString(), *MarkerSyncEndPostion.ToString(), *MarkerString);
576 }
577private:
578 // Structure representing our sync position based on markers before tick
579 // This is used to allow new animations to play from the right marker position
580 FMarkerSyncAnimPosition MarkerSyncStartPostion;
581
582 // Structure representing our sync position based on markers after tick
583 FMarkerSyncAnimPosition MarkerSyncEndPostion;
584
585 // Valid marker names for this sync group
586 const TArray<FName>* ValidMarkers;
587};
588
589
590UENUM()
592{
593 enum Type : int
594 {
596 CanBeLeader,
597
599 AlwaysFollower,
600
602 AlwaysLeader,
603
605 TransitionLeader,
606
608 TransitionFollower,
609
611 ExclusiveAlwaysLeader,
612 };
613}
614
615// Deprecated - do not use
616UENUM()
618{
619 // Sync only with animations in the current instance (either main or linked instance)
620 Local,
621
622 // Sync with all animations in the main and linked instances of this skeletal mesh component
623 Component,
624};
625
626// How an asset will synchronize with other assets
627UENUM()
629{
630 // Don't sync ever
631 DoNotSync,
632
633 // Use a named sync group
634 SyncGroup,
635
636 // Use the graph structure to provide a sync group to apply
637 Graph
638};
639
640USTRUCT()
642{
644
645public:
646 // The list of animation players in this group which are going to be evaluated this frame
648
649 // The current group leader
650 // @note : before ticking, this is invalid
651 // after ticking, this should contain the real leader
652 // during ticket, this list gets sorted by LeaderScore of AnimTickRecord,
653 // and it starts from 0 index, but if that fails due to invalid position, it will go to the next available leader
655
656 // Valid marker names for this sync group
658
659 // Can we use sync markers for ticking this sync group
661
662 // This has latest Montage Leader Weight
664
666
667 // Float in 0 - 1 range representing how far through an animation we were before ticking
669
670 // Float in 0 - 1 range representing how far through an animation we are
672
673public:
675 : GroupLeaderIndex(INDEX_NONE)
676 , bCanUseMarkerSync(false)
677 , MontageLeaderWeight(0.f)
678 , PreviousAnimLengthRatio(0.f)
679 , AnimLengthRatio(0.f)
680 {
681 }
682
683 void Reset()
684 {
685 GroupLeaderIndex = INDEX_NONE;
686 ActivePlayers.Reset();
687 bCanUseMarkerSync = false;
688 MontageLeaderWeight = 0.f;
689 MarkerTickContext = FMarkerTickContext();
690 PreviousAnimLengthRatio = 0.f;
691 AnimLengthRatio = 0.f;
692 }
693
694 // Checks the last tick record in the ActivePlayers array to see if it's a better leader than the current candidate.
695 // This should be called once for each record added to ActivePlayers, after the record is setup.
696 ENGINE_API void TestTickRecordForLeadership(EAnimGroupRole::Type MembershipType);
697
698 UE_DEPRECATED(5.0, "Use TestTickRecordForLeadership, as it now internally supports montages")
699 void TestMontageTickRecordForLeadership() { TestTickRecordForLeadership(EAnimGroupRole::CanBeLeader); }
700
701 // Called after leader has been ticked and decided
703
704 // Called after all tick records have been added but before assets are actually ticked
705 ENGINE_API void Prepare(const FAnimGroupInstance* PreviousGroup);
706};
707
709USTRUCT()
711{
713
714private:
715 ENGINE_API static FVector RootMotionScale;
716
717public:
718
719 UPROPERTY()
720 bool bHasRootMotion;
721
722 UPROPERTY()
723 float BlendWeight;
724
725private:
726 UPROPERTY()
727 FTransform RootMotionTransform;
728
729public:
731 : bHasRootMotion(false)
732 , BlendWeight(0.f)
733 {
734 }
735
736 // Copy/Move constructors and assignment operator added for deprecation support
737 // Could be removed once RootMotionTransform is made private
739 : bHasRootMotion(Other.bHasRootMotion)
740 , BlendWeight(Other.BlendWeight)
741 {
742 RootMotionTransform = Other.RootMotionTransform;
743 }
744
746 : bHasRootMotion(Other.bHasRootMotion)
747 , BlendWeight(Other.BlendWeight)
748 {
749 RootMotionTransform = Other.RootMotionTransform;
750 }
751
753 {
754 bHasRootMotion = Other.bHasRootMotion;
755 BlendWeight = Other.BlendWeight;
756 RootMotionTransform = Other.RootMotionTransform;
757 return *this;
758 }
759
761 {
762 bHasRootMotion = true;
763 RootMotionTransform = InTransform;
764 RootMotionTransform.SetScale3D(RootMotionScale);
765 BlendWeight = 1.f;
766 }
767
769 {
770 if (!bHasRootMotion)
771 {
773 }
774 else
775 {
776 RootMotionTransform = InTransform * RootMotionTransform;
777 RootMotionTransform.SetScale3D(RootMotionScale);
778 }
779 }
780
782 {
783 if (MovementParams.bHasRootMotion)
784 {
785 Accumulate(MovementParams.RootMotionTransform);
786 }
787 }
788
790 {
792 if (bHasRootMotion)
793 {
794 RootMotionTransform.AccumulateWithShortestRotation(InTransform, VBlendWeight);
795 RootMotionTransform.SetScale3D(RootMotionScale);
796 BlendWeight += InBlendWeight;
797 }
798 else
799 {
801 BlendWeight = InBlendWeight;
802 }
803 }
804
806 {
807 if (MovementParams.bHasRootMotion)
808 {
809 AccumulateWithBlend(MovementParams.RootMotionTransform, InBlendWeight);
810 }
811 }
812
813 void Clear()
814 {
815 bHasRootMotion = false;
816 BlendWeight = 0.f;
817 }
818
820 {
821 float WeightLeft = FMath::Max(1.f - BlendWeight, 0.f);
823 {
824 AccumulateWithBlend(FTransform(), WeightLeft);
825 }
826 RootMotionTransform.NormalizeRotation();
827 }
828
830 {
831 FTransform PartialRootMotion(FQuat::Slerp(FQuat::Identity, RootMotionTransform.GetRotation(), Alpha), RootMotionTransform.GetTranslation()*Alpha, RootMotionScale);
832
833 // remove the part of the root motion we are applying now and leave the remainder in RootMotionTransform
834 RootMotionTransform = RootMotionTransform.GetRelativeTransform(PartialRootMotion);
835
838
839 check(PartialRootMotion.IsRotationNormalized());
840 check(RootMotionTransform.IsRotationNormalized());
841 return ReturnParams;
842 }
843
844 const FTransform& GetRootMotionTransform() const { return RootMotionTransform; }
845 void ScaleRootMotionTranslation(float TranslationScale) { RootMotionTransform.ScaleTranslation(TranslationScale); }
846};
847
848// This structure is used to either advance or synchronize animation players
850{
851public:
855 , DeltaTime(InDeltaTime)
856 , LeaderDelta(0.f)
857 , PreviousAnimLengthRatio(0.0f)
858 , AnimLengthRatio(0.0f)
859 , bIsMarkerPositionValid(ValidMarkerNames.Num() > 0)
860 , bIsLeader(true)
861 , bOnlyOneAnimationInGroup(bInOnlyOneAnimationInGroup)
862 , bResyncToSyncGroup(false)
863 {
864 }
865
868 , DeltaTime(InDeltaTime)
869 , LeaderDelta(0.f)
870 , PreviousAnimLengthRatio(0.0f)
871 , AnimLengthRatio(0.0f)
872 , bIsMarkerPositionValid(false)
873 , bIsLeader(true)
874 , bOnlyOneAnimationInGroup(bInOnlyOneAnimationInGroup)
875 , bResyncToSyncGroup(false)
876 {
877 }
878
879 // Are we the leader of our sync group (or ungrouped)?
880 bool IsLeader() const
881 {
882 return bIsLeader;
883 }
884
885 bool IsFollower() const
886 {
887 return !bIsLeader;
888 }
889
890 // Return the delta time of the tick
891 float GetDeltaTime() const
892 {
893 return DeltaTime;
894 }
895
897 {
898 LeaderDelta = InLeaderDelta;
899 }
900
901 float GetLeaderDelta() const
902 {
903 return LeaderDelta;
904 }
905
906 void SetPreviousAnimationPositionRatio(float NormalizedTime)
907 {
908 PreviousAnimLengthRatio = NormalizedTime;
909 }
910
911 void SetAnimationPositionRatio(float NormalizedTime)
912 {
913 AnimLengthRatio = NormalizedTime;
914 }
915
916 // Returns the previous synchronization point (normalized time)
918 {
919 return PreviousAnimLengthRatio;
920 }
921
922 // Returns the synchronization point (normalized time)
924 {
925 return AnimLengthRatio;
926 }
927
929 {
930 bIsMarkerPositionValid = false;
931 }
932
934 {
935 return bIsMarkerPositionValid;
936 }
937
939 {
940 bIsLeader = false;
941 }
942
944 {
945 return IsLeader();
946 }
947
949 {
950 return bOnlyOneAnimationInGroup;
951 }
952
954 {
955 bResyncToSyncGroup = bInResyncToSyncGroup;
956 }
957
958 // Should we resync to the sync group this tick (eg: when initializing or resuming from zero weight)?
960 {
961 return bResyncToSyncGroup;
962 }
963
964 //Root Motion accumulated from this tick context
966
967 // The root motion mode of the owning AnimInstance
969
971
972private:
973 float DeltaTime;
974
975 float LeaderDelta;
976
977 // Float in 0 - 1 range representing how far through an animation we were before ticking
978 float PreviousAnimLengthRatio;
979
980 // Float in 0 - 1 range representing how far through an animation we are
981 float AnimLengthRatio;
982
983 bool bIsMarkerPositionValid;
984
985 bool bIsLeader;
986
987 bool bOnlyOneAnimationInGroup;
988
989 // True if the asset player being ticked should (re)synchronize to the sync group's time (eg: it was inactive and has now reactivated)
990 bool bResyncToSyncGroup;
991};
992
993USTRUCT()
995{
997
998 // How this animation will synchronize with other animations.
999 UPROPERTY(EditAnywhere, Category=Settings)
1001
1002 // The group name that we synchronize with (NAME_None if it is not part of any group).
1003 UPROPERTY(EditAnywhere, Category=Settings, meta = (EditCondition = "Method == EAnimSyncMethod::SyncGroup"))
1004 FName GroupName;
1005
1006 // The role this animation can assume within the group (ignored if GroupName is not set)
1007 UPROPERTY(EditAnywhere, Category=Settings, meta = (EditCondition = "Method == EAnimSyncMethod::SyncGroup"))
1008 TEnumAsByte<EAnimGroupRole::Type> GroupRole;
1009
1011 : Method(EAnimSyncMethod::DoNotSync)
1012 , GroupName(NAME_None)
1013 , GroupRole(EAnimGroupRole::CanBeLeader)
1014 {
1015 }
1016};
1017
1018UCLASS(abstract, BlueprintType, MinimalAPI)
1020{
1022
1023private:
1025 UPROPERTY(AssetRegistrySearchable, Category=Animation, VisibleAnywhere)
1027
1029 FGuid SkeletonGuid;
1030
1032 FGuid SkeletonVirtualBoneGuid;
1033
1038 UPROPERTY(Category=MetaData, instanced, EditAnywhere)
1040
1041public:
1042 /*
1043 * Parent asset is used for AnimMontage when it derives all settings but remap animation asset.
1044 * For example, you can just use all parent's setting for the montage, but only remap assets
1045 * This isn't magic bullet unfortunately and it is consistent effort of keeping the data synced with parent
1046 * If you add new property, please make sure those property has to be copied for children.
1047 * If it does, please add the copy in the function RefreshParentAssetData
1048 * We'd like to extend this feature to BlendSpace in the future
1049 */
1050#if WITH_EDITORONLY_DATA
1054 UPROPERTY(AssetRegistrySearchable, Category=Animation, VisibleAnywhere)
1056
1061
1067
1069 {
1070 return AssetMappingTable;
1071 }
1072protected:
1074 UPROPERTY(Category=Animation, VisibleAnywhere)
1076#endif // WITH_EDITORONLY_DATA
1077
1078protected:
1080 UPROPERTY(EditAnywhere, AdvancedDisplay, Instanced, Category = Animation)
1082
1083public:
1091
1092 // this is used in editor only when used for transition getter
1093 // this doesn't mean max time. In Sequence, this is SequenceLength,
1094 // but for BlendSpace CurrentTime is normalized [0,1], so this is 1
1095 UE_DEPRECATED(5.0, "Use GetPlayLength instead")
1096 virtual float GetMaxCurrentTime() { return GetPlayLength(); }
1097
1098 UFUNCTION(BlueprintPure, Category = "Animation", meta=(BlueprintThreadSafe))
1099 virtual float GetPlayLength() const { return 0.f; };
1100
1101 ENGINE_API void SetSkeleton(USkeleton* NewSkeleton);
1102 UE_DEPRECATED(5.2, "ResetSkeleton has been deprecated, use ReplaceSkeleton or SetSkeleton instead")
1103 ENGINE_API void ResetSkeleton(USkeleton* NewSkeleton);
1105
1107 ENGINE_API void ValidateSkeleton();
1108
1110
1113 const TArray<UAnimMetaData*>& GetMetaData() const { return MetaData; }
1114
1116 UFUNCTION(BlueprintCallable, Category = "Animation")
1117 ENGINE_API UAnimMetaData* FindMetaDataByClass(const TSubclassOf<UAnimMetaData> MetaDataClass) const;
1118
1120 template<class T>
1121 T* FindMetaDataByClass() const
1122 {
1123 static_assert(TPointerIsConvertibleFromTo<T, const UAnimMetaData>::Value, "'T' template parameter to FindMetaDataByClass must be derived from UAnimMetaData");
1124
1125 return (T*)FindMetaDataByClass(T::StaticClass());
1126 }
1127
1128 ENGINE_API void AddMetaData(UAnimMetaData* MetaDataInstance);
1129 void EmptyMetaData() { MetaData.Empty(); }
1130 ENGINE_API void RemoveMetaData(UAnimMetaData* MetaDataInstance);
1132
1134 ENGINE_API virtual void SetPreviewMesh(USkeletalMesh* PreviewMesh, bool bMarkAsDirty = true) override;
1135 ENGINE_API virtual USkeletalMesh* GetPreviewMesh(bool bFindIfNotSet = false) override;
1136 ENGINE_API virtual USkeletalMesh* GetPreviewMesh() const override;
1137
1138#if WITH_EDITOR
1140 UFUNCTION(BlueprintCallable, Category=Animation)
1142
1148
1149 virtual void OnSetSkeleton(USkeleton* NewSkeleton) {}
1150
1151 // Helper function for GetAllAnimationSequencesReferred, it adds itself first and call GetAllAnimationSEquencesReferred
1153
1159
1160public:
1166
1167 virtual int32 GetMarkerUpdateCounter() const { return 0; }
1168
1173 bool HasParentAsset() const { return ParentAsset != nullptr; }
1174 ENGINE_API bool RemapAsset(UAnimationAsset* SourceAsset, UAnimationAsset* TargetAsset);
1175 // we have to update whenever we have anything loaded
1177protected:
1178 ENGINE_API virtual void RefreshParentAssetData();
1179#endif //WITH_EDITOR
1180
1181public:
1183 virtual TArray<FName>* GetUniqueMarkerNames() { return nullptr; }
1184
1185 //~ Begin IInterface_AssetUserData Interface
1186 ENGINE_API virtual void AddAssetUserData(UAssetUserData* InUserData) override;
1187 ENGINE_API virtual void RemoveUserDataOfClass(TSubclassOf<UAssetUserData> InUserDataClass) override;
1188 ENGINE_API virtual UAssetUserData* GetAssetUserDataOfClass(TSubclassOf<UAssetUserData> InUserDataClass) override;
1189 ENGINE_API virtual const TArray<UAssetUserData*>* GetAssetUserDataArray() const override;
1190 //~ End IInterface_AssetUserData Interface
1191
1192 //~ Begin UObject Interface.
1193#if WITH_EDITOR
1194 ENGINE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
1195 ENGINE_API virtual void GetAssetRegistryTags(FAssetRegistryTagsContext Context) const override;
1196 UE_DEPRECATED(5.4, "Implement the version that takes FAssetRegistryTagsContext instead.")
1197 ENGINE_API virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
1199#endif // WITH_EDITOR
1200
1205 virtual bool IsValidAdditive() const { return false; }
1206
1207#if WITH_EDITORONLY_DATA
1209 UPROPERTY(VisibleAnywhere, Instanced, Category = Thumbnail)
1211
1213 // @todo: note that this doesn't retarget right now
1214 UPROPERTY(duplicatetransient, EditAnywhere, Category = Animation)
1216
1217private:
1219 UPROPERTY(duplicatetransient, AssetRegistrySearchable)
1221#endif //WITH_EDITORONLY_DATA
1222
1223protected:
1224#if WITH_EDITOR
1226#endif // WITH_EDITOR
1227
1228public:
1229 class USkeleton* GetSkeleton() const { return Skeleton; }
1230
1231 FGuid GetSkeletonVirtualBoneGuid() const { return SkeletonVirtualBoneGuid; }
1232 void SetSkeletonVirtualBoneGuid(FGuid Guid) { SkeletonVirtualBoneGuid = Guid; }
1233 FGuid GetSkeletonGuid() const { return SkeletonGuid; }
1234};
1235
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UAnimMontage bool UAnimMontage UAnimMontage Montage
Definition AnimInstance.h:84
EAnimSyncMethod
Definition AnimationAsset.h:629
EAnimSyncGroupScope
Definition AnimationAsset.h:618
#define check(expr)
Definition AssertionMacros.h:314
#define WITH_EDITOR
Definition Build.h:67
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define FVector
Definition IOSSystemIncludes.h:8
bool operator<(const FTextFormatString &LHS, const FTextFormatString &RHS)
Definition ITextFormatArgumentModifier.h:147
UE::Math::TTransform< double > FTransform
Definition MathFwd.h:53
@ Num
Definition MetalRHIPrivate.h:234
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
#define ScalarRegister
Definition ScalarRegister.h:239
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
EDataValidationResult
Definition UObjectGlobals.h:4225
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
Definition Archive.h:1208
Definition AssetRegistryTagsContext.h:98
Definition DataValidation.h:40
Definition AnimationAsset.h:513
TArray< FPassedMarker > MarkersPassedThisTick
Definition AnimationAsset.h:562
void SetMarkerSyncEndPosition(const FMarkerSyncAnimPosition &SyncPosition)
Definition AnimationAsset.h:531
static const TArray< FName > DefaultMarkerNames
Definition AnimationAsset.h:516
FMarkerTickContext(const TArray< FName > &ValidMarkerNames)
Definition AnimationAsset.h:518
const TArray< FName > & GetValidMarkerNames() const
Definition AnimationAsset.h:546
FString ToString() const
Definition AnimationAsset.h:565
FMarkerTickContext()
Definition AnimationAsset.h:522
bool IsMarkerSyncStartValid() const
Definition AnimationAsset.h:551
const FMarkerSyncAnimPosition & GetMarkerSyncEndPosition() const
Definition AnimationAsset.h:541
bool IsMarkerSyncEndValid() const
Definition AnimationAsset.h:556
void SetMarkerSyncStartPosition(const FMarkerSyncAnimPosition &SyncPosition)
Definition AnimationAsset.h:526
const FMarkerSyncAnimPosition & GetMarkerSyncStartPosition() const
Definition AnimationAsset.h:536
Definition NameTypes.h:617
Definition Interface_AssetUserData.h:20
Definition Interface_PreviewMeshProvider.h:20
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
Definition EnumAsByte.h:22
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SubclassOf.h:30
Definition UniquePtr.h:107
Definition AnimMetaData.h:19
Definition AnimSequenceBase.h:37
Definition AnimSequence.h:203
Definition AnimationAsset.h:1020
FGuid GetSkeletonVirtualBoneGuid() const
Definition AnimationAsset.h:1231
class USkeleton * GetSkeleton() const
Definition AnimationAsset.h:1229
void EmptyMetaData()
Definition AnimationAsset.h:1129
virtual bool IsValidAdditive() const
Definition AnimationAsset.h:1205
virtual TArray< FName > * GetUniqueMarkerNames()
Definition AnimationAsset.h:1183
FGuid GetSkeletonGuid() const
Definition AnimationAsset.h:1233
void SetSkeletonVirtualBoneGuid(FGuid Guid)
Definition AnimationAsset.h:1232
Definition AssetMappingTable.h:61
Definition AssetUserData.h:18
Definition BlendSpace.h:467
Definition AnimNodeMessages.h:46
Definition MirrorDataTable.h:102
Definition Object.h:95
Definition PoseAsset.h:186
Definition SkeletalMesh.h:440
Definition Skeleton.h:295
Definition AnimationAsset.h:592
Type
Definition AnimEnums.h:30
Definition AnimationAsset.h:47
Type
Definition AnimationAsset.h:49
@ Uninitialized
Definition AnimationAsset.h:50
@ AnimationBoundary
Definition AnimationAsset.h:51
Definition AnimationAsset.h:38
uint16 UID_Type
Definition AnimationAsset.h:39
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition AnimationAsset.h:850
float GetLeaderDelta() const
Definition AnimationAsset.h:901
FAnimAssetTickContext(float InDeltaTime, ERootMotionMode::Type InRootMotionMode, bool bInOnlyOneAnimationInGroup, const TArray< FName > &ValidMarkerNames)
Definition AnimationAsset.h:852
FMarkerTickContext MarkerTickContext
Definition AnimationAsset.h:970
bool IsSingleAnimationContext() const
Definition AnimationAsset.h:948
float GetDeltaTime() const
Definition AnimationAsset.h:891
bool CanUseMarkerPosition() const
Definition AnimationAsset.h:933
void SetAnimationPositionRatio(float NormalizedTime)
Definition AnimationAsset.h:911
void SetLeaderDelta(float InLeaderDelta)
Definition AnimationAsset.h:896
void SetResyncToSyncGroup(bool bInResyncToSyncGroup)
Definition AnimationAsset.h:953
bool ShouldResyncToSyncGroup() const
Definition AnimationAsset.h:959
float GetAnimationPositionRatio() const
Definition AnimationAsset.h:923
bool IsLeader() const
Definition AnimationAsset.h:880
float GetPreviousAnimationPositionRatio() const
Definition AnimationAsset.h:917
bool IsFollower() const
Definition AnimationAsset.h:885
void SetPreviousAnimationPositionRatio(float NormalizedTime)
Definition AnimationAsset.h:906
bool ShouldGenerateNotifies() const
Definition AnimationAsset.h:943
void ConvertToFollower()
Definition AnimationAsset.h:938
FAnimAssetTickContext(float InDeltaTime, ERootMotionMode::Type InRootMotionMode, bool bInOnlyOneAnimationInGroup)
Definition AnimationAsset.h:866
void InvalidateMarkerSync()
Definition AnimationAsset.h:928
ERootMotionMode::Type RootMotionMode
Definition AnimationAsset.h:968
FRootMotionMovementParams RootMotionMovementParams
Definition AnimationAsset.h:965
Definition AnimationAsset.h:267
FDeltaTimeRecord DeltaTimeRecord
Definition AnimationAsset.h:275
bool IsBoneRequired(int32 BoneIndex) const
Definition AnimationAsset.h:346
FAnimExtractContext(double InCurrentTime=0.0, bool InbExtractRootMotion=false, FDeltaTimeRecord InDeltaTimeRecord={}, bool InbLooping=false)
Definition AnimationAsset.h:331
TArray< bool > BonesRequired
Definition AnimationAsset.h:291
bool bExtractRootMotion
Definition AnimationAsset.h:272
TOptional< EAnimInterpolationType > InterpolationOverride
Definition AnimationAsset.h:299
double CurrentTime
Definition AnimationAsset.h:269
TArray< FPoseCurve > PoseCurves
Definition AnimationAsset.h:284
bool bLooping
Definition AnimationAsset.h:278
Definition AnimationAsset.h:642
TArray< FAnimTickRecord > ActivePlayers
Definition AnimationAsset.h:647
float MontageLeaderWeight
Definition AnimationAsset.h:663
TArray< FName > ValidMarkers
Definition AnimationAsset.h:657
int32 GroupLeaderIndex
Definition AnimationAsset.h:654
bool bCanUseMarkerSync
Definition AnimationAsset.h:660
void Reset()
Definition AnimationAsset.h:683
FMarkerTickContext MarkerTickContext
Definition AnimationAsset.h:665
float PreviousAnimLengthRatio
Definition AnimationAsset.h:668
float AnimLengthRatio
Definition AnimationAsset.h:671
FAnimGroupInstance()
Definition AnimationAsset.h:674
Definition AnimNotifyQueue.h:161
Definition AnimationAsset.h:411
FAnimTickRecord()=default
int32 TriangulationIndex
Definition AnimationAsset.h:439
FBlendFilter * BlendFilter
Definition AnimationAsset.h:437
float BlendSpacePositionX
Definition AnimationAsset.h:440
bool bTeleportToTime
Definition AnimationAsset.h:442
float BlendSpacePositionY
Definition AnimationAsset.h:441
TArray< FPassedMarker > * MarkersPassedThisTick
Definition AnimationAsset.h:448
TArray< FBlendSampleData > * BlendSampleDataCache
Definition AnimationAsset.h:438
float GetRootMotionWeight() const
Definition AnimationAsset.h:462
float CurrentPosition
Definition AnimationAsset.h:447
Definition AnimationAsset.h:995
Definition AnimNodeBase.h:354
Definition AnimationAsset.h:209
FVector GetFilterLastOutput() const
Definition AnimationAsset.h:218
Definition AnimationAsset.h:122
float GetClampedWeight() const
Definition AnimationAsset.h:199
UE_DEPRECATED(5.0, "GetWeight() was renamed to GetClampedWeight()") float GetWeight() const
Definition AnimationAsset.h:193
void AddWeight(float Weight)
Definition AnimationAsset.h:188
bool operator==(const FBlendSampleData &Other) const
Definition AnimationAsset.h:183
FBlendSampleData(int32 Index)
Definition AnimationAsset.h:171
Definition AnimationAsset.h:98
FDeltaTimeRecord(float InDeltaTime)
Definition AnimationAsset.h:113
float Delta
Definition AnimationAsset.h:110
bool IsPreviousValid() const
Definition AnimationAsset.h:108
void Set(float InPrevious, float InDelta)
Definition AnimationAsset.h:100
float GetPrevious() const
Definition AnimationAsset.h:107
FDeltaTimeRecord()=default
void SetPrevious(float InPrevious)
Definition AnimationAsset.h:106
Definition AnimInterpFilter.h:107
Definition Guid.h:109
Definition IoHash.h:33
static const FIoHash Zero
Definition IoHash.h:70
Definition AnimationAsset.h:56
FMarkerPair()
Definition AnimationAsset.h:60
FMarkerPair(int32 InMarkerIndex, float InTimeToMarker)
Definition AnimationAsset.h:61
void Reset()
Definition AnimationAsset.h:63
int32 MarkerIndex
Definition AnimationAsset.h:57
float TimeToMarker
Definition AnimationAsset.h:58
Definition AnimationAsset.h:361
FMarkerSyncAnimPosition(const FName &InPrevMarkerName, const FName &InNextMarkerName, const float &InAlpha)
Definition AnimationAsset.h:386
bool IsValid() const
Definition AnimationAsset.h:380
FString ToString() const
Definition AnimationAsset.h:393
FMarkerSyncAnimPosition()
Definition AnimationAsset.h:382
Definition AnimationAsset.h:67
bool IsValid(bool bLooping) const
Definition AnimationAsset.h:72
FMarkerPair PreviousMarker
Definition AnimationAsset.h:69
FString ToString() const
Definition AnimationAsset.h:81
FMarkerPair NextMarker
Definition AnimationAsset.h:70
void Reset()
Definition AnimationAsset.h:78
Definition AnimationAsset.h:400
float DeltaTimeWhenPassed
Definition AnimationAsset.h:403
FName PassedMarkerName
Definition AnimationAsset.h:401
Definition AnimationAsset.h:233
FPoseCurve(int32 InPoseIndex, FName InName, float InValue)
Definition AnimationAsset.h:251
FName Name
Definition AnimationAsset.h:238
int32 PoseIndex
Definition AnimationAsset.h:241
static SmartName::UID_Type UID
Definition AnimationAsset.h:235
float Value
Definition AnimationAsset.h:243
Definition UnrealType.h:6865
Definition AnimationAsset.h:711
const FTransform & GetRootMotionTransform() const
Definition AnimationAsset.h:844
FRootMotionMovementParams(const FRootMotionMovementParams &Other)
Definition AnimationAsset.h:738
void Set(const FTransform &InTransform)
Definition AnimationAsset.h:760
FRootMotionMovementParams ConsumeRootMotion(float Alpha)
Definition AnimationAsset.h:829
bool bHasRootMotion
Definition AnimationAsset.h:720
void AccumulateWithBlend(const FTransform &InTransform, float InBlendWeight)
Definition AnimationAsset.h:789
void AccumulateWithBlend(const FRootMotionMovementParams &MovementParams, float InBlendWeight)
Definition AnimationAsset.h:805
FRootMotionMovementParams(const FRootMotionMovementParams &&Other)
Definition AnimationAsset.h:745
FRootMotionMovementParams & operator=(const FRootMotionMovementParams &Other)
Definition AnimationAsset.h:752
void Accumulate(const FRootMotionMovementParams &MovementParams)
Definition AnimationAsset.h:781
void MakeUpToFullWeight()
Definition AnimationAsset.h:819
void ScaleRootMotionTranslation(float TranslationScale)
Definition AnimationAsset.h:845
void Accumulate(const FTransform &InTransform)
Definition AnimationAsset.h:768
void Clear()
Definition AnimationAsset.h:813
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition PointerIsConvertibleFromTo.h:60
Definition SoftObjectPtr.h:174
static UE_FORCEINLINE_HINT TQuat< double > Slerp(const TQuat< double > &Quat1, const TQuat< double > &Quat2, double Slerp)
Definition Quat.h:660
static CORE_API const TQuat< double > Identity
Definition Quat.h:63