UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimNode_BoneDrivenController.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"
7#include "BoneContainer.h"
8#include "BonePose.h"
10#include "Animation/AnimTypes.h"
11#include "AnimNode_BoneDrivenController.generated.h"
12
13class UCurveFloat;
14class USkeletalMeshComponent;
15
16// Evaluation of the bone transforms relies on the size and ordering of this
17// enum, if this needs to change make sure EvaluateSkeletalControl_AnyThread is updated.
18
19// The type of modification to make to the destination component(s)
20UENUM()
22{
23 // Add the driven value to the input component value(s)
25
26 // Replace the input component value(s) with the driven value
28
29 // Add the driven value to the reference pose value
31};
32
33// Type of destination value to drive
34UENUM()
41
45USTRUCT()
47{
49
50 // Bone to use as controller input
51 UPROPERTY(EditAnywhere, Category="Source (driver)")
52 FBoneReference SourceBone;
53
55 UPROPERTY(EditAnywhere, Category=Mapping)
56 TObjectPtr<UCurveFloat> DrivingCurve;
57
58 // Multiplier to apply to the input value (Note: Ignored when a curve is used)
59 UPROPERTY(EditAnywhere, Category=Mapping)
61
62 // Minimum limit of the input value (mapped to RemappedMin, only used when limiting the source range)
63 // If this is rotation, the unit is radian
64 UPROPERTY(EditAnywhere, Category=Mapping, meta=(EditCondition=bUseRange, DisplayName="Source Range Min"))
65 double RangeMin;
66
67 // Maximum limit of the input value (mapped to RemappedMax, only used when limiting the source range)
68 // If this is rotation, the unit is radian
69 UPROPERTY(EditAnywhere, Category=Mapping, meta=(EditCondition=bUseRange, DisplayName="Source Range Max"))
70 double RangeMax;
71
72 // Minimum value to apply to the destination (remapped from the input range)
73 // If this is rotation, the unit is radian
74 UPROPERTY(EditAnywhere, Category=Mapping, meta=(EditCondition=bUseRange, DisplayName="Mapped Range Min"))
75 double RemappedMin;
76
77 // Maximum value to apply to the destination (remapped from the input range)
78 // If this is rotation, the unit is radian
79 UPROPERTY(EditAnywhere, Category = Mapping, meta = (EditCondition = bUseRange, DisplayName="Mapped Range Max"))
80 double RemappedMax;
81
83 UPROPERTY(EditAnywhere, Category = "Destination (driven)")
84 FName ParameterName;
85
86 // Bone to drive using controller input
87 UPROPERTY(EditAnywhere, Category="Destination (driven)")
88 FBoneReference TargetBone;
89
90#if WITH_EDITORONLY_DATA
91private:
92 UPROPERTY()
94#endif
95
96public:
97 // Type of destination to drive, currently either bone or morph target
98 UPROPERTY(EditAnywhere, Category = "Destination (driven)")
99 EDrivenDestinationMode DestinationMode;
100
101 // The type of modification to make to the destination component(s)
102 UPROPERTY(EditAnywhere, Category="Destination (driven)")
104
105 // Transform component to use as input
106 UPROPERTY(EditAnywhere, Category="Source (driver)")
107 TEnumAsByte<EComponentType::Type> SourceComponent;
108
109 // Whether or not to clamp the driver value and remap it before scaling it
110 UPROPERTY(EditAnywhere, Category=Mapping, meta=(DisplayName="Remap Source"))
111 uint8 bUseRange : 1;
112
113 // Affect the X component of translation on the target bone
114 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="X"))
116
117 // Affect the Y component of translation on the target bone
118 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="Y"))
120
121 // Affect the Z component of translation on the target bone
122 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="Z"))
124
125 // Affect the X component of rotation on the target bone
126 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="X"))
128
129 // Affect the Y component of rotation on the target bone
130 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="Y"))
132
133 // Affect the Z component of rotation on the target bone
134 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="Z"))
136
137 // Affect the X component of scale on the target bone
138 UPROPERTY(EditAnywhere, Category = "Destination (driven)", meta=(DisplayName="X"))
140
141 // Affect the Y component of scale on the target bone
142 UPROPERTY(EditAnywhere, Category = "Destination (driven)", meta=(DisplayName="Y"))
144
145 // Affect the Z component of scale on the target bone
146 UPROPERTY(EditAnywhere, Category="Destination (driven)", meta=(DisplayName="Z"))
148
149public:
151
152 // FAnimNode_Base interface
153 ANIMGRAPHRUNTIME_API virtual void GatherDebugData(FNodeDebugData& DebugData) override;
154 // End of FAnimNode_Base interface
155
156 // FAnimNode_SkeletalControlBase interface
158 ANIMGRAPHRUNTIME_API virtual void EvaluateComponentSpaceInternal(FComponentSpacePoseContext& Context);
159 ANIMGRAPHRUNTIME_API virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) override;
160 // End of FAnimNode_SkeletalControlBase interface
161
162#if WITH_EDITORONLY_DATA
163 // Upgrade a node from the output enum to the output bits (change made in FAnimationCustomVersion::BoneDrivenControllerMatchingMaya)
165#endif
166
167protected:
168
169 // FAnimNode_SkeletalControlBase protected interface
170 ANIMGRAPHRUNTIME_API virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones) override;
171
173 ANIMGRAPHRUNTIME_API const double ExtractSourceValue(const FTransform& InCurrentBoneTransform, const FTransform& InRefPoseBoneTransform);
174 // End of FAnimNode_SkeletalControlBase protected interface
175};
EDrivenBoneModificationMode
Definition AnimNode_BoneDrivenController.h:22
EDrivenDestinationMode
Definition AnimNode_BoneDrivenController.h:36
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
@ Multiplier
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition Array.h:670
Definition EnumAsByte.h:22
Definition CurveFloat.h:31
Definition Skeleton.h:295
Definition AnimTypes.h:802
Definition AnimNode_BoneDrivenController.h:47
Definition AnimNode_SkeletalControlBase.h:22
Definition BoneContainer.h:192
Definition BoneReference.h:14
Definition BonePose.h:16
Definition AnimNodeBase.h:600
Definition AnimNodeBase.h:642
Definition ObjectPtr.h:488