SkeletonModifier3D
Inherits: Entity3D < Entity < Object
Inherited by: BoneConstraint3D, BoneSpaceAdjuster3D, BoneTwistDisperser3D, IKModifier3D, LimitAngularVelocityModifier3D, LookAtModifier3D, ModifierBoneTarget3D, PhysicalBoneSimulator3D, RetargetModifier3D, SpringBoneSimulator3D, XRBodyModifier3D, XRHandModifier3D
Description
Section titled “Description”A node that may modify a Skeleton3D’s bones.
SkeletonModifier3D retrieves a target Skeleton3D by having a Skeleton3D parent.
If there is an AnimationMixer, a modification always performs after playback process of the AnimationMixer.
This node should be used to implement custom IK solvers, constraints, or skeleton physics.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| bool | active |
true |
| float | influence |
1.0 |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | _process_modification_with_delta(delta: float) virtual |
| void | _skeleton_changed(old_skeleton: Skeleton3D, new_skeleton: Skeleton3D) virtual |
| void | _validate_bone_names() virtual |
| Skeleton3D | get_skeleton() const |
Signals
Section titled “Signals”modification_processed
modification_processed()
Notifies when the modification have been finished.
Note: If you want to get the modified bone pose by the modifier, you must use Skeleton3D.get_bone_pose() or Skeleton3D.get_bone_global_pose() at the moment this signal is fired.
Enumerations
Section titled “Enumerations”BoneAxis
enum BoneAxis
BONE_AXIS_PLUS_X = 0
Enumerated value for the +X axis.
BONE_AXIS_MINUS_X = 1
Enumerated value for the -X axis.
BONE_AXIS_PLUS_Y = 2
Enumerated value for the +Y axis.
BONE_AXIS_MINUS_Y = 3
Enumerated value for the -Y axis.
BONE_AXIS_PLUS_Z = 4
Enumerated value for the +Z axis.
BONE_AXIS_MINUS_Z = 5
Enumerated value for the -Z axis.
BoneDirection
enum BoneDirection
BONE_DIRECTION_PLUS_X = 0
Enumerated value for the +X axis.
BONE_DIRECTION_MINUS_X = 1
Enumerated value for the -X axis.
BONE_DIRECTION_PLUS_Y = 2
Enumerated value for the +Y axis.
BONE_DIRECTION_MINUS_Y = 3
Enumerated value for the -Y axis.
BONE_DIRECTION_PLUS_Z = 4
Enumerated value for the +Z axis.
BONE_DIRECTION_MINUS_Z = 5
Enumerated value for the -Z axis.
BONE_DIRECTION_FROM_PARENT = 6
Enumerated value for the axis from a parent bone to the child bone.
SecondaryDirection
enum SecondaryDirection
SECONDARY_DIRECTION_NONE = 0
Enumerated value for the case when the axis is undefined.
SECONDARY_DIRECTION_PLUS_X = 1
Enumerated value for the +X axis.
SECONDARY_DIRECTION_MINUS_X = 2
Enumerated value for the -X axis.
SECONDARY_DIRECTION_PLUS_Y = 3
Enumerated value for the +Y axis.
SECONDARY_DIRECTION_MINUS_Y = 4
Enumerated value for the -Y axis.
SECONDARY_DIRECTION_PLUS_Z = 5
Enumerated value for the +Z axis.
SECONDARY_DIRECTION_MINUS_Z = 6
Enumerated value for the -Z axis.
SECONDARY_DIRECTION_CUSTOM = 7
Enumerated value for an optional axis.
RotationAxis
enum RotationAxis
ROTATION_AXIS_X = 0
Enumerated value for the rotation of the X axis.
ROTATION_AXIS_Y = 1
Enumerated value for the rotation of the Y axis.
ROTATION_AXIS_Z = 2
Enumerated value for the rotation of the Z axis.
ROTATION_AXIS_ALL = 3
Enumerated value for the unconstrained rotation.
ROTATION_AXIS_CUSTOM = 4
Enumerated value for an optional rotation axis.
Property descriptions
Section titled “Property descriptions”active
bool active = true
If true, the SkeletonModifier3D will be processing.
influence
float influence = 1.0
Sets the influence of the modification.
Note: This value is used by Skeleton3D to blend, so the SkeletonModifier3D should always apply only 100% of the result without interpolation.
Method descriptions
Section titled “Method descriptions”_process_modification_with_delta
void _process_modification_with_delta(delta: float) virtual
Override this virtual method to implement a custom skeleton modifier. You should do things like get the Skeleton3D’s current pose and apply the pose here.
_process_modification_with_delta() must not apply influence to bone poses because the Skeleton3D automatically applies influence to all bone poses set by the modifier.
delta is passed from parent Skeleton3D. See also Skeleton3D.advance().
Note: This method may be called outside Entity._frame() and Entity._step() with delta is 0.0, since the modification should be processed immediately after initialization of the Skeleton3D.
_skeleton_changed
void _skeleton_changed(old_skeleton: Skeleton3D, new_skeleton: Skeleton3D) virtual
Called when the skeleton is changed.
_validate_bone_names
void _validate_bone_names() virtual
Called when bone names and indices need to be validated, such as when entering the scene tree or changing skeleton.
get_skeleton
Skeleton3D get_skeleton() const
Returns the parent Skeleton3D node if it exists. Otherwise, returns null.
