2022-06-27 08:06:50 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name= "SkeletonProfile" inherits= "Resource" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
<brief_description >
Profile of a virtual skeleton used as a target for retargeting.
</brief_description>
<description >
This resource is used in [EditorScenePostImport]. Some parameters are referring to bones in [Skeleton3D], [Skin], [Animation], and some other nodes are rewritten based on the parameters of [SkeletonProfile].
2023-01-15 17:54:20 +00:00
[b]Note:[/b] These parameters need to be set only when creating a custom profile. In [SkeletonProfileHumanoid], they are defined internally as read-only values.
2022-06-27 08:06:50 +00:00
</description>
<tutorials >
2022-10-21 17:56:16 +00:00
<link title= "Retargeting 3D Skeletons" > $DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html</link>
2022-06-27 08:06:50 +00:00
</tutorials>
<methods >
2022-07-05 05:04:17 +00:00
<method name= "find_bone" qualifiers= "const" >
<return type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_name" type= "StringName" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the bone index that matches [param bone_name] as its name.
2022-07-05 05:04:17 +00:00
</description>
</method>
2022-06-27 08:06:50 +00:00
<method name= "get_bone_name" qualifiers= "const" >
<return type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the name of the bone at [param bone_idx] that will be the key name in the [BoneMap].
2022-06-27 08:06:50 +00:00
In the retargeting process, the returned bone name is the bone name of the target skeleton.
</description>
</method>
2022-07-05 05:04:17 +00:00
<method name= "get_bone_parent" qualifiers= "const" >
<return type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the name of the bone which is the parent to the bone at [param bone_idx]. The result is empty if the bone has no parent.
2022-07-05 05:04:17 +00:00
</description>
</method>
<method name= "get_bone_tail" qualifiers= "const" >
<return type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the name of the bone which is the tail of the bone at [param bone_idx].
2022-07-05 05:04:17 +00:00
</description>
</method>
2022-06-27 08:06:50 +00:00
<method name= "get_group" qualifiers= "const" >
<return type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the group of the bone at [param bone_idx].
2022-06-27 08:06:50 +00:00
</description>
</method>
<method name= "get_group_name" qualifiers= "const" >
<return type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "group_idx" type= "int" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the name of the group at [param group_idx] that will be the drawing group in the [BoneMap] editor.
2022-06-27 08:06:50 +00:00
</description>
</method>
<method name= "get_handle_offset" qualifiers= "const" >
<return type= "Vector2" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the offset of the bone at [param bone_idx] that will be the button position in the [BoneMap] editor.
2022-06-27 08:06:50 +00:00
This is the offset with origin at the top left corner of the square.
</description>
</method>
2022-07-05 05:04:17 +00:00
<method name= "get_reference_pose" qualifiers= "const" >
<return type= "Transform3D" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the reference pose transform for bone [param bone_idx].
2022-07-05 05:04:17 +00:00
</description>
</method>
<method name= "get_tail_direction" qualifiers= "const" >
<return type= "int" enum= "SkeletonProfile.TailDirection" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the tail direction of the bone at [param bone_idx].
2022-07-05 05:04:17 +00:00
</description>
</method>
2022-06-27 08:06:50 +00:00
<method name= "get_texture" qualifiers= "const" >
<return type= "Texture2D" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "group_idx" type= "int" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the texture of the group at [param group_idx] that will be the drawing group background image in the [BoneMap] editor.
2022-06-27 08:06:50 +00:00
</description>
</method>
<method name= "set_bone_name" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "bone_name" type= "StringName" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the name of the bone at [param bone_idx] that will be the key name in the [BoneMap].
2022-06-27 08:06:50 +00:00
In the retargeting process, the setting bone name is the bone name of the target skeleton.
</description>
</method>
2022-07-05 05:04:17 +00:00
<method name= "set_bone_parent" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "bone_parent" type= "StringName" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the bone with name [param bone_parent] as the parent of the bone at [param bone_idx]. If an empty string is passed, then the bone has no parent.
2022-07-05 05:04:17 +00:00
</description>
</method>
<method name= "set_bone_tail" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "bone_tail" type= "StringName" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the bone with name [param bone_tail] as the tail of the bone at [param bone_idx].
2022-07-05 05:04:17 +00:00
</description>
</method>
2022-06-27 08:06:50 +00:00
<method name= "set_group" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "group" type= "StringName" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the group of the bone at [param bone_idx].
2022-06-27 08:06:50 +00:00
</description>
</method>
<method name= "set_group_name" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "group_idx" type= "int" />
<param index= "1" name= "group_name" type= "StringName" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the name of the group at [param group_idx] that will be the drawing group in the [BoneMap] editor.
2022-06-27 08:06:50 +00:00
</description>
</method>
<method name= "set_handle_offset" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "handle_offset" type= "Vector2" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the offset of the bone at [param bone_idx] that will be the button position in the [BoneMap] editor.
2022-06-27 08:06:50 +00:00
This is the offset with origin at the top left corner of the square.
</description>
</method>
2022-07-05 05:04:17 +00:00
<method name= "set_reference_pose" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "bone_name" type= "Transform3D" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the reference pose transform for bone [param bone_idx].
2022-07-05 05:04:17 +00:00
</description>
</method>
<method name= "set_tail_direction" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "bone_idx" type= "int" />
<param index= "1" name= "tail_direction" type= "int" enum= "SkeletonProfile.TailDirection" />
2022-07-05 05:04:17 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the tail direction of the bone at [param bone_idx].
2022-07-05 05:04:17 +00:00
[b]Note:[/b] This only specifies the method of calculation. The actual coordinates required should be stored in an external skeleton, so the calculation itself needs to be done externally.
</description>
</method>
2022-06-27 08:06:50 +00:00
<method name= "set_texture" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "group_idx" type= "int" />
<param index= "1" name= "texture" type= "Texture2D" />
2022-06-27 08:06:50 +00:00
<description >
2022-08-10 02:00:19 +00:00
Sets the texture of the group at [param group_idx] that will be the drawing group background image in the [BoneMap] editor.
2022-06-27 08:06:50 +00:00
</description>
</method>
</methods>
<members >
<member name= "bone_size" type= "int" setter= "set_bone_size" getter= "get_bone_size" default= "0" >
2023-01-15 17:54:20 +00:00
The amount of bones in retargeting section's [BoneMap] editor. For example, [SkeletonProfileHumanoid] has 56 bones.
The size of elements in [BoneMap] updates when changing this property in it's assigned [SkeletonProfile].
2022-06-27 08:06:50 +00:00
</member>
<member name= "group_size" type= "int" setter= "set_group_size" getter= "get_group_size" default= "0" >
2023-01-15 17:54:20 +00:00
The amount of groups of bones in retargeting section's [BoneMap] editor. For example, [SkeletonProfileHumanoid] has 4 groups.
This property exists to separate the bone list into several sections in the editor.
2022-06-27 08:06:50 +00:00
</member>
2022-07-26 09:48:08 +00:00
<member name= "root_bone" type= "StringName" setter= "set_root_bone" getter= "get_root_bone" default= "&""" >
2023-01-15 17:54:20 +00:00
A bone name that will be used as the root bone in [AnimationTree]. This should be the bone of the parent of hips that exists at the world origin.
2022-07-26 09:48:08 +00:00
</member>
<member name= "scale_base_bone" type= "StringName" setter= "set_scale_base_bone" getter= "get_scale_base_bone" default= "&""" >
2023-01-15 17:54:20 +00:00
A bone name which will use model's height as the coefficient for normalization. For example, [SkeletonProfileHumanoid] defines it as [code]Hips[/code].
2022-07-26 09:48:08 +00:00
</member>
2022-06-27 08:06:50 +00:00
</members>
<signals >
<signal name= "profile_updated" >
<description >
This signal is emitted when change the value in profile. This is used to update key name in the [BoneMap] and to redraw the [BoneMap] editor.
2022-07-27 13:55:38 +00:00
[b]Note:[/b] This signal is not connected directly to editor to simplify the reference, instead it is passed on to editor through the [BoneMap].
2022-06-27 08:06:50 +00:00
</description>
</signal>
</signals>
2022-07-05 05:04:17 +00:00
<constants >
<constant name= "TAIL_DIRECTION_AVERAGE_CHILDREN" value= "0" enum= "TailDirection" >
Direction to the average coordinates of bone children.
</constant>
<constant name= "TAIL_DIRECTION_SPECIFIC_CHILD" value= "1" enum= "TailDirection" >
Direction to the coordinates of specified bone child.
</constant>
<constant name= "TAIL_DIRECTION_END" value= "2" enum= "TailDirection" >
Direction is not calculated.
</constant>
</constants>
2022-06-27 08:06:50 +00:00
</class>