Skeleton.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Skeleton" inherits="Spatial" category="Core" version="3.1">
  3. <brief_description>
  4. Skeleton for characters and animated objects.
  5. </brief_description>
  6. <description>
  7. Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see [Animation]). Skeleton will support rag doll dynamics in the future.
  8. The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose.
  9. Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.
  10. </description>
  11. <tutorials>
  12. </tutorials>
  13. <demos>
  14. </demos>
  15. <methods>
  16. <method name="add_bone">
  17. <return type="void">
  18. </return>
  19. <argument index="0" name="name" type="String">
  20. </argument>
  21. <description>
  22. Add a bone, with name "name". [method get_bone_count] will become the bone index.
  23. </description>
  24. </method>
  25. <method name="bind_child_node_to_bone">
  26. <return type="void">
  27. </return>
  28. <argument index="0" name="bone_idx" type="int">
  29. </argument>
  30. <argument index="1" name="node" type="Node">
  31. </argument>
  32. <description>
  33. Deprecated soon.
  34. </description>
  35. </method>
  36. <method name="clear_bones">
  37. <return type="void">
  38. </return>
  39. <description>
  40. Clear all the bones in this skeleton.
  41. </description>
  42. </method>
  43. <method name="find_bone" qualifiers="const">
  44. <return type="int">
  45. </return>
  46. <argument index="0" name="name" type="String">
  47. </argument>
  48. <description>
  49. Return the bone index that matches "name" as its name.
  50. </description>
  51. </method>
  52. <method name="get_bone_count" qualifiers="const">
  53. <return type="int">
  54. </return>
  55. <description>
  56. Return the amount of bones in the skeleton.
  57. </description>
  58. </method>
  59. <method name="get_bone_custom_pose" qualifiers="const">
  60. <return type="Transform">
  61. </return>
  62. <argument index="0" name="bone_idx" type="int">
  63. </argument>
  64. <description>
  65. Return the custom pose of the specified bone. Custom pose is applied on top of the rest pose.
  66. </description>
  67. </method>
  68. <method name="get_bone_global_pose" qualifiers="const">
  69. <return type="Transform">
  70. </return>
  71. <argument index="0" name="bone_idx" type="int">
  72. </argument>
  73. <description>
  74. Return 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.
  75. </description>
  76. </method>
  77. <method name="get_bone_name" qualifiers="const">
  78. <return type="String">
  79. </return>
  80. <argument index="0" name="bone_idx" type="int">
  81. </argument>
  82. <description>
  83. Return the name of the bone at index "index".
  84. </description>
  85. </method>
  86. <method name="get_bone_parent" qualifiers="const">
  87. <return type="int">
  88. </return>
  89. <argument index="0" name="bone_idx" type="int">
  90. </argument>
  91. <description>
  92. 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".
  93. </description>
  94. </method>
  95. <method name="get_bone_pose" qualifiers="const">
  96. <return type="Transform">
  97. </return>
  98. <argument index="0" name="bone_idx" type="int">
  99. </argument>
  100. <description>
  101. Return the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose.
  102. </description>
  103. </method>
  104. <method name="get_bone_rest" qualifiers="const">
  105. <return type="Transform">
  106. </return>
  107. <argument index="0" name="bone_idx" type="int">
  108. </argument>
  109. <description>
  110. Return the rest transform for a bone "bone_idx".
  111. </description>
  112. </method>
  113. <method name="get_bone_transform" qualifiers="const">
  114. <return type="Transform">
  115. </return>
  116. <argument index="0" name="bone_idx" type="int">
  117. </argument>
  118. <description>
  119. Return the combination of custom pose and pose. The returned transform is in skeleton's reference frame.
  120. </description>
  121. </method>
  122. <method name="get_bound_child_nodes_to_bone" qualifiers="const">
  123. <return type="Array">
  124. </return>
  125. <argument index="0" name="bone_idx" type="int">
  126. </argument>
  127. <description>
  128. Deprecated soon.
  129. </description>
  130. </method>
  131. <method name="is_bone_rest_disabled" qualifiers="const">
  132. <return type="bool">
  133. </return>
  134. <argument index="0" name="bone_idx" type="int">
  135. </argument>
  136. <description>
  137. </description>
  138. </method>
  139. <method name="physical_bones_add_collision_exception">
  140. <return type="void">
  141. </return>
  142. <argument index="0" name="exception" type="RID">
  143. </argument>
  144. <description>
  145. </description>
  146. </method>
  147. <method name="physical_bones_remove_collision_exception">
  148. <return type="void">
  149. </return>
  150. <argument index="0" name="exception" type="RID">
  151. </argument>
  152. <description>
  153. </description>
  154. </method>
  155. <method name="physical_bones_start_simulation">
  156. <return type="void">
  157. </return>
  158. <argument index="0" name="bones" type="Array" default="[ ]">
  159. </argument>
  160. <description>
  161. </description>
  162. </method>
  163. <method name="physical_bones_stop_simulation">
  164. <return type="void">
  165. </return>
  166. <description>
  167. </description>
  168. </method>
  169. <method name="set_bone_custom_pose">
  170. <return type="void">
  171. </return>
  172. <argument index="0" name="bone_idx" type="int">
  173. </argument>
  174. <argument index="1" name="custom_pose" type="Transform">
  175. </argument>
  176. <description>
  177. </description>
  178. </method>
  179. <method name="set_bone_disable_rest">
  180. <return type="void">
  181. </return>
  182. <argument index="0" name="bone_idx" type="int">
  183. </argument>
  184. <argument index="1" name="disable" type="bool">
  185. </argument>
  186. <description>
  187. </description>
  188. </method>
  189. <method name="set_bone_global_pose">
  190. <return type="void">
  191. </return>
  192. <argument index="0" name="bone_idx" type="int">
  193. </argument>
  194. <argument index="1" name="pose" type="Transform">
  195. </argument>
  196. <description>
  197. </description>
  198. </method>
  199. <method name="set_bone_ignore_animation">
  200. <return type="void">
  201. </return>
  202. <argument index="0" name="bone" type="int">
  203. </argument>
  204. <argument index="1" name="ignore" type="bool">
  205. </argument>
  206. <description>
  207. </description>
  208. </method>
  209. <method name="set_bone_parent">
  210. <return type="void">
  211. </return>
  212. <argument index="0" name="bone_idx" type="int">
  213. </argument>
  214. <argument index="1" name="parent_idx" type="int">
  215. </argument>
  216. <description>
  217. 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".
  218. </description>
  219. </method>
  220. <method name="set_bone_pose">
  221. <return type="void">
  222. </return>
  223. <argument index="0" name="bone_idx" type="int">
  224. </argument>
  225. <argument index="1" name="pose" type="Transform">
  226. </argument>
  227. <description>
  228. Return the pose transform for bone "bone_idx".
  229. </description>
  230. </method>
  231. <method name="set_bone_rest">
  232. <return type="void">
  233. </return>
  234. <argument index="0" name="bone_idx" type="int">
  235. </argument>
  236. <argument index="1" name="rest" type="Transform">
  237. </argument>
  238. <description>
  239. Set the rest transform for bone "bone_idx"
  240. </description>
  241. </method>
  242. <method name="unbind_child_node_from_bone">
  243. <return type="void">
  244. </return>
  245. <argument index="0" name="bone_idx" type="int">
  246. </argument>
  247. <argument index="1" name="node" type="Node">
  248. </argument>
  249. <description>
  250. Deprecated soon.
  251. </description>
  252. </method>
  253. <method name="unparent_bone_and_rest">
  254. <return type="void">
  255. </return>
  256. <argument index="0" name="bone_idx" type="int">
  257. </argument>
  258. <description>
  259. </description>
  260. </method>
  261. </methods>
  262. <constants>
  263. <constant name="NOTIFICATION_UPDATE_SKELETON" value="50">
  264. </constant>
  265. </constants>
  266. </class>