Skip to content

RetargetModifier3D

Inherits: SkeletonModifier3D < Entity3D < Entity < Object

A modifier to transfer parent skeleton poses (or global poses) to child skeletons in model space with different rests.

Retrieves the pose (or global pose) relative to the parent Skeleton’s rest in model space and transfers it to the child Skeleton.

This modifier rewrites the pose of the child skeleton directly in the parent skeleton’s update process. This means that it overwrites the mapped bone pose set in the normal process on the target skeleton. If you want to set the target skeleton bone pose after retargeting, you will need to add a SkeletonModifier3D child to the target skeleton and thereby modify the pose.

Note: When the use_global_pose is enabled, even if it is an unmapped bone, it can cause visual problems because the global pose is applied ignoring the parent bone’s pose if it has mapped bone children. See also use_global_pose.

Type Name Default
bool copy_bone_skin_scale true
BitField[TransformFlag] enable 7
SkeletonProfile profile
bool use_global_pose false
Returns Method
bool is_position_enabled() const
bool is_rotation_enabled() const
bool is_scale_enabled() const
void set_position_enabled(enabled: bool)
void set_rotation_enabled(enabled: bool)
void set_scale_enabled(enabled: bool)

TransformFlag

enum TransformFlag (flags)

TRANSFORM_FLAG_POSITION = 1

If set, allows to retarget the position.

TRANSFORM_FLAG_ROTATION = 2

If set, allows to retarget the rotation.

TRANSFORM_FLAG_SCALE = 4

If set, allows to retarget the scale.

TRANSFORM_FLAG_ALL = 7

If set, allows to retarget the position/rotation/scale.

copy_bone_skin_scale

bool copy_bone_skin_scale = true

If true, copies Skeleton3D.get_bone_skin_scale() of the source skeleton’s bones to the child skeletons’ mapped bones.

If false, the skin scale of the child skeletons’ mapped bones are reset to Vector3(1, 1, 1) once and will not be overwritten after that.

Note: If you want to use Skeleton3D.set_bone_skin_scale() on a child skeleton’s mapped bone, set this to false. Even if you are not using Skeleton3D.set_bone_skin_scale() with parent skeleton, Vector3(1, 1, 1) will always be set for the child skeletons’ mapped bones.

enable

BitField[TransformFlag] enable = 7

Flags to control the process of the transform elements individually when use_global_pose is disabled.

profile

SkeletonProfile profile

SkeletonProfile for retargeting bones with names matching the bone list.

use_global_pose

bool use_global_pose = false

If false, in case the target skeleton has fewer bones than the source skeleton, the source bone parent’s transform will be ignored.

Instead, it is possible to retarget between models with different body shapes, and position, rotation, and scale can be retargeted separately.

If true, retargeting is performed taking into account global pose.

In case the target skeleton has fewer bones than the source skeleton, the source bone parent’s transform is taken into account. However, bone length between skeletons must match exactly, if not, the bones will be forced to expand or shrink.

This is useful for using dummy bone with length 0 to match postures when retargeting between models with different number of bones.

is_position_enabled

bool is_position_enabled() const

Returns true if enable has TRANSFORM_FLAG_POSITION.

is_rotation_enabled

bool is_rotation_enabled() const

Returns true if enable has TRANSFORM_FLAG_ROTATION.

is_scale_enabled

bool is_scale_enabled() const

Returns true if enable has TRANSFORM_FLAG_SCALE.

set_position_enabled

void set_position_enabled(enabled: bool)

Sets TRANSFORM_FLAG_POSITION into enable.

set_rotation_enabled

void set_rotation_enabled(enabled: bool)

Sets TRANSFORM_FLAG_ROTATION into enable.

set_scale_enabled

void set_scale_enabled(enabled: bool)

Sets TRANSFORM_FLAG_SCALE into enable.