Skeleton.xml 8.1 KB

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