AnimationTreePlayer.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimationTreePlayer" inherits="Node" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. [i]Deprecated.[/i] Animation player that uses a node graph for blending animations. Superseded by [AnimationTree].
  5. </brief_description>
  6. <description>
  7. [i]Deprecated.[/i] A node graph tool for blending multiple animations bound to an [AnimationPlayer]. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose.
  8. It takes [Animation]s from an [AnimationPlayer] node and mixes them depending on the graph.
  9. See [AnimationTree] for a more full-featured replacement of this node.
  10. </description>
  11. <tutorials>
  12. <link>$DOCS_URL/tutorials/animation/animation_tree.html</link>
  13. </tutorials>
  14. <methods>
  15. <method name="add_node">
  16. <return type="void" />
  17. <argument index="0" name="type" type="int" enum="AnimationTreePlayer.NodeType" />
  18. <argument index="1" name="id" type="String" />
  19. <description>
  20. Adds a [code]type[/code] node to the graph with name [code]id[/code].
  21. </description>
  22. </method>
  23. <method name="advance">
  24. <return type="void" />
  25. <argument index="0" name="delta" type="float" />
  26. <description>
  27. Shifts position in the animation timeline. [code]delta[/code] is the time in seconds to shift. Events between the current frame and [code]delta[/code] are handled.
  28. </description>
  29. </method>
  30. <method name="animation_node_get_animation" qualifiers="const">
  31. <return type="Animation" />
  32. <argument index="0" name="id" type="String" />
  33. <description>
  34. Returns the [AnimationPlayer]'s [Animation] bound to the [AnimationTreePlayer]'s animation node with name [code]id[/code].
  35. </description>
  36. </method>
  37. <method name="animation_node_get_master_animation" qualifiers="const">
  38. <return type="String" />
  39. <argument index="0" name="id" type="String" />
  40. <description>
  41. Returns the name of the [member master_player]'s [Animation] bound to this animation node.
  42. </description>
  43. </method>
  44. <method name="animation_node_get_position" qualifiers="const">
  45. <return type="float" />
  46. <argument index="0" name="id" type="String" />
  47. <description>
  48. Returns the absolute playback timestamp of the animation node with name [code]id[/code].
  49. </description>
  50. </method>
  51. <method name="animation_node_set_animation">
  52. <return type="void" />
  53. <argument index="0" name="id" type="String" />
  54. <argument index="1" name="animation" type="Animation" />
  55. <description>
  56. Binds a new [Animation] from the [member master_player] to the [AnimationTreePlayer]'s animation node with name [code]id[/code].
  57. </description>
  58. </method>
  59. <method name="animation_node_set_filter_path">
  60. <return type="void" />
  61. <argument index="0" name="id" type="String" />
  62. <argument index="1" name="path" type="NodePath" />
  63. <argument index="2" name="enable" type="bool" />
  64. <description>
  65. If [code]enable[/code] is [code]true[/code], the animation node with ID [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate.
  66. </description>
  67. </method>
  68. <method name="animation_node_set_master_animation">
  69. <return type="void" />
  70. <argument index="0" name="id" type="String" />
  71. <argument index="1" name="source" type="String" />
  72. <description>
  73. Binds the [Animation] named [code]source[/code] from [member master_player] to the animation node [code]id[/code]. Recalculates caches.
  74. </description>
  75. </method>
  76. <method name="are_nodes_connected" qualifiers="const">
  77. <return type="bool" />
  78. <argument index="0" name="id" type="String" />
  79. <argument index="1" name="dst_id" type="String" />
  80. <argument index="2" name="dst_input_idx" type="int" />
  81. <description>
  82. Returns whether node [code]id[/code] and [code]dst_id[/code] are connected at the specified slot.
  83. </description>
  84. </method>
  85. <method name="blend2_node_get_amount" qualifiers="const">
  86. <return type="float" />
  87. <argument index="0" name="id" type="String" />
  88. <description>
  89. Returns the blend amount of a Blend2 node given its name.
  90. </description>
  91. </method>
  92. <method name="blend2_node_set_amount">
  93. <return type="void" />
  94. <argument index="0" name="id" type="String" />
  95. <argument index="1" name="blend" type="float" />
  96. <description>
  97. Sets the blend amount of a Blend2 node given its name and value.
  98. A Blend2 node blends two animations (A and B) with the amount between 0 and 1.
  99. At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B.
  100. </description>
  101. </method>
  102. <method name="blend2_node_set_filter_path">
  103. <return type="void" />
  104. <argument index="0" name="id" type="String" />
  105. <argument index="1" name="path" type="NodePath" />
  106. <argument index="2" name="enable" type="bool" />
  107. <description>
  108. If [code]enable[/code] is [code]true[/code], the Blend2 node with name [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate.
  109. </description>
  110. </method>
  111. <method name="blend3_node_get_amount" qualifiers="const">
  112. <return type="float" />
  113. <argument index="0" name="id" type="String" />
  114. <description>
  115. Returns the blend amount of a Blend3 node given its name.
  116. </description>
  117. </method>
  118. <method name="blend3_node_set_amount">
  119. <return type="void" />
  120. <argument index="0" name="id" type="String" />
  121. <argument index="1" name="blend" type="float" />
  122. <description>
  123. Sets the blend amount of a Blend3 node given its name and value.
  124. A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1.
  125. At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+.
  126. </description>
  127. </method>
  128. <method name="blend4_node_get_amount" qualifiers="const">
  129. <return type="Vector2" />
  130. <argument index="0" name="id" type="String" />
  131. <description>
  132. Returns the blend amount of a Blend4 node given its name.
  133. </description>
  134. </method>
  135. <method name="blend4_node_set_amount">
  136. <return type="void" />
  137. <argument index="0" name="id" type="String" />
  138. <argument index="1" name="blend" type="Vector2" />
  139. <description>
  140. Sets the blend amount of a Blend4 node given its name and value.
  141. A Blend4 Node blends two pairs of animations.
  142. The two pairs are blended like Blend2 and then added together.
  143. </description>
  144. </method>
  145. <method name="connect_nodes">
  146. <return type="int" enum="Error" />
  147. <argument index="0" name="id" type="String" />
  148. <argument index="1" name="dst_id" type="String" />
  149. <argument index="2" name="dst_input_idx" type="int" />
  150. <description>
  151. Connects node [code]id[/code] to [code]dst_id[/code] at the specified input slot.
  152. </description>
  153. </method>
  154. <method name="disconnect_nodes">
  155. <return type="void" />
  156. <argument index="0" name="id" type="String" />
  157. <argument index="1" name="dst_input_idx" type="int" />
  158. <description>
  159. Disconnects nodes connected to [code]id[/code] at the specified input slot.
  160. </description>
  161. </method>
  162. <method name="get_node_list">
  163. <return type="PoolStringArray" />
  164. <description>
  165. Returns a [PoolStringArray] containing the name of all nodes.
  166. </description>
  167. </method>
  168. <method name="mix_node_get_amount" qualifiers="const">
  169. <return type="float" />
  170. <argument index="0" name="id" type="String" />
  171. <description>
  172. Returns the mix amount of a Mix node given its name.
  173. </description>
  174. </method>
  175. <method name="mix_node_set_amount">
  176. <return type="void" />
  177. <argument index="0" name="id" type="String" />
  178. <argument index="1" name="ratio" type="float" />
  179. <description>
  180. Sets the mix amount of a Mix node given its name and value.
  181. A Mix node adds input b to input a by the amount given by ratio.
  182. </description>
  183. </method>
  184. <method name="node_exists" qualifiers="const">
  185. <return type="bool" />
  186. <argument index="0" name="node" type="String" />
  187. <description>
  188. Check if a node exists (by name).
  189. </description>
  190. </method>
  191. <method name="node_get_input_count" qualifiers="const">
  192. <return type="int" />
  193. <argument index="0" name="id" type="String" />
  194. <description>
  195. Returns the input count for a given node. Different types of nodes have different amount of inputs.
  196. </description>
  197. </method>
  198. <method name="node_get_input_source" qualifiers="const">
  199. <return type="String" />
  200. <argument index="0" name="id" type="String" />
  201. <argument index="1" name="idx" type="int" />
  202. <description>
  203. Returns the input source for a given node input.
  204. </description>
  205. </method>
  206. <method name="node_get_position" qualifiers="const">
  207. <return type="Vector2" />
  208. <argument index="0" name="id" type="String" />
  209. <description>
  210. Returns position of a node in the graph given its name.
  211. </description>
  212. </method>
  213. <method name="node_get_type" qualifiers="const">
  214. <return type="int" enum="AnimationTreePlayer.NodeType" />
  215. <argument index="0" name="id" type="String" />
  216. <description>
  217. Gets the node type, will return from [enum NodeType] enum.
  218. </description>
  219. </method>
  220. <method name="node_rename">
  221. <return type="int" enum="Error" />
  222. <argument index="0" name="node" type="String" />
  223. <argument index="1" name="new_name" type="String" />
  224. <description>
  225. Renames a node in the graph.
  226. </description>
  227. </method>
  228. <method name="node_set_position">
  229. <return type="void" />
  230. <argument index="0" name="id" type="String" />
  231. <argument index="1" name="screen_position" type="Vector2" />
  232. <description>
  233. Sets the position of a node in the graph given its name and position.
  234. </description>
  235. </method>
  236. <method name="oneshot_node_get_autorestart_delay" qualifiers="const">
  237. <return type="float" />
  238. <argument index="0" name="id" type="String" />
  239. <description>
  240. Returns the autostart delay of a OneShot node given its name.
  241. </description>
  242. </method>
  243. <method name="oneshot_node_get_autorestart_random_delay" qualifiers="const">
  244. <return type="float" />
  245. <argument index="0" name="id" type="String" />
  246. <description>
  247. Returns the autostart random delay of a OneShot node given its name.
  248. </description>
  249. </method>
  250. <method name="oneshot_node_get_fadein_time" qualifiers="const">
  251. <return type="float" />
  252. <argument index="0" name="id" type="String" />
  253. <description>
  254. Returns the fade in time of a OneShot node given its name.
  255. </description>
  256. </method>
  257. <method name="oneshot_node_get_fadeout_time" qualifiers="const">
  258. <return type="float" />
  259. <argument index="0" name="id" type="String" />
  260. <description>
  261. Returns the fade out time of a OneShot node given its name.
  262. </description>
  263. </method>
  264. <method name="oneshot_node_has_autorestart" qualifiers="const">
  265. <return type="bool" />
  266. <argument index="0" name="id" type="String" />
  267. <description>
  268. Returns whether a OneShot node will auto restart given its name.
  269. </description>
  270. </method>
  271. <method name="oneshot_node_is_active" qualifiers="const">
  272. <return type="bool" />
  273. <argument index="0" name="id" type="String" />
  274. <description>
  275. Returns whether a OneShot node is active given its name.
  276. </description>
  277. </method>
  278. <method name="oneshot_node_set_autorestart">
  279. <return type="void" />
  280. <argument index="0" name="id" type="String" />
  281. <argument index="1" name="enable" type="bool" />
  282. <description>
  283. Sets the autorestart property of a OneShot node given its name and value.
  284. </description>
  285. </method>
  286. <method name="oneshot_node_set_autorestart_delay">
  287. <return type="void" />
  288. <argument index="0" name="id" type="String" />
  289. <argument index="1" name="delay_sec" type="float" />
  290. <description>
  291. Sets the autorestart delay of a OneShot node given its name and value in seconds.
  292. </description>
  293. </method>
  294. <method name="oneshot_node_set_autorestart_random_delay">
  295. <return type="void" />
  296. <argument index="0" name="id" type="String" />
  297. <argument index="1" name="rand_sec" type="float" />
  298. <description>
  299. Sets the autorestart random delay of a OneShot node given its name and value in seconds.
  300. </description>
  301. </method>
  302. <method name="oneshot_node_set_fadein_time">
  303. <return type="void" />
  304. <argument index="0" name="id" type="String" />
  305. <argument index="1" name="time_sec" type="float" />
  306. <description>
  307. Sets the fade in time of a OneShot node given its name and value in seconds.
  308. </description>
  309. </method>
  310. <method name="oneshot_node_set_fadeout_time">
  311. <return type="void" />
  312. <argument index="0" name="id" type="String" />
  313. <argument index="1" name="time_sec" type="float" />
  314. <description>
  315. Sets the fade out time of a OneShot node given its name and value in seconds.
  316. </description>
  317. </method>
  318. <method name="oneshot_node_set_filter_path">
  319. <return type="void" />
  320. <argument index="0" name="id" type="String" />
  321. <argument index="1" name="path" type="NodePath" />
  322. <argument index="2" name="enable" type="bool" />
  323. <description>
  324. If [code]enable[/code] is [code]true[/code], the OneShot node with ID [code]id[/code] turns off the track modifying the property at [code]path[/code]. The modified node's children continue to animate.
  325. </description>
  326. </method>
  327. <method name="oneshot_node_start">
  328. <return type="void" />
  329. <argument index="0" name="id" type="String" />
  330. <description>
  331. Starts a OneShot node given its name.
  332. </description>
  333. </method>
  334. <method name="oneshot_node_stop">
  335. <return type="void" />
  336. <argument index="0" name="id" type="String" />
  337. <description>
  338. Stops the OneShot node with name [code]id[/code].
  339. </description>
  340. </method>
  341. <method name="recompute_caches">
  342. <return type="void" />
  343. <description>
  344. Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state.
  345. </description>
  346. </method>
  347. <method name="remove_node">
  348. <return type="void" />
  349. <argument index="0" name="id" type="String" />
  350. <description>
  351. Removes the animation node with name [code]id[/code].
  352. </description>
  353. </method>
  354. <method name="reset">
  355. <return type="void" />
  356. <description>
  357. Resets this [AnimationTreePlayer].
  358. </description>
  359. </method>
  360. <method name="timescale_node_get_scale" qualifiers="const">
  361. <return type="float" />
  362. <argument index="0" name="id" type="String" />
  363. <description>
  364. Returns the time scale value of the TimeScale node with name [code]id[/code].
  365. </description>
  366. </method>
  367. <method name="timescale_node_set_scale">
  368. <return type="void" />
  369. <argument index="0" name="id" type="String" />
  370. <argument index="1" name="scale" type="float" />
  371. <description>
  372. Sets the time scale of the TimeScale node with name [code]id[/code] to [code]scale[/code].
  373. The TimeScale node is used to speed [Animation]s up if the scale is above 1 or slow them down if it is below 1.
  374. If applied after a blend or mix, affects all input animations to that blend or mix.
  375. </description>
  376. </method>
  377. <method name="timeseek_node_seek">
  378. <return type="void" />
  379. <argument index="0" name="id" type="String" />
  380. <argument index="1" name="seconds" type="float" />
  381. <description>
  382. Sets the time seek value of the TimeSeek node with name [code]id[/code] to [code]seconds[/code].
  383. This functions as a seek in the [Animation] or the blend or mix of [Animation]s input in it.
  384. </description>
  385. </method>
  386. <method name="transition_node_delete_input">
  387. <return type="void" />
  388. <argument index="0" name="id" type="String" />
  389. <argument index="1" name="input_idx" type="int" />
  390. <description>
  391. Deletes the input at [code]input_idx[/code] for the transition node with name [code]id[/code].
  392. </description>
  393. </method>
  394. <method name="transition_node_get_current" qualifiers="const">
  395. <return type="int" />
  396. <argument index="0" name="id" type="String" />
  397. <description>
  398. Returns the index of the currently evaluated input for the transition node with name [code]id[/code].
  399. </description>
  400. </method>
  401. <method name="transition_node_get_input_count" qualifiers="const">
  402. <return type="int" />
  403. <argument index="0" name="id" type="String" />
  404. <description>
  405. Returns the number of inputs for the transition node with name [code]id[/code]. You can add inputs by right-clicking on the transition node.
  406. </description>
  407. </method>
  408. <method name="transition_node_get_xfade_time" qualifiers="const">
  409. <return type="float" />
  410. <argument index="0" name="id" type="String" />
  411. <description>
  412. Returns the cross fade time for the transition node with name [code]id[/code].
  413. </description>
  414. </method>
  415. <method name="transition_node_has_input_auto_advance" qualifiers="const">
  416. <return type="bool" />
  417. <argument index="0" name="id" type="String" />
  418. <argument index="1" name="input_idx" type="int" />
  419. <description>
  420. Returns [code]true[/code] if the input at [code]input_idx[/code] on the transition node with name [code]id[/code] is set to automatically advance to the next input upon completion.
  421. </description>
  422. </method>
  423. <method name="transition_node_set_current">
  424. <return type="void" />
  425. <argument index="0" name="id" type="String" />
  426. <argument index="1" name="input_idx" type="int" />
  427. <description>
  428. The transition node with name [code]id[/code] sets its current input at [code]input_idx[/code].
  429. </description>
  430. </method>
  431. <method name="transition_node_set_input_auto_advance">
  432. <return type="void" />
  433. <argument index="0" name="id" type="String" />
  434. <argument index="1" name="input_idx" type="int" />
  435. <argument index="2" name="enable" type="bool" />
  436. <description>
  437. The transition node with name [code]id[/code] advances to its next input automatically when the input at [code]input_idx[/code] completes.
  438. </description>
  439. </method>
  440. <method name="transition_node_set_input_count">
  441. <return type="void" />
  442. <argument index="0" name="id" type="String" />
  443. <argument index="1" name="count" type="int" />
  444. <description>
  445. Resizes the number of inputs available for the transition node with name [code]id[/code].
  446. </description>
  447. </method>
  448. <method name="transition_node_set_xfade_time">
  449. <return type="void" />
  450. <argument index="0" name="id" type="String" />
  451. <argument index="1" name="time_sec" type="float" />
  452. <description>
  453. The transition node with name [code]id[/code] sets its cross fade time to [code]time_sec[/code].
  454. </description>
  455. </method>
  456. </methods>
  457. <members>
  458. <member name="active" type="bool" setter="set_active" getter="is_active" default="false">
  459. If [code]true[/code], the [AnimationTreePlayer] is able to play animations.
  460. </member>
  461. <member name="base_path" type="NodePath" setter="set_base_path" getter="get_base_path" default="NodePath(&quot;..&quot;)">
  462. The node from which to relatively access other nodes.
  463. It accesses the bones, so it should point to the same node the [AnimationPlayer] would point its Root Node at.
  464. </member>
  465. <member name="master_player" type="NodePath" setter="set_master_player" getter="get_master_player" default="NodePath(&quot;&quot;)">
  466. The path to the [AnimationPlayer] from which this [AnimationTreePlayer] binds animations to animation nodes.
  467. Once set, [Animation] nodes can be added to the [AnimationTreePlayer].
  468. </member>
  469. <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" enum="AnimationTreePlayer.AnimationProcessMode" default="1">
  470. The thread in which to update animations.
  471. </member>
  472. </members>
  473. <constants>
  474. <constant name="NODE_OUTPUT" value="0" enum="NodeType">
  475. Output node.
  476. </constant>
  477. <constant name="NODE_ANIMATION" value="1" enum="NodeType">
  478. Animation node.
  479. </constant>
  480. <constant name="NODE_ONESHOT" value="2" enum="NodeType">
  481. OneShot node.
  482. </constant>
  483. <constant name="NODE_MIX" value="3" enum="NodeType">
  484. Mix node.
  485. </constant>
  486. <constant name="NODE_BLEND2" value="4" enum="NodeType">
  487. Blend2 node.
  488. </constant>
  489. <constant name="NODE_BLEND3" value="5" enum="NodeType">
  490. Blend3 node.
  491. </constant>
  492. <constant name="NODE_BLEND4" value="6" enum="NodeType">
  493. Blend4 node.
  494. </constant>
  495. <constant name="NODE_TIMESCALE" value="7" enum="NodeType">
  496. TimeScale node.
  497. </constant>
  498. <constant name="NODE_TIMESEEK" value="8" enum="NodeType">
  499. TimeSeek node.
  500. </constant>
  501. <constant name="NODE_TRANSITION" value="9" enum="NodeType">
  502. Transition node.
  503. </constant>
  504. <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessMode">
  505. Process animation during the physics process. This is especially useful when animating physics bodies.
  506. </constant>
  507. <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessMode">
  508. Process animation during the idle process.
  509. </constant>
  510. </constants>
  511. </class>