UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimCurveTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
9#include "Curves/RichCurve.h"
10#include "Misc/EnumRange.h"
13
14#include "AnimCurveTypes.generated.h"
15
17
18class USkeleton;
19struct FBoneContainer;
20
21namespace UE::Anim
22{
23struct FCurveUtils;
24struct FCurveFilter;
25}
26
27UENUM()
29{
33 // make sure to update MaxCurve
35};
36
37ENUM_RANGE_BY_COUNT(EAnimCurveType, EAnimCurveType::MaxAnimCurveType);
38
40UENUM(BlueprintType, meta=(Bitflags))
42{
44 // Used as morph target curve
45 AACF_DriveMorphTarget_DEPRECATED = 0x00000001 UMETA(Hidden), // This has moved to FAnimCurveType:bMorphTarget. Set per skeleton. DO NOT REMOVE UNTIL FrameworkObjectVersion.MoveCurveTypesToSkeleton expires.
46 // Used as triggering event
47 AACF_DriveAttribute_DEPRECATED = 0x00000002 UMETA(Hidden), // Set per skeleton. DO NOT REMOVE UNTIL FrameworkObjectVersion.MoveCurveTypesToSkeleton expires.
48 // Is editable in Sequence Editor
49 AACF_Editable = 0x00000004 UMETA(DisplayName = "Editable"), // per asset
50 // Used as a material curve
51 AACF_DriveMaterial_DEPRECATED = 0x00000008 UMETA(Hidden), // This has moved to FAnimCurveType:bMaterial. Set per skeleton. DO NOT REMOVE UNTIL FrameworkObjectVersion.MoveCurveTypesToSkeleton expires.
52 // Is a metadata 'curve'
53 AACF_Metadata = 0x00000010 UMETA(DisplayName = "Metadata"), // per asset
54 // motifies bone track
55 AACF_DriveTrack = 0x00000020 UMETA(Hidden), // @Todo: remove?
56 // disabled, right now it's used by track
57 AACF_Disabled = 0x00000040 UMETA(Hidden), // per asset
58};
60
62
64USTRUCT()
66{
68
69 UPROPERTY(EditAnywhere, Category = FAnimCurveParam)
71
72 // name UID for fast access
73 SmartName::UID_Type UID;
74
76 : UID(SmartName::MaxUID)
77 {}
78
79 UE_DEPRECATED(5.3, "FAnimCurveParam is no longer used.")
81
82 UE_DEPRECATED(5.3, "FAnimCurveParam is no longer used.")
83 bool IsValid() const { return false; }
84
85 UE_DEPRECATED(5.3, "FAnimCurveParam is no longer used.")
86 bool IsValidToEvaluate() const { return false; }
87};
91USTRUCT(BlueprintType)
93{
95
96#if WITH_EDITORONLY_DATA
97 UPROPERTY()
99
100 UPROPERTY()
101 FSmartName Name_DEPRECATED;
102
103 UPROPERTY()
105
106 UPROPERTY()
107 FString Comment;
108#endif
109
110private:
111 UPROPERTY()
112 FName CurveName;
113
114 // this flag is mostly used by editor only now
115 // however I can't remove this to editor only because
116 // we need DEPRECATED Flag to be loaded in game
117 // because those data are stored in asset, and skeleton might not be saved with it.
119 UPROPERTY()
120 int32 CurveTypeFlags;
121
122public:
124 : CurveTypeFlags(0)
125 {
126#if WITH_EDITORONLY_DATA
127 Color = MakeColor(CurveName);
128#endif
129 }
130
132 : CurveName(InName)
133 , CurveTypeFlags(InCurveTypeFlags)
134 {
135#if WITH_EDITORONLY_DATA
136 Color = MakeColor(CurveName);
137#endif
138 }
139
140 UE_DEPRECATED(5.3, "Please use the cosntructor that takes an FName.")
142 : CurveName(InName.DisplayName)
143 , CurveTypeFlags(InCurveTypeFlags)
144 {
145#if WITH_EDITORONLY_DATA
146 Color = MakeColor(CurveName);
147#endif
148 }
149
150 // This allows loading data that was saved between VER_UE4_SKELETON_ADD_SMARTNAMES and FFrameworkObjectVersion::SmartNameRefactor
151 ENGINE_API void PostSerializeFixup(FArchive& Ar);
152
153 ENGINE_API bool Serialize(FArchive& Ar);
154 ENGINE_API void PostSerialize(const FArchive& Ar);
155
159 ENGINE_API void SetCurveTypeFlag(EAnimAssetCurveFlags InFlag, bool bValue);
160
164 ENGINE_API void ToggleCurveTypeFlag(EAnimAssetCurveFlags InFlag);
165
169 ENGINE_API bool GetCurveTypeFlag(EAnimAssetCurveFlags InFlag) const;
170
175 ENGINE_API void SetCurveTypeFlags(int32 NewCurveTypeFlags);
179 ENGINE_API int32 GetCurveTypeFlags() const;
180
183 {
184 return CurveName;
185 }
186
188 void SetName(FName InName)
189 {
190 CurveName = InName;
191 }
192
193#if WITH_EDITORONLY_DATA
195 FLinearColor GetColor() const { return Color; }
196
198 static ENGINE_API FLinearColor MakeColor(const FName& CurveName);
199#endif
200};
201
202template<>
204{
205 enum
206 {
209 };
210};
211
212USTRUCT(BlueprintType)
214{
216
217
218 UPROPERTY()
219 FRichCurve FloatCurve;
220
222
223 UE_DEPRECATED(5.3, "Please use the constructor that takes an FName.")
235
236 // we don't want to have = operator. This only copies curves, but leaving naming and everything else intact.
237 ENGINE_API void CopyCurve(const FFloatCurve& SourceCurve);
238 ENGINE_API float Evaluate(float CurrentTime) const;
239 ENGINE_API void UpdateOrAddKey(float NewKey, float CurrentTime);
241 ENGINE_API void Resize(float NewLength, bool bInsert/* whether insert or remove*/, float OldStartTime, float OldEndTime);
242};
243
244template<>
246{
247 enum
248 {
251 };
252};
253
254USTRUCT()
256{
258
260 {
261 X = 0,
262 Y,
263 Z,
264 Max
265 };
266
268 UPROPERTY()
269 FRichCurve FloatCurves[3];
270
272
273 UE_DEPRECATED(5.3, "Please use the constructor that takes an FName.")
285
286 // we don't want to have = operator. This only copies curves, but leaving naming and everything else intact.
287 void CopyCurve(const FVectorCurve& SourceCurve);
288 ENGINE_API FVector Evaluate(float CurrentTime, float BlendWeight) const;
289 ENGINE_API void UpdateOrAddKey(const FVector& NewKey, float CurrentTime);
291 bool DoesContainKey() const { return (FloatCurves[0].GetNumKeys() > 0 || FloatCurves[1].GetNumKeys() > 0 || FloatCurves[2].GetNumKeys() > 0);}
292 ENGINE_API void Resize(float NewLength, bool bInsert/* whether insert or remove*/, float OldStartTime, float OldEndTime);
293 ENGINE_API int32 GetNumKeys() const;
294};
295
296template<>
298{
299 enum
300 {
303 };
304};
305
306USTRUCT(BlueprintType)
308{
310
311
312 UPROPERTY()
313 FVectorCurve TranslationCurve;
314
319 UPROPERTY()
320 FVectorCurve RotationCurve;
321
322 UPROPERTY()
323 FVectorCurve ScaleCurve;
324
326
327 UE_DEPRECATED(5.3, "Please use the constructor that takes an FName.")
339
340 // we don't want to have = operator. This only copies curves, but leaving naming and everything else intact.
341 ENGINE_API void CopyCurve(const FTransformCurve& SourceCurve);
342 ENGINE_API FTransform Evaluate(float CurrentTime, float BlendWeight) const;
343 ENGINE_API void UpdateOrAddKey(const FTransform& NewKey, float CurrentTime);
345 ENGINE_API void Resize(float NewLength, bool bInsert/* whether insert or remove*/, float OldStartTime, float OldEndTime);
346
347 ENGINE_API const FVectorCurve* GetVectorCurveByIndex(int32 Index) const;
348 ENGINE_API FVectorCurve* GetVectorCurveByIndex(int32 Index);
349};
350
351template<>
353{
354 enum
355 {
358 };
359};
360
361USTRUCT(BlueprintType)
363{
365
366public:
367 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Curve Settings")
368 FName CurveName;
369
370public:
371
373 ENGINE_API float GetValueAtPosition(const UAnimSequenceBase* InAnimSequence, const float& InPosition) const;
374 ENGINE_API const FFloatCurve* GetFloatCurve(const UAnimSequenceBase* InAnimSequence) const;
375
377 UE_DEPRECATED(5.3, "Please just use CurveName.")
378 SmartName::UID_Type GetAnimCurveUID(const UAnimSequenceBase* InAnimSequence) const { return 0; }
379};
380
384struct UE_DEPRECATED(5.3, "FCurveElement in the global namespace is no longer used.") FCurveElement
385{
387 float Value;
389 bool bValid;
390
391 FCurveElement(float InValue)
392 : Value(InValue)
393 , bValid (true)
394 {}
395
396 FCurveElement()
397 : Value(0.f)
398 , bValid(false)
399 {}
400
401 bool IsValid() const
402 {
403 return bValid;
404 }
405
406 void SetValue(float InValue)
407 {
408 Value = InValue;
409 bValid = true;
410 }
411};
412
413namespace UE::Anim
414{
415
416// An element for a named curve value
418{
419 FCurveElement() = default;
420
422 : Name(InName)
423 {}
424
426 : Name(InName)
427 , Value(InValue)
428 {}
429
431 : Name(InName)
432 , Flags(InFlags)
433 {}
434
436 : Name(InName)
437 , Value(InValue)
438 , Flags(InFlags)
439 {}
440
442 float Value = 0.0f;
444};
445
446// An element for a named curve value that is also indexed.
447// Useful in bulk curve operations that need to pay heed to disabled curves
449{
451
453 : UE::Anim::FCurveElement(InName)
454 , Index(InIndex)
455 {}
456
458};
459
460// Deprecated base for TBaseBlendedCurve for legacy support
461// We need to use this non-templated base to avoid the deprecated (and now static) members taking up per-instance memory
463{
464 UE_DEPRECATED(5.3, "Direct access to CurveWeights is no longer allowed as it is no longer used.")
466
467 UE_DEPRECATED(5.3, "Direct access to ValidCurveWeights is no longer allowed as it is no longer used.")
469
470 UE_DEPRECATED(5.3, "Direct access to UIDToArrayIndexLUT is no longer allowed as it is no longer used.")
472
473 UE_DEPRECATED(5.3, "Direct access to NumValidCurveCount is no longer allowed as it is no longer used.")
475
476 UE_DEPRECATED(5.3, "Direct access to bInitialized is no longer allowed.")
478};
479
480}
481
486struct TBaseBlendedCurve : public UE::Anim::TNamedValueArray<InAllocatorType, InElementType>, public UE::Anim::FBaseBlendedCurve_DEPRECATED
487{
488public:
491
492 template<typename OtherAllocator, typename OtherElementType>
493 friend struct TBaseBlendedCurve;
494
496
498
499private:
500 // Filter to use when building curves
501 const UE::Anim::FCurveFilter* Filter = nullptr;
502
503public:
504 UE_DEPRECATED(5.3, "InitFrom can no longer be called with a LUT, please use another initialization method or just dont initialize the curve.")
506 {
507 Super::Elements.Reset();
508 Filter = nullptr;
509 Super::bSorted = false;
510 }
511
513 template <typename OtherAllocator, typename OtherElementType>
515 {
517
518 if (ensure(&InCurveToInitFrom != this))
519 {
520 Super::Elements.Reset();
521 Super::bSorted = false;
522 Filter = InCurveToInitFrom.Filter;
523 }
524 }
525
526 UE_DEPRECATED(5.3, "Please use InvalidateCurveWeight with a curve name")
527 void InvalidateCurveWeight(SmartName::UID_Type InUid)
528 {
529 }
530
533 {
534 const int32 ElementIndex = Super::IndexOf(InName);
535 if(ElementIndex != INDEX_NONE)
536 {
537 Super::Elements.RemoveAt(ElementIndex);
538 }
539 }
540
541 UE_DEPRECATED(5.3, "Please use Set with a curve name or consider using one of the bulk APIs (e.g. UE::Anim::FCurveUtils::BulkSet).")
542 void Set(SmartName::UID_Type InUid, float InValue)
543 {
544 }
545
553 void Set(FName InName, float InValue)
554 {
555 if(ElementType* CurveElement = Super::Find(InName))
556 {
557 CurveElement->Value = InValue;
558 }
559 else
560 {
561 Super::Add(InName, InValue);
562 }
563 }
564
574 {
575 if(ElementType* CurveElement = Super::Find(InName))
576 {
577 CurveElement->Flags = InFlags;
578 }
579 else
580 {
581 Super::Add(InName, InFlags);
582 }
583 }
584
585 UE_DEPRECATED(5.3, "Please use Get with a curve name or consider using one of the bulk APIs (e.g. UE::Anim::FCurveUtils::BulkGet)")
586 float Get(SmartName::UID_Type InUid) const
587 {
588 return 0.f;
589 }
590
598 float Get(FName InName) const
599 {
600 if(const ElementType* CurveElement = Super::Find(InName))
601 {
602 return CurveElement->Value;
603 }
604 return 0.0f;
605 }
606
614 {
615 if(const ElementType* CurveElement = Super::Find(InName))
616 {
617 return CurveElement->Flags;
618 }
620 }
621
622 UE_DEPRECATED(5.3, "Please use Get with a curve name or consider using one of the bulk APIs (e.g. UE::Anim::FCurveUtils::BulkGet).")
623 float Get(SmartName::UID_Type InUid, bool& OutIsValid, float InDefaultValue=0.f) const
624 {
625 return 0.0f;
626 }
627
637 float Get(FName InName, bool& OutHasElement, float InDefaultValue = 0.0f) const
638 {
639 if(const ElementType* CurveElement = Super::Find(InName))
640 {
641 OutHasElement = true;
642 return CurveElement->Value;
643 }
644
645 OutHasElement = false;
646 return InDefaultValue;
647 }
648
657 {
658 ElementType* CurveElement0 = Super::Find(InName0);
659 ElementType* CurveElement1 = Super::Find(InName1);
660
661 // Both exist, so swap values & flags
663 {
664 Swap(CurveElement0->Value, CurveElement1->Value);
665 Swap(CurveElement0->Flags, CurveElement1->Flags);
666 }
667 // First exists, but not second. Rename to second
668 else if(CurveElement0)
669 {
670 CurveElement0->Name = InName1;
671 Super::bSorted = false;
672 }
673 // Second exists, but not first. Rename to first
674 else if(CurveElement1)
675 {
676 CurveElement1->Name = InName0;
677 Super::bSorted = false;
678 }
679 }
680
681 UE_DEPRECATED(5.3, "This function has been removed.")
682 int32 GetArrayIndexByUID(SmartName::UID_Type InUid) const
683 {
684 return INDEX_NONE;
685 }
686
687 UE_DEPRECATED(5.3, "Element validity/enabled state is now handled via UE::Anim::FCurveFilter.")
688 bool IsEnabled(SmartName::UID_Type InUid) const
689 {
690 return false;
691 }
692
693 UE_DEPRECATED(5.3, "Element validity/enabled state is now handled via UE::Anim::FCurveFilter.")
694 static int32 GetValidElementCount(TArray<uint16> const* InUIDToArrayIndexLUT)
695 {
696 return 0;
697 }
698
699public:
703 template<typename AllocatorA, typename ElementTypeA, typename AllocatorB, typename ElementTypeB>
705 {
707
708 if (!FAnimWeight::IsRelevant(FMath::Abs(Alpha)))
709 {
710 // if blend is all the way for child1, then just copy its bone atoms
711 Override(A);
712 }
713 else if (!FAnimWeight::IsRelevant(FMath::Abs(Alpha - 1.0f)))
714 {
715 // if blend is all the way for child2, then just copy its bone atoms
716 Override(B);
717 }
718 else
719 {
720 // Combine using Lerp. Result is a merged set of curves in 'this'.
722 {
723 OutResult.Value = FMath::Lerp(InElement0.Value, InElement1.Value, Alpha);
724 OutResult.Flags = InElement0.Flags | InElement1.Flags;
725 });
726 }
727 }
728
732 template<typename OtherAllocator, typename OtherElementType>
734 {
736
737 if (!FAnimWeight::IsRelevant(FMath::Abs(Alpha)))
738 {
739 return;
740 }
741 else if (!FAnimWeight::IsRelevant(FMath::Abs(Alpha - 1.0f)))
742 {
743 // if blend is all the way for child2, then just copy its bone atoms
745 }
746 else
747 {
748 // Combine using Lerp. Result is a merged set of curves in 'this'.
750 {
752 InOutThisElement.Flags |= InOtherElement.Flags;
753 });
754 }
755 }
756
760 template<typename AllocatorA, typename ElementTypeA, typename AllocatorB, typename ElementTypeB>
762 {
764
765 // Combine using Lerp. Result is a merged set of curves in 'this'. Elements where only one input is valid will be preserved.
767 {
769 {
770 OutResult.Value = FMath::Lerp(InElement0.Value, InElement1.Value, Alpha);
771 OutResult.Flags = InElement0.Flags | InElement1.Flags;
772 }
774 {
775 OutResult.Value = InElement0.Value;
776 OutResult.Flags = InElement0.Flags;
777 }
779 {
780 OutResult.Value = InElement1.Value;
781 OutResult.Flags = InElement1.Flags;
782 }
783 });
784 }
785
789 template<typename OtherAllocator, typename OtherElementType>
791 {
793
794 // Combine using Lerp. Result is a merged set of curves in 'this'. Elements where only one input is valid will be preserved.
796 {
798 {
800 InOutThisElement.Flags |= InOtherElement.Flags;
801 }
803 {
804 InOutThisElement.Value = InOtherElement.Value;
805 InOutThisElement.Flags = InOtherElement.Flags;
806 }
807 });
808 }
809
813 template<typename OtherAllocator, typename OtherElementType>
824
828 template<typename OtherAllocator, typename OtherElementType>
842
846 template<typename OtherAllocator, typename OtherElementType>
865
869 template<typename OtherAllocator, typename OtherElementType>
888
893 template<typename OtherAllocator, typename OtherElementType>
907
912 template<typename OtherAllocator, typename OtherElementType>
926
930 template<typename OtherAllocator, typename OtherElementType>
932 {
934
935 CopyFrom(CurveToOverrideFrom);
936
937 if (!FMath::IsNearlyEqual(Weight, 1.0f))
938 {
939 for (ElementType& Element : Super::Elements)
940 {
941 Element.Value *= Weight;
942 }
943 }
944 }
945
946public:
950 template<typename OtherAllocator, typename OtherElementType>
957
962 {
963 // make sure this doesn't happen
964 if (ensure(&CurveToOverrideFrom != this))
965 {
966 Super::Elements = MoveTemp(CurveToOverrideFrom.Elements);
967 Super::bSorted = CurveToOverrideFrom.bSorted;
968 CurveToOverrideFrom.bSorted = false;
969 }
970 }
971
972 UE_DEPRECATED(5.3, "Please use Num(). Element validity/enabled state is now handled via UE::Anim::FCurveFilter.")
973 int32 NumValid() const { return Super::Elements.Num(); }
974
976 template <typename OtherAllocator, typename OtherElementType>
978 {
980
981 if constexpr(std::is_same<ElementType, OtherElementType>::value)
982 {
983 Super::Elements = InCurveToCopyFrom.Elements;
984 Super::bSorted = InCurveToCopyFrom.bSorted;
985 }
986 else
987 {
988 Super::Elements.Reset();
989
992 {
995 });
996
997 Super::bSorted = InCurveToCopyFrom.bSorted;
998 }
999 }
1000
1003 {
1004 Super::Elements = MoveTemp(CurveToMoveFrom.Elements);
1005 Super::bSorted = CurveToMoveFrom.bSorted;
1006 CurveToMoveFrom.bSorted = false;
1007 }
1008
1011 {
1013 Super::Elements.Reserve(InNumElements);
1014 }
1015
1016 UE_DEPRECATED(5.3, "Curves are now always valid.")
1018 {
1019 return true;
1020 }
1021
1023 void SetFilter(const UE::Anim::FCurveFilter* InFilter)
1024 {
1025 Filter = InFilter;
1026 }
1027
1030 {
1031 return Filter;
1032 }
1033};
1034
1035template<typename AllocatorType>
1036struct UE_DEPRECATED(5.3, "FBaseBlendedCurve was renamed to TBaseBlendedCurve.") FBaseBlendedCurve : public TBaseBlendedCurve<AllocatorType>
1037{
1038};
1039
1040struct FBlendedCurve : public TBaseBlendedCurve<FAnimStackAllocator>
1041{
1042 using TBaseBlendedCurve<FAnimStackAllocator>::InitFrom;
1043
1045 ENGINE_API void InitFrom(const FBoneContainer& InBoneContainer);
1046};
1047
1048struct FBlendedHeapCurve : public TBaseBlendedCurve<FDefaultAllocator>
1049{
1050 using TBaseBlendedCurve<FDefaultAllocator>::InitFrom;
1051
1053 ENGINE_API void InitFrom(const FBoneContainer& InBoneContainer);
1054};
1055
1056UENUM(BlueprintType)
1058{
1059 RCT_Float UMETA(DisplayName = "Float Curve"),
1060 RCT_Vector UMETA(DisplayName = "Vector Curve", Hidden),
1061 RCT_Transform UMETA(DisplayName = "Transformation Curve"),
1062 RCT_MAX
1063};
1064
1068USTRUCT()
1070{
1072
1073 UPROPERTY()
1074 TArray<FFloatCurve> FloatCurves;
1075
1076#if WITH_EDITORONLY_DATA
1082 TArray<FVectorCurve> VectorCurves;
1083
1087 UPROPERTY()
1088 TArray<FTransformCurve> TransformCurves;
1089#endif // #if WITH_EDITORONLY_DATA
1090
1096 ENGINE_API void EvaluateCurveData( FBlendedCurve& Curves, float CurrentTime ) const;
1097
1098#if WITH_EDITOR
1102 ENGINE_API void EvaluateTransformCurveData(USkeleton * Skeleton, TMap<FName, FTransform>&OutCurves, float CurrentTime, float BlendWeight) const;
1103
1107 ENGINE_API void AddFloatCurveKey(const FName& NewCurve, int32 CurveFlags, float Time, float Value);
1108
1109 UE_DEPRECATED(5.3, "Please use AddFloatCurveKey that takes a FName.")
1110 void AddFloatCurveKey(const FSmartName& NewCurve, int32 CurveFlags, float Time, float Value) { AddFloatCurveKey(NewCurve.DisplayName, CurveFlags, Time, Value); }
1111
1112
1113 ENGINE_API void RemoveRedundantKeys(float Tolerance = UE_SMALL_NUMBER, FFrameRate SampleRate = FFrameRate(0,0));
1114
1115#endif // WITH_EDITOR
1119 UE_DEPRECATED(5.3, "Please use GetCurveData that takes an FName.")
1120 FAnimCurveBase * GetCurveData(SmartName::UID_Type Uid, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float) { return nullptr; }
1121
1122 UE_DEPRECATED(5.3, "Please use GetCurveData that takes an FName.")
1123 const FAnimCurveBase * GetCurveData(SmartName::UID_Type Uid, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float) const { return nullptr; }
1124
1128 ENGINE_API FAnimCurveBase * GetCurveData(FName Name, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float);
1129 ENGINE_API const FAnimCurveBase * GetCurveData(FName Name, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float) const;
1130
1135 ENGINE_API bool AddCurveData(const FName& NewCurve, int32 CurveFlags = AACF_DefaultCurve, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float);
1136
1137 UE_DEPRECATED(5.3, "Please use AddCurveData that takes a FName.")
1139
1143 ENGINE_API bool DeleteCurveData(const FName& CurveToDelete, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float);
1144
1145 UE_DEPRECATED(5.3, "Please use DeleteCurveData that takes a FName.")
1147
1151 ENGINE_API void DeleteAllCurveData(ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float);
1152
1156 ENGINE_API bool DuplicateCurveData(const FName& CurveToCopy, const FName& NewCurve, ERawCurveTrackTypes SupportedCurveType = ERawCurveTrackTypes::RCT_Float);
1157
1158 UE_DEPRECATED(5.3, "Please use DuplicateCurveData that takes FNames as curve parameters.")
1160
1161 UE_DEPRECATED(5.3, "This function is no longer used")
1163
1164 // This allows loading data that was saved between VER_UE4_SKELETON_ADD_SMARTNAMES and FFrameworkObjectVersion::SmartNameRefactor
1165 void PostSerializeFixup(FArchive& Ar);
1166
1167 /*
1168 * resize curve length. If longer, it doesn't do any. If shorter, remove previous keys and add new key to the end of the frame.
1169 */
1170 void Resize(float TotalLength, bool bInsert/* whether insert or remove*/, float OldStartTime, float OldEndTime);
1174 void Empty()
1175 {
1176 FloatCurves.Empty();
1177#if WITH_EDITORONLY_DATA
1178 VectorCurves.Empty();
1179 TransformCurves.Empty();
1180#endif
1181 }
1185 void Reset()
1186 {
1187 FloatCurves.Reset();
1188#if WITH_EDITORONLY_DATA
1189 VectorCurves.Reset();
1190 TransformCurves.Reset();
1191#endif
1192 }
1193
1194private:
1202 template <typename DataType>
1203 DataType * GetCurveDataImpl(TArray<DataType>& Curves, FName Name);
1204
1208 template <typename DataType>
1209 const DataType * GetCurveDataImpl(const TArray<DataType>& Curves, FName Name) const;
1210
1215 template <typename DataType>
1216 bool AddCurveDataImpl(TArray<DataType>& Curves, const FName& NewCurve, int32 CurveFlags);
1220 template <typename DataType>
1221 bool DeleteCurveDataImpl(TArray<DataType>& Curves, const FName& CurveToDelete);
1226 template <typename DataType>
1227 bool DuplicateCurveDataImpl(TArray<DataType>& Curves, const FName& CurveToCopy, const FName& NewCurve);
1228};
1229
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
ERawCurveTrackTypes
Definition AnimCurveTypes.h:1058
constexpr EAnimAssetCurveFlags AACF_DefaultCurve
Definition AnimCurveTypes.h:59
SmartName::UID_Type SkeletonAnimCurveUID
Definition AnimCurveTypes.h:16
EAnimCurveType
Definition AnimCurveTypes.h:29
EAnimAssetCurveFlags
Definition AnimCurveTypes.h:42
@ AACF_DriveAttribute_DEPRECATED
Definition AnimCurveTypes.h:47
@ AACF_NONE
Definition AnimCurveTypes.h:43
@ AACF_Editable
Definition AnimCurveTypes.h:49
@ AACF_DriveTrack
Definition AnimCurveTypes.h:55
@ AACF_Disabled
Definition AnimCurveTypes.h:57
@ AACF_Metadata
Definition AnimCurveTypes.h:53
@ AACF_DriveMorphTarget_DEPRECATED
Definition AnimCurveTypes.h:45
@ AACF_DriveMaterial_DEPRECATED
Definition AnimCurveTypes.h:51
#define ensure( InExpression)
Definition AssertionMacros.h:464
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
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
constexpr bool EnumHasAnyFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:35
constexpr bool EnumHasAllFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:28
#define ENUM_RANGE_BY_FIRST_AND_LAST(EnumType, First, Last)
Definition EnumRange.h:47
#define ENUM_RANGE_BY_COUNT(EnumType, Count)
Definition EnumRange.h:25
return true
Definition ExternalRpcRegistry.cpp:601
#define X(Name, Desc)
Definition FormatStringSan.h:47
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define CURVE_PROFILE_CYCLE_COUNTER(Stat)
Definition NamedValueArray.h:17
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UMETA(...)
Definition ObjectMacros.h:747
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
#define UE_SMALL_NUMBER
Definition UnrealMathUtility.h:130
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
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 NameTypes.h:617
Definition Array.h:670
void Reset(SizeType NewSize=0)
Definition Array.h:2246
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition BitArray.h:350
Definition UnrealString.h.inl:34
Definition MemStack.h:391
Definition ContainerAllocationPolicies.h:830
Definition AnimSequenceBase.h:37
Definition Skeleton.h:295
IAnalyticsPropertyStore::EStatusCode SetValue(TGetter &&GetterFn, TSetter &&SetterFn, const T &ProposedValue, TCompare &&ConditionFn)
Definition AnalyticsPropertyStore.cpp:34
FExpressionResult Evaluate(const CharType *InExpression, const TTokenDefinitions< CharType > &InTokenDefinitions, const FExpressionGrammar &InGrammar, const TIOperatorEvaluationEnvironment< CharType > &InEnvironment)
Definition ExpressionParser.cpp:728
Definition AnimationAsset.h:38
uint16 UID_Type
Definition AnimationAsset.h:39
Definition AnimationAsset.h:42
ENamedValueUnionFlags
Definition NamedValueArray.h:237
ECurveElementFlags
Definition AnimCurveElementFlags.h:13
Definition AdvancedWidgetsModule.cpp:13
FStringBuilderBase & operator<<(FStringBuilderBase &Builder, const FDerivedData &Data)
Definition DerivedData.cpp:255
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition AnimCurveTypes.h:93
FAnimCurveBase(FName InName, int32 InCurveTypeFlags)
Definition AnimCurveTypes.h:131
void SetName(FName InName)
Definition AnimCurveTypes.h:188
FName GetName() const
Definition AnimCurveTypes.h:182
FAnimCurveBase()
Definition AnimCurveTypes.h:123
Definition AnimCurveTypes.h:66
static bool IsRelevant(float InWeight)
Definition AnimTypes.h:666
Definition AnimCurveTypes.h:1041
Definition AnimCurveTypes.h:1049
Definition BoneContainer.h:192
Definition AnimCurveTypes.h:363
Definition AnimCurveTypes.h:214
Definition FrameRate.h:21
Definition Color.h:48
static UE_FORCEINLINE_HINT bool IsNearlyEqual(float A, float B, float ErrorTolerance=UE_SMALL_NUMBER)
Definition UnrealMathUtility.h:388
static constexpr UE_FORCEINLINE_HINT T Lerp(const T &A, const T &B, const U &Alpha)
Definition UnrealMathUtility.h:1116
Definition AnimCurveTypes.h:1070
FAnimCurveBase * GetCurveData(SmartName::UID_Type Uid, ERawCurveTrackTypes SupportedCurveType=ERawCurveTrackTypes::RCT_Float)
Definition AnimCurveTypes.h:1120
bool DeleteCurveData(const FSmartName &CurveToDelete, ERawCurveTrackTypes SupportedCurveType=ERawCurveTrackTypes::RCT_Float)
Definition AnimCurveTypes.h:1146
void Empty()
Definition AnimCurveTypes.h:1174
void Reset()
Definition AnimCurveTypes.h:1185
bool DuplicateCurveData(const FSmartName &CurveToCopy, const FSmartName &NewCurve, ERawCurveTrackTypes SupportedCurveType=ERawCurveTrackTypes::RCT_Float)
Definition AnimCurveTypes.h:1159
bool AddCurveData(const FSmartName &NewCurve, int32 CurveFlags=AACF_DefaultCurve, ERawCurveTrackTypes SupportedCurveType=ERawCurveTrackTypes::RCT_Float)
Definition AnimCurveTypes.h:1138
Definition RichCurve.h:200
Definition SmartName.h:20
Definition SmartName.h:211
Definition AnimCurveTypes.h:308
Definition AnimCurveTypes.h:256
bool DoesContainKey() const
Definition AnimCurveTypes.h:291
EIndex
Definition AnimCurveTypes.h:260
Definition AnimCurveTypes.h:487
void OverrideMove(TBaseBlendedCurve &CurveToOverrideFrom)
Definition AnimCurveTypes.h:961
void UseMaxValue(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &CurveToCombine)
Definition AnimCurveTypes.h:847
float Get(FName InName, bool &OutHasElement, float InDefaultValue=0.0f) const
Definition AnimCurveTypes.h:637
void Reserve(int32 InNumElements)
Definition AnimCurveTypes.h:1010
void MoveFrom(TBaseBlendedCurve &CurveToMoveFrom)
Definition AnimCurveTypes.h:1002
void SetFilter(const UE::Anim::FCurveFilter *InFilter)
Definition AnimCurveTypes.h:1023
void SetFlags(FName InName, UE::Anim::ECurveElementFlags InFlags)
Definition AnimCurveTypes.h:573
void Accumulate(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &AdditiveCurve, float Weight)
Definition AnimCurveTypes.h:829
void Combine(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &CurveToCombine)
Definition AnimCurveTypes.h:913
void LerpToValid(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &Other, float Alpha)
Definition AnimCurveTypes.h:790
void Override(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &CurveToOverrideFrom, float Weight)
Definition AnimCurveTypes.h:931
void LerpTo(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &Other, float Alpha)
Definition AnimCurveTypes.h:733
void ConvertToAdditive(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &BaseCurve)
Definition AnimCurveTypes.h:814
UE::Anim::ECurveElementFlags GetFlags(FName InName) const
Definition AnimCurveTypes.h:613
void InvalidateCurveWeight(FName InName)
Definition AnimCurveTypes.h:532
void CombinePreserved(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &CurveToCombine)
Definition AnimCurveTypes.h:894
InElementType ElementType
Definition AnimCurveTypes.h:490
const UE::Anim::FCurveFilter * GetFilter() const
Definition AnimCurveTypes.h:1029
void CopyFrom(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &InCurveToCopyFrom)
Definition AnimCurveTypes.h:977
void Override(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &CurveToOverrideFrom)
Definition AnimCurveTypes.h:951
void InitFrom(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &InCurveToInitFrom)
Definition AnimCurveTypes.h:514
void LerpValid(const TBaseBlendedCurve< AllocatorA, ElementTypeA > &A, const TBaseBlendedCurve< AllocatorB, ElementTypeB > &B, float Alpha)
Definition AnimCurveTypes.h:761
UE::Anim::TNamedValueArray< AllocatorType, ElementType > Super
Definition AnimCurveTypes.h:497
void Set(FName InName, float InValue)
Definition AnimCurveTypes.h:553
float Get(FName InName) const
Definition AnimCurveTypes.h:598
void UseMinValue(const TBaseBlendedCurve< OtherAllocator, OtherElementType > &CurveToCombine)
Definition AnimCurveTypes.h:870
InAllocatorType AllocatorType
Definition AnimCurveTypes.h:489
void Mirror(FName InName0, FName InName1)
Definition AnimCurveTypes.h:656
void Lerp(const TBaseBlendedCurve< AllocatorA, ElementTypeA > &A, const TBaseBlendedCurve< AllocatorB, ElementTypeB > &B, float Alpha)
Definition AnimCurveTypes.h:704
Definition StructOpsTypeTraits.h:11
@ WithSerializer
Definition StructOpsTypeTraits.h:23
@ WithPostSerialize
Definition StructOpsTypeTraits.h:25
Definition StructOpsTypeTraits.h:46
Definition AnimCurveTypes.h:463
static ENGINE_API TBitArray ValidCurveWeights
Definition AnimCurveTypes.h:468
static ENGINE_API bool bInitialized
Definition AnimCurveTypes.h:477
static ENGINE_API TArray< float > CurveWeights
Definition AnimCurveTypes.h:465
static ENGINE_API TArray< uint16 > const * UIDToArrayIndexLUT
Definition AnimCurveTypes.h:471
static ENGINE_API uint16 NumValidCurveCount
Definition AnimCurveTypes.h:474
Definition AnimCurveTypes.h:449
FCurveElementIndexed(FName InName, int32 InIndex)
Definition AnimCurveTypes.h:452
Definition AnimCurveTypes.h:418
FCurveElement(FName InName, ECurveElementFlags InFlags)
Definition AnimCurveTypes.h:430
FName Name
Definition AnimCurveTypes.h:441
FCurveElement(FName InName, float InValue, ECurveElementFlags InFlags)
Definition AnimCurveTypes.h:435
FCurveElement(FName InName)
Definition AnimCurveTypes.h:421
FCurveElement(FName InName, float InValue)
Definition AnimCurveTypes.h:425
float Value
Definition AnimCurveTypes.h:442
ECurveElementFlags Flags
Definition AnimCurveTypes.h:443
Definition AnimCurveFilter.h:68
Definition AnimCurveUtils.h:14
static void Union(TNamedValueArray< AllocatorTypeResult, ElementTypeResult > &InOutValueArray0, const TNamedValueArray< AllocatorTypeParam, ElementTypeParam > &InValueArray1, PredicateType InPredicate)
Definition NamedValueArray.h:261
Definition NamedValueArray.h:35