Debian Codegraph @

doc/classes/Skeleton3D.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="Skeleton3D" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A node containing a bone hierarchy, used to create a 3D skeletal animation.
5 </brief_description>
6 <description>
7 [Skeleton3D] provides an interface for managing a hierarchy of bones, including pose, rest and animation (see [Animation]). It can also use ragdoll physics.
8 The overall transform of a bone with respect to the skeleton is determined by bone pose. Bone rest defines the initial transform of the bone pose.
9 Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it is not the actual global/world transform of the bone.
10 </description>
11 <tutorials>
12 <link title="Third Person Shooter (TPS) Demo">https://godotengine.org/asset-library/asset/2710</link>
13 </tutorials>
14 <methods>
15 <method name="add_bone">
16 <return type="int" />
17 <param index="0" name="name" type="String" />
18 <description>
19 Adds a new bone with the given name. Returns the new bone's index, or [code]-1[/code] if this method fails.
20 [b]Note:[/b] Bone names should be unique, non empty, and cannot include the [code]:[/code] and [code]/[/code] characters.
21 </description>
22 </method>
23 <method name="advance">
24 <return type="void" />
25 <param index="0" name="delta" type="float" />
26 <description>
27 Manually advance the child [SkeletonModifier3D]s by the specified time (in seconds).
28 [b]Note:[/b] The [param delta] is temporarily accumulated in the [Skeleton3D], and the deferred process uses the accumulated value to process the modification.
29 </description>
30 </method>
31 <method name="clear_bones">
32 <return type="void" />
33 <description>
34 Clear all the bones in this skeleton.
35 </description>
36 </method>
37 <method name="clear_bones_global_pose_override" deprecated="">
38 <return type="void" />
39 <description>
40 Removes the global pose override on all bones in the skeleton.
41 </description>
42 </method>
43 <method name="create_skin_from_rest_transforms">
44 <return type="Skin" />
45 <description>
46 </description>
47 </method>
48 <method name="find_bone" qualifiers="const">
49 <return type="int" />
50 <param index="0" name="name" type="String" />
51 <description>
52 Returns the bone index that matches [param name] as its name. Returns [code]-1[/code] if no bone with this name exists.
53 </description>
54 </method>
55 <method name="force_update_all_bone_transforms" deprecated="This method should only be called internally.">
56 <return type="void" />
57 <description>
58 Force updates the bone transforms/poses for all bones in the skeleton.
59 </description>
60 </method>
61 <method name="force_update_bone_child_transform">
62 <return type="void" />
63 <param index="0" name="bone_idx" type="int" />
64 <description>
65 Force updates the bone transform for the bone at [param bone_idx] and all of its children.
66 </description>
67 </method>
68 <method name="get_bone_children" qualifiers="const">
69 <return type="PackedInt32Array" />
70 <param index="0" name="bone_idx" type="int" />
71 <description>
72 Returns an array containing the bone indexes of all the child node of the passed in bone, [param bone_idx].
73 </description>
74 </method>
75 <method name="get_bone_count" qualifiers="const">
76 <return type="int" />
77 <description>
78 Returns the number of bones in the skeleton.
79 </description>
80 </method>
81 <method name="get_bone_global_pose" qualifiers="const">
82 <return type="Transform3D" />
83 <param index="0" name="bone_idx" type="int" />
84 <description>
85 Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
86 [b]Note:[/b] This is the global pose you set to the skeleton in the process, the final global pose can get overridden by modifiers in the deferred process, if you want to access the final global pose, use [signal SkeletonModifier3D.modification_processed].
87 </description>
88 </method>
89 <method name="get_bone_global_pose_no_override" qualifiers="const" deprecated="">
90 <return type="Transform3D" />
91 <param index="0" name="bone_idx" type="int" />
92 <description>
93 Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone.
94 </description>
95 </method>
96 <method name="get_bone_global_pose_override" qualifiers="const" deprecated="">
97 <return type="Transform3D" />
98 <param index="0" name="bone_idx" type="int" />
99 <description>
100 Returns the global pose override transform for [param bone_idx].
101 </description>
102 </method>
103 <method name="get_bone_global_rest" qualifiers="const">
104 <return type="Transform3D" />
105 <param index="0" name="bone_idx" type="int" />
106 <description>
107 Returns the global rest transform for [param bone_idx].
108 </description>
109 </method>
110 <method name="get_bone_meta" qualifiers="const">
111 <return type="Variant" />
112 <param index="0" name="bone_idx" type="int" />
113 <param index="1" name="key" type="StringName" />
114 <description>
115 Returns the metadata with the given [param key] for the bone at index [param bone_idx].
116 </description>
117 </method>
118 <method name="get_bone_meta_list" qualifiers="const">
119 <return type="StringName[]" />
120 <param index="0" name="bone_idx" type="int" />
121 <description>
122 Returns the list of all metadata keys for the bone at index [param bone_idx].
123 </description>
124 </method>
125 <method name="get_bone_name" qualifiers="const">
126 <return type="String" />
127 <param index="0" name="bone_idx" type="int" />
128 <description>
129 Returns the name of the bone at index [param bone_idx].
130 </description>
131 </method>
132 <method name="get_bone_parent" qualifiers="const">
133 <return type="int" />
134 <param index="0" name="bone_idx" type="int" />
135 <description>
136 Returns the bone index which is the parent of the bone at [param bone_idx]. If -1, then bone has no parent.
137 [b]Note:[/b] The parent bone returned will always be less than [param bone_idx].
138 </description>
139 </method>
140 <method name="get_bone_pose" qualifiers="const">
141 <return type="Transform3D" />
142 <param index="0" name="bone_idx" type="int" />
143 <description>
144 Returns the pose transform of the specified bone.
145 [b]Note:[/b] This is the pose you set to the skeleton in the process, the final pose can get overridden by modifiers in the deferred process, if you want to access the final pose, use [signal SkeletonModifier3D.modification_processed].
146 </description>
147 </method>
148 <method name="get_bone_pose_position" qualifiers="const">
149 <return type="Vector3" />
150 <param index="0" name="bone_idx" type="int" />
151 <description>
152 Returns the pose position of the bone at [param bone_idx]. The returned [Vector3] is in the local coordinate space of the [Skeleton3D] node.
153 </description>
154 </method>
155 <method name="get_bone_pose_rotation" qualifiers="const">
156 <return type="Quaternion" />
157 <param index="0" name="bone_idx" type="int" />
158 <description>
159 Returns the pose rotation of the bone at [param bone_idx]. The returned [Quaternion] is local to the bone with respect to the rotation of any parent bones.
160 </description>
161 </method>
162 <method name="get_bone_pose_scale" qualifiers="const">
163 <return type="Vector3" />
164 <param index="0" name="bone_idx" type="int" />
165 <description>
166 Returns the pose scale of the bone at [param bone_idx].
167 </description>
168 </method>
169 <method name="get_bone_rest" qualifiers="const">
170 <return type="Transform3D" />
171 <param index="0" name="bone_idx" type="int" />
172 <description>
173 Returns the rest transform for a bone [param bone_idx].
174 </description>
175 </method>
176 <method name="get_concatenated_bone_names" qualifiers="const">
177 <return type="StringName" />
178 <description>
179 Returns all bone names concatenated with commas ([code],[/code]) as a single [StringName].
180 It is useful to set it as a hint for the enum property.
181 </description>
182 </method>
183 <method name="get_parentless_bones" qualifiers="const">
184 <return type="PackedInt32Array" />
185 <description>
186 Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton.
187 </description>
188 </method>
189 <method name="get_version" qualifiers="const">
190 <return type="int" />
191 <description>
192 Returns the number of times the bone hierarchy has changed within this skeleton, including renames.
193 The Skeleton version is not serialized: only use within a single instance of Skeleton3D.
194 Use for invalidating caches in IK solvers and other nodes which process bones.
195 </description>
196 </method>
197 <method name="has_bone_meta" qualifiers="const">
198 <return type="bool" />
199 <param index="0" name="bone_idx" type="int" />
200 <param index="1" name="key" type="StringName" />
201 <description>
202 Returns [code]true[/code] if the bone at index [param bone_idx] has metadata with the given [param key].
203 </description>
204 </method>
205 <method name="is_bone_enabled" qualifiers="const">
206 <return type="bool" />
207 <param index="0" name="bone_idx" type="int" />
208 <description>
209 Returns whether the bone pose for the bone at [param bone_idx] is enabled.
210 </description>
211 </method>
212 <method name="localize_rests">
213 <return type="void" />
214 <description>
215 Returns all bones in the skeleton to their rest poses.
216 </description>
217 </method>
218 <method name="physical_bones_add_collision_exception" deprecated="">
219 <return type="void" />
220 <param index="0" name="exception" type="RID" />
221 <description>
222 Adds a collision exception to the physical bone.
223 Works just like the [RigidBody3D] node.
224 </description>
225 </method>
226 <method name="physical_bones_remove_collision_exception" deprecated="">
227 <return type="void" />
228 <param index="0" name="exception" type="RID" />
229 <description>
230 Removes a collision exception to the physical bone.
231 Works just like the [RigidBody3D] node.
232 </description>
233 </method>
234 <method name="physical_bones_start_simulation" deprecated="">
235 <return type="void" />
236 <param index="0" name="bones" type="StringName[]" default="[]" />
237 <description>
238 Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world.
239 Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated.
240 </description>
241 </method>
242 <method name="physical_bones_stop_simulation" deprecated="">
243 <return type="void" />
244 <description>
245 Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating.
246 </description>
247 </method>
248 <method name="register_skin">
249 <return type="SkinReference" />
250 <param index="0" name="skin" type="Skin" />
251 <description>
252 Binds the given Skin to the Skeleton.
253 </description>
254 </method>
255 <method name="reset_bone_pose">
256 <return type="void" />
257 <param index="0" name="bone_idx" type="int" />
258 <description>
259 Sets the bone pose to rest for [param bone_idx].
260 </description>
261 </method>
262 <method name="reset_bone_poses">
263 <return type="void" />
264 <description>
265 Sets all bone poses to rests.
266 </description>
267 </method>
268 <method name="set_bone_enabled">
269 <return type="void" />
270 <param index="0" name="bone_idx" type="int" />
271 <param index="1" name="enabled" type="bool" default="true" />
272 <description>
273 Disables the pose for the bone at [param bone_idx] if [code]false[/code], enables the bone pose if [code]true[/code].
274 </description>
275 </method>
276 <method name="set_bone_global_pose">
277 <return type="void" />
278 <param index="0" name="bone_idx" type="int" />
279 <param index="1" name="pose" type="Transform3D" />
280 <description>
281 Sets the global pose transform, [param pose], for the bone at [param bone_idx].
282 [b]Note:[/b] If other bone poses have been changed, this method executes a dirty poses recalculation and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using [method set_bone_pose] with precalculation.
283 </description>
284 </method>
285 <method name="set_bone_global_pose_override" deprecated="">
286 <return type="void" />
287 <param index="0" name="bone_idx" type="int" />
288 <param index="1" name="pose" type="Transform3D" />
289 <param index="2" name="amount" type="float" />
290 <param index="3" name="persistent" type="bool" default="false" />
291 <description>
292 Sets the global pose transform, [param pose], for the bone at [param bone_idx].
293 [param amount] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain.
294 [b]Note:[/b] The pose transform needs to be a global pose! To convert a world transform from a [Node3D] to a global bone pose, multiply the [method Transform3D.affine_inverse] of the node's [member Node3D.global_transform] by the desired world transform.
295 </description>
296 </method>
297 <method name="set_bone_meta">
298 <return type="void" />
299 <param index="0" name="bone_idx" type="int" />
300 <param index="1" name="key" type="StringName" />
301 <param index="2" name="value" type="Variant" />
302 <description>
303 Sets the metadata with the given [param key] to [param value] for the bone at index [param bone_idx].
304 </description>
305 </method>
306 <method name="set_bone_name">
307 <return type="void" />
308 <param index="0" name="bone_idx" type="int" />
309 <param index="1" name="name" type="String" />
310 <description>
311 Sets the bone name, [param name], for the bone at [param bone_idx].
312 </description>
313 </method>
314 <method name="set_bone_parent">
315 <return type="void" />
316 <param index="0" name="bone_idx" type="int" />
317 <param index="1" name="parent_idx" type="int" />
318 <description>
319 Sets the bone index [param parent_idx] as the parent of the bone at [param bone_idx]. If -1, then bone has no parent.
320 [b]Note:[/b] [param parent_idx] must be less than [param bone_idx].
321 </description>
322 </method>
323 <method name="set_bone_pose">
324 <return type="void" />
325 <param index="0" name="bone_idx" type="int" />
326 <param index="1" name="pose" type="Transform3D" />
327 <description>
328 Sets the pose transform, [param pose], for the bone at [param bone_idx].
329 </description>
330 </method>
331 <method name="set_bone_pose_position">
332 <return type="void" />
333 <param index="0" name="bone_idx" type="int" />
334 <param index="1" name="position" type="Vector3" />
335 <description>
336 Sets the pose position of the bone at [param bone_idx] to [param position]. [param position] is a [Vector3] describing a position local to the [Skeleton3D] node.
337 </description>
338 </method>
339 <method name="set_bone_pose_rotation">
340 <return type="void" />
341 <param index="0" name="bone_idx" type="int" />
342 <param index="1" name="rotation" type="Quaternion" />
343 <description>
344 Sets the pose rotation of the bone at [param bone_idx] to [param rotation]. [param rotation] is a [Quaternion] describing a rotation in the bone's local coordinate space with respect to the rotation of any parent bones.
345 </description>
346 </method>
347 <method name="set_bone_pose_scale">
348 <return type="void" />
349 <param index="0" name="bone_idx" type="int" />
350 <param index="1" name="scale" type="Vector3" />
351 <description>
352 Sets the pose scale of the bone at [param bone_idx] to [param scale].
353 </description>
354 </method>
355 <method name="set_bone_rest">
356 <return type="void" />
357 <param index="0" name="bone_idx" type="int" />
358 <param index="1" name="rest" type="Transform3D" />
359 <description>
360 Sets the rest transform for bone [param bone_idx].
361 </description>
362 </method>
363 <method name="unparent_bone_and_rest">
364 <return type="void" />
365 <param index="0" name="bone_idx" type="int" />
366 <description>
367 Unparents the bone at [param bone_idx] and sets its rest position to that of its parent prior to being reset.
368 </description>
369 </method>
370 </methods>
371 <members>
372 <member name="animate_physical_bones" type="bool" setter="set_animate_physical_bones" getter="get_animate_physical_bones" default="true" deprecated="">
373 If you follow the recommended workflow and explicitly have [PhysicalBoneSimulator3D] as a child of [Skeleton3D], you can control whether it is affected by raycasting without running [method physical_bones_start_simulation], by its [member SkeletonModifier3D.active].
374 However, for old (deprecated) configurations, [Skeleton3D] has an internal virtual [PhysicalBoneSimulator3D] for compatibility. This property controls the internal virtual [PhysicalBoneSimulator3D]'s [member SkeletonModifier3D.active].
375 </member>
376 <member name="modifier_callback_mode_process" type="int" setter="set_modifier_callback_mode_process" getter="get_modifier_callback_mode_process" enum="Skeleton3D.ModifierCallbackModeProcess" default="1">
377 Sets the processing timing for the Modifier.
378 </member>
379 <member name="motion_scale" type="float" setter="set_motion_scale" getter="get_motion_scale" default="1.0">
380 Multiplies the 3D position track animation.
381 [b]Note:[/b] Unless this value is [code]1.0[/code], the key value in animation will not match the actual position value.
382 </member>
383 <member name="show_rest_only" type="bool" setter="set_show_rest_only" getter="is_show_rest_only" default="false">
384 If [code]true[/code], forces the bones in their default rest pose, regardless of their values. In the editor, this also prevents the bones from being edited.
385 </member>
386 </members>
387 <signals>
388 <signal name="bone_enabled_changed">
389 <param index="0" name="bone_idx" type="int" />
390 <description>
391 Emitted when the bone at [param bone_idx] is toggled with [method set_bone_enabled]. Use [method is_bone_enabled] to check the new value.
392 </description>
393 </signal>
394 <signal name="bone_list_changed">
395 <description>
396 Emitted when the list of bones changes, such as when calling [method add_bone], [method set_bone_parent], [method unparent_bone_and_rest], or [method clear_bones].
397 </description>
398 </signal>
399 <signal name="pose_updated">
400 <description>
401 Emitted when the pose is updated.
402 [b]Note:[/b] During the update process, this signal is not fired, so modification by [SkeletonModifier3D] is not detected.
403 </description>
404 </signal>
405 <signal name="rest_updated">
406 <description>
407 Emitted when the rest is updated.
408 </description>
409 </signal>
410 <signal name="show_rest_only_changed">
411 <description>
412 Emitted when the value of [member show_rest_only] changes.
413 </description>
414 </signal>
415 <signal name="skeleton_updated">
416 <description>
417 Emitted when the final pose has been calculated will be applied to the skin in the update process.
418 This means that all [SkeletonModifier3D] processing is complete. In order to detect the completion of the processing of each [SkeletonModifier3D], use [signal SkeletonModifier3D.modification_processed].
419 </description>
420 </signal>
421 </signals>
422 <constants>
423 <constant name="NOTIFICATION_UPDATE_SKELETON" value="50">
424 Notification received when this skeleton's pose needs to be updated. In that case, this is called only once per frame in a deferred process.
425 </constant>
426 <constant name="MODIFIER_CALLBACK_MODE_PROCESS_PHYSICS" value="0" enum="ModifierCallbackModeProcess">
427 Set a flag to process modification during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]).
428 </constant>
429 <constant name="MODIFIER_CALLBACK_MODE_PROCESS_IDLE" value="1" enum="ModifierCallbackModeProcess">
430 Set a flag to process modification during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]).
431 </constant>
432 <constant name="MODIFIER_CALLBACK_MODE_PROCESS_MANUAL" value="2" enum="ModifierCallbackModeProcess">
433 Do not process modification. Use [method advance] to process the modification manually.
434 </constant>
435 </constants>
436 </class>