0.2.0-dev Download ZIP
213 lines ·9.6 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="SkeletonProfile" inherits="Resource" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Base class for a profile of a virtual skeleton used as a target for retargeting. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | 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]. |
| 8 | [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. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | <link title="Retargeting 3D Skeletons">$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html</link> |
| 12 | </tutorials> |
| 13 | <methods> |
| 14 | <method name="find_bone" qualifiers="const"> |
| 15 | <return type="int" /> |
| 16 | <param index="0" name="bone_name" type="StringName" /> |
| 17 | <description> |
| 18 | Returns the bone index that matches [param bone_name] as its name. |
| 19 | </description> |
| 20 | </method> |
| 21 | <method name="get_bone_name" qualifiers="const"> |
| 22 | <return type="StringName" /> |
| 23 | <param index="0" name="bone_idx" type="int" /> |
| 24 | <description> |
| 25 | Returns the name of the bone at [param bone_idx] that will be the key name in the [BoneMap]. |
| 26 | In the retargeting process, the returned bone name is the bone name of the target skeleton. |
| 27 | </description> |
| 28 | </method> |
| 29 | <method name="get_bone_parent" qualifiers="const"> |
| 30 | <return type="StringName" /> |
| 31 | <param index="0" name="bone_idx" type="int" /> |
| 32 | <description> |
| 33 | 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. |
| 34 | </description> |
| 35 | </method> |
| 36 | <method name="get_bone_tail" qualifiers="const"> |
| 37 | <return type="StringName" /> |
| 38 | <param index="0" name="bone_idx" type="int" /> |
| 39 | <description> |
| 40 | Returns the name of the bone which is the tail of the bone at [param bone_idx]. |
| 41 | </description> |
| 42 | </method> |
| 43 | <method name="get_group" qualifiers="const"> |
| 44 | <return type="StringName" /> |
| 45 | <param index="0" name="bone_idx" type="int" /> |
| 46 | <description> |
| 47 | Returns the group of the bone at [param bone_idx]. |
| 48 | </description> |
| 49 | </method> |
| 50 | <method name="get_group_name" qualifiers="const"> |
| 51 | <return type="StringName" /> |
| 52 | <param index="0" name="group_idx" type="int" /> |
| 53 | <description> |
| 54 | Returns the name of the group at [param group_idx] that will be the drawing group in the [BoneMap] editor. |
| 55 | </description> |
| 56 | </method> |
| 57 | <method name="get_handle_offset" qualifiers="const"> |
| 58 | <return type="Vector2" /> |
| 59 | <param index="0" name="bone_idx" type="int" /> |
| 60 | <description> |
| 61 | Returns the offset of the bone at [param bone_idx] that will be the button position in the [BoneMap] editor. |
| 62 | This is the offset with origin at the top left corner of the square. |
| 63 | </description> |
| 64 | </method> |
| 65 | <method name="get_reference_pose" qualifiers="const"> |
| 66 | <return type="Transform3D" /> |
| 67 | <param index="0" name="bone_idx" type="int" /> |
| 68 | <description> |
| 69 | Returns the reference pose transform for bone [param bone_idx]. |
| 70 | </description> |
| 71 | </method> |
| 72 | <method name="get_tail_direction" qualifiers="const"> |
| 73 | <return type="int" enum="SkeletonProfile.TailDirection" /> |
| 74 | <param index="0" name="bone_idx" type="int" /> |
| 75 | <description> |
| 76 | Returns the tail direction of the bone at [param bone_idx]. |
| 77 | </description> |
| 78 | </method> |
| 79 | <method name="get_texture" qualifiers="const"> |
| 80 | <return type="Texture2D" /> |
| 81 | <param index="0" name="group_idx" type="int" /> |
| 82 | <description> |
| 83 | Returns the texture of the group at [param group_idx] that will be the drawing group background image in the [BoneMap] editor. |
| 84 | </description> |
| 85 | </method> |
| 86 | <method name="is_required" qualifiers="const"> |
| 87 | <return type="bool" /> |
| 88 | <param index="0" name="bone_idx" type="int" /> |
| 89 | <description> |
| 90 | Returns whether the bone at [param bone_idx] is required for retargeting. |
| 91 | This value is used by the bone map editor. If this method returns [code]true[/code], and no bone is assigned, the handle color will be red on the bone map editor. |
| 92 | </description> |
| 93 | </method> |
| 94 | <method name="set_bone_name"> |
| 95 | <return type="void" /> |
| 96 | <param index="0" name="bone_idx" type="int" /> |
| 97 | <param index="1" name="bone_name" type="StringName" /> |
| 98 | <description> |
| 99 | Sets the name of the bone at [param bone_idx] that will be the key name in the [BoneMap]. |
| 100 | In the retargeting process, the setting bone name is the bone name of the target skeleton. |
| 101 | </description> |
| 102 | </method> |
| 103 | <method name="set_bone_parent"> |
| 104 | <return type="void" /> |
| 105 | <param index="0" name="bone_idx" type="int" /> |
| 106 | <param index="1" name="bone_parent" type="StringName" /> |
| 107 | <description> |
| 108 | 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. |
| 109 | </description> |
| 110 | </method> |
| 111 | <method name="set_bone_tail"> |
| 112 | <return type="void" /> |
| 113 | <param index="0" name="bone_idx" type="int" /> |
| 114 | <param index="1" name="bone_tail" type="StringName" /> |
| 115 | <description> |
| 116 | Sets the bone with name [param bone_tail] as the tail of the bone at [param bone_idx]. |
| 117 | </description> |
| 118 | </method> |
| 119 | <method name="set_group"> |
| 120 | <return type="void" /> |
| 121 | <param index="0" name="bone_idx" type="int" /> |
| 122 | <param index="1" name="group" type="StringName" /> |
| 123 | <description> |
| 124 | Sets the group of the bone at [param bone_idx]. |
| 125 | </description> |
| 126 | </method> |
| 127 | <method name="set_group_name"> |
| 128 | <return type="void" /> |
| 129 | <param index="0" name="group_idx" type="int" /> |
| 130 | <param index="1" name="group_name" type="StringName" /> |
| 131 | <description> |
| 132 | Sets the name of the group at [param group_idx] that will be the drawing group in the [BoneMap] editor. |
| 133 | </description> |
| 134 | </method> |
| 135 | <method name="set_handle_offset"> |
| 136 | <return type="void" /> |
| 137 | <param index="0" name="bone_idx" type="int" /> |
| 138 | <param index="1" name="handle_offset" type="Vector2" /> |
| 139 | <description> |
| 140 | Sets the offset of the bone at [param bone_idx] that will be the button position in the [BoneMap] editor. |
| 141 | This is the offset with origin at the top left corner of the square. |
| 142 | </description> |
| 143 | </method> |
| 144 | <method name="set_reference_pose"> |
| 145 | <return type="void" /> |
| 146 | <param index="0" name="bone_idx" type="int" /> |
| 147 | <param index="1" name="bone_name" type="Transform3D" /> |
| 148 | <description> |
| 149 | Sets the reference pose transform for bone [param bone_idx]. |
| 150 | </description> |
| 151 | </method> |
| 152 | <method name="set_required"> |
| 153 | <return type="void" /> |
| 154 | <param index="0" name="bone_idx" type="int" /> |
| 155 | <param index="1" name="required" type="bool" /> |
| 156 | <description> |
| 157 | Sets the required status for bone [param bone_idx] to [param required]. |
| 158 | </description> |
| 159 | </method> |
| 160 | <method name="set_tail_direction"> |
| 161 | <return type="void" /> |
| 162 | <param index="0" name="bone_idx" type="int" /> |
| 163 | <param index="1" name="tail_direction" type="int" enum="SkeletonProfile.TailDirection" /> |
| 164 | <description> |
| 165 | Sets the tail direction of the bone at [param bone_idx]. |
| 166 | [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. |
| 167 | </description> |
| 168 | </method> |
| 169 | <method name="set_texture"> |
| 170 | <return type="void" /> |
| 171 | <param index="0" name="group_idx" type="int" /> |
| 172 | <param index="1" name="texture" type="Texture2D" /> |
| 173 | <description> |
| 174 | Sets the texture of the group at [param group_idx] that will be the drawing group background image in the [BoneMap] editor. |
| 175 | </description> |
| 176 | </method> |
| 177 | </methods> |
| 178 | <members> |
| 179 | <member name="bone_size" type="int" setter="set_bone_size" getter="get_bone_size" default="0"> |
| 180 | The amount of bones in retargeting section's [BoneMap] editor. For example, [SkeletonProfileHumanoid] has 56 bones. |
| 181 | The size of elements in [BoneMap] updates when changing this property in its assigned [SkeletonProfile]. |
| 182 | </member> |
| 183 | <member name="group_size" type="int" setter="set_group_size" getter="get_group_size" default="0"> |
| 184 | The amount of groups of bones in retargeting section's [BoneMap] editor. For example, [SkeletonProfileHumanoid] has 4 groups. |
| 185 | This property exists to separate the bone list into several sections in the editor. |
| 186 | </member> |
| 187 | <member name="root_bone" type="StringName" setter="set_root_bone" getter="get_root_bone" default="&"""> |
| 188 | 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. |
| 189 | </member> |
| 190 | <member name="scale_base_bone" type="StringName" setter="set_scale_base_bone" getter="get_scale_base_bone" default="&"""> |
| 191 | A bone name which will use model's height as the coefficient for normalization. For example, [SkeletonProfileHumanoid] defines it as [code]Hips[/code]. |
| 192 | </member> |
| 193 | </members> |
| 194 | <signals> |
| 195 | <signal name="profile_updated"> |
| 196 | <description> |
| 197 | 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. |
| 198 | [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]. |
| 199 | </description> |
| 200 | </signal> |
| 201 | </signals> |
| 202 | <constants> |
| 203 | <constant name="TAIL_DIRECTION_AVERAGE_CHILDREN" value="0" enum="TailDirection"> |
| 204 | Direction to the average coordinates of bone children. |
| 205 | </constant> |
| 206 | <constant name="TAIL_DIRECTION_SPECIFIC_CHILD" value="1" enum="TailDirection"> |
| 207 | Direction to the coordinates of specified bone child. |
| 208 | </constant> |
| 209 | <constant name="TAIL_DIRECTION_END" value="2" enum="TailDirection"> |
| 210 | Direction is not calculated. |
| 211 | </constant> |
| 212 | </constants> |
| 213 | </class> |