class_skeleton.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Skeleton.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Skeleton:
  5. Skeleton
  6. ========
  7. **Inherits:** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Skeleton for characters and animated objects.
  12. Member Functions
  13. ----------------
  14. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_bone<class_Skeleton_add_bone>` **(** :ref:`String<class_string>` name **)** |
  16. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`bind_child_node_to_bone<class_Skeleton_bind_child_node_to_bone>` **(** :ref:`int<class_int>` bone_idx, :ref:`Node<class_node>` node **)** |
  18. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`clear_bones<class_Skeleton_clear_bones>` **(** **)** |
  20. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`find_bone<class_Skeleton_find_bone>` **(** :ref:`String<class_string>` name **)** const |
  22. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_bone_count<class_Skeleton_get_bone_count>` **(** **)** const |
  24. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Transform<class_transform>` | :ref:`get_bone_custom_pose<class_Skeleton_get_bone_custom_pose>` **(** :ref:`int<class_int>` bone_idx **)** const |
  26. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Transform<class_transform>` | :ref:`get_bone_global_pose<class_Skeleton_get_bone_global_pose>` **(** :ref:`int<class_int>` bone_idx **)** const |
  28. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`String<class_string>` | :ref:`get_bone_name<class_Skeleton_get_bone_name>` **(** :ref:`int<class_int>` bone_idx **)** const |
  30. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_bone_parent<class_Skeleton_get_bone_parent>` **(** :ref:`int<class_int>` bone_idx **)** const |
  32. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Transform<class_transform>` | :ref:`get_bone_pose<class_Skeleton_get_bone_pose>` **(** :ref:`int<class_int>` bone_idx **)** const |
  34. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Transform<class_transform>` | :ref:`get_bone_rest<class_Skeleton_get_bone_rest>` **(** :ref:`int<class_int>` bone_idx **)** const |
  36. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Transform<class_transform>` | :ref:`get_bone_transform<class_Skeleton_get_bone_transform>` **(** :ref:`int<class_int>` bone_idx **)** const |
  38. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Array<class_array>` | :ref:`get_bound_child_nodes_to_bone<class_Skeleton_get_bound_child_nodes_to_bone>` **(** :ref:`int<class_int>` bone_idx **)** const |
  40. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`is_bone_rest_disabled<class_Skeleton_is_bone_rest_disabled>` **(** :ref:`int<class_int>` bone_idx **)** const |
  42. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_bone_custom_pose<class_Skeleton_set_bone_custom_pose>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` custom_pose **)** |
  44. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`set_bone_disable_rest<class_Skeleton_set_bone_disable_rest>` **(** :ref:`int<class_int>` bone_idx, :ref:`bool<class_bool>` disable **)** |
  46. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`set_bone_global_pose<class_Skeleton_set_bone_global_pose>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` pose **)** |
  48. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`set_bone_parent<class_Skeleton_set_bone_parent>` **(** :ref:`int<class_int>` bone_idx, :ref:`int<class_int>` parent_idx **)** |
  50. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_bone_pose<class_Skeleton_set_bone_pose>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` pose **)** |
  52. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_bone_rest<class_Skeleton_set_bone_rest>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` rest **)** |
  54. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`unbind_child_node_from_bone<class_Skeleton_unbind_child_node_from_bone>` **(** :ref:`int<class_int>` bone_idx, :ref:`Node<class_node>` node **)** |
  56. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`unparent_bone_and_rest<class_Skeleton_unparent_bone_and_rest>` **(** :ref:`int<class_int>` bone_idx **)** |
  58. +------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. Numeric Constants
  60. -----------------
  61. - **NOTIFICATION_UPDATE_SKELETON** = **50**
  62. Description
  63. -----------
  64. Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see :ref:`Animation<class_animation>`). Skeleton will support rag doll dynamics in the future.
  65. Member Function Description
  66. ---------------------------
  67. .. _class_Skeleton_add_bone:
  68. - void **add_bone** **(** :ref:`String<class_string>` name **)**
  69. Add a bone, with name "name". :ref:`get_bone_count<class_Skeleton_get_bone_count>` will become the bone index.
  70. .. _class_Skeleton_bind_child_node_to_bone:
  71. - void **bind_child_node_to_bone** **(** :ref:`int<class_int>` bone_idx, :ref:`Node<class_node>` node **)**
  72. Deprecated soon.
  73. .. _class_Skeleton_clear_bones:
  74. - void **clear_bones** **(** **)**
  75. Clear all the bones in this skeleton.
  76. .. _class_Skeleton_find_bone:
  77. - :ref:`int<class_int>` **find_bone** **(** :ref:`String<class_string>` name **)** const
  78. Return the bone index that matches "name" as its name.
  79. .. _class_Skeleton_get_bone_count:
  80. - :ref:`int<class_int>` **get_bone_count** **(** **)** const
  81. Return the amount of bones in the skeleton.
  82. .. _class_Skeleton_get_bone_custom_pose:
  83. - :ref:`Transform<class_transform>` **get_bone_custom_pose** **(** :ref:`int<class_int>` bone_idx **)** const
  84. .. _class_Skeleton_get_bone_global_pose:
  85. - :ref:`Transform<class_transform>` **get_bone_global_pose** **(** :ref:`int<class_int>` bone_idx **)** const
  86. .. _class_Skeleton_get_bone_name:
  87. - :ref:`String<class_string>` **get_bone_name** **(** :ref:`int<class_int>` bone_idx **)** const
  88. Return the name of the bone at index "index"
  89. .. _class_Skeleton_get_bone_parent:
  90. - :ref:`int<class_int>` **get_bone_parent** **(** :ref:`int<class_int>` bone_idx **)** const
  91. Return the bone index which is the parent of the bone at "bone_idx". If -1, then bone has no parent. Note that the parent bone returned will always be less than "bone_idx".
  92. .. _class_Skeleton_get_bone_pose:
  93. - :ref:`Transform<class_transform>` **get_bone_pose** **(** :ref:`int<class_int>` bone_idx **)** const
  94. Return the pose transform for bone "bone_idx".
  95. .. _class_Skeleton_get_bone_rest:
  96. - :ref:`Transform<class_transform>` **get_bone_rest** **(** :ref:`int<class_int>` bone_idx **)** const
  97. Return the rest transform for a bone "bone_idx".
  98. .. _class_Skeleton_get_bone_transform:
  99. - :ref:`Transform<class_transform>` **get_bone_transform** **(** :ref:`int<class_int>` bone_idx **)** const
  100. .. _class_Skeleton_get_bound_child_nodes_to_bone:
  101. - :ref:`Array<class_array>` **get_bound_child_nodes_to_bone** **(** :ref:`int<class_int>` bone_idx **)** const
  102. Deprecated soon.
  103. .. _class_Skeleton_is_bone_rest_disabled:
  104. - :ref:`bool<class_bool>` **is_bone_rest_disabled** **(** :ref:`int<class_int>` bone_idx **)** const
  105. .. _class_Skeleton_set_bone_custom_pose:
  106. - void **set_bone_custom_pose** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` custom_pose **)**
  107. .. _class_Skeleton_set_bone_disable_rest:
  108. - void **set_bone_disable_rest** **(** :ref:`int<class_int>` bone_idx, :ref:`bool<class_bool>` disable **)**
  109. .. _class_Skeleton_set_bone_global_pose:
  110. - void **set_bone_global_pose** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` pose **)**
  111. .. _class_Skeleton_set_bone_parent:
  112. - void **set_bone_parent** **(** :ref:`int<class_int>` bone_idx, :ref:`int<class_int>` parent_idx **)**
  113. Set the bone index "parent_idx" as the parent of the bone at "bone_idx". If -1, then bone has no parent. Note: "parent_idx" must be less than "bone_idx".
  114. .. _class_Skeleton_set_bone_pose:
  115. - void **set_bone_pose** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` pose **)**
  116. Return the pose transform for bone "bone_idx".
  117. .. _class_Skeleton_set_bone_rest:
  118. - void **set_bone_rest** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform<class_transform>` rest **)**
  119. Set the rest transform for bone "bone_idx"
  120. .. _class_Skeleton_unbind_child_node_from_bone:
  121. - void **unbind_child_node_from_bone** **(** :ref:`int<class_int>` bone_idx, :ref:`Node<class_node>` node **)**
  122. Deprecated soon.
  123. .. _class_Skeleton_unparent_bone_and_rest:
  124. - void **unparent_bone_and_rest** **(** :ref:`int<class_int>` bone_idx **)**