class_animationtree.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AnimationTree.xml.
  6. .. _class_AnimationTree:
  7. AnimationTree
  8. =============
  9. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
  15. \ **Note:** When linked with an :ref:`AnimationPlayer<class_AnimationPlayer>`, several properties and methods of the corresponding :ref:`AnimationPlayer<class_AnimationPlayer>` will not function as expected. Playback and transitions should be handled using only the **AnimationTree** and its constituent :ref:`AnimationNode<class_AnimationNode>`\ (s). The :ref:`AnimationPlayer<class_AnimationPlayer>` node should be used solely for adding, deleting, and editing animations.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using AnimationTree <../tutorials/animation/animation_tree>`
  20. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
  27. | :ref:`bool<class_bool>` | :ref:`active<class_AnimationTree_property_active>` | ``false`` |
  28. +----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
  29. | :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
  30. +----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
  31. | :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` | :ref:`process_mode<class_AnimationTree_property_process_mode>` | ``1`` |
  32. +----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
  33. | :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` | ``NodePath("")`` |
  34. +----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
  35. | :ref:`AnimationNode<class_AnimationNode>` | :ref:`tree_root<class_AnimationTree_property_tree_root>` | |
  36. +----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`advance<class_AnimationTree_method_advance>` **(** :ref:`float<class_float>` delta **)** |
  44. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Transform<class_Transform>` | :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` **(** **)** |const| |
  46. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`rename_parameter<class_AnimationTree_method_rename_parameter>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)** |
  48. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. .. rst-class:: classref-section-separator
  50. ----
  51. .. rst-class:: classref-descriptions-group
  52. Enumerations
  53. ------------
  54. .. _enum_AnimationTree_AnimationProcessMode:
  55. .. rst-class:: classref-enumeration
  56. enum **AnimationProcessMode**:
  57. .. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS:
  58. .. rst-class:: classref-enumeration-constant
  59. :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **ANIMATION_PROCESS_PHYSICS** = ``0``
  60. The animations will progress during the physics frame (i.e. :ref:`Node._physics_process<class_Node_method__physics_process>`).
  61. .. _class_AnimationTree_constant_ANIMATION_PROCESS_IDLE:
  62. .. rst-class:: classref-enumeration-constant
  63. :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **ANIMATION_PROCESS_IDLE** = ``1``
  64. The animations will progress during the idle frame (i.e. :ref:`Node._process<class_Node_method__process>`).
  65. .. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL:
  66. .. rst-class:: classref-enumeration-constant
  67. :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **ANIMATION_PROCESS_MANUAL** = ``2``
  68. The animations will only progress manually (see :ref:`advance<class_AnimationTree_method_advance>`).
  69. .. rst-class:: classref-section-separator
  70. ----
  71. .. rst-class:: classref-descriptions-group
  72. Property Descriptions
  73. ---------------------
  74. .. _class_AnimationTree_property_active:
  75. .. rst-class:: classref-property
  76. :ref:`bool<class_bool>` **active** = ``false``
  77. .. rst-class:: classref-property-setget
  78. - void **set_active** **(** :ref:`bool<class_bool>` value **)**
  79. - :ref:`bool<class_bool>` **is_active** **(** **)**
  80. If ``true``, the **AnimationTree** will be processing.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_AnimationTree_property_anim_player:
  84. .. rst-class:: classref-property
  85. :ref:`NodePath<class_NodePath>` **anim_player** = ``NodePath("")``
  86. .. rst-class:: classref-property-setget
  87. - void **set_animation_player** **(** :ref:`NodePath<class_NodePath>` value **)**
  88. - :ref:`NodePath<class_NodePath>` **get_animation_player** **(** **)**
  89. The path to the :ref:`AnimationPlayer<class_AnimationPlayer>` used for animating.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_AnimationTree_property_process_mode:
  93. .. rst-class:: classref-property
  94. :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **process_mode** = ``1``
  95. .. rst-class:: classref-property-setget
  96. - void **set_process_mode** **(** :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` value **)**
  97. - :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **get_process_mode** **(** **)**
  98. The process mode of this **AnimationTree**. See :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` for available modes.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_AnimationTree_property_root_motion_track:
  102. .. rst-class:: classref-property
  103. :ref:`NodePath<class_NodePath>` **root_motion_track** = ``NodePath("")``
  104. .. rst-class:: classref-property-setget
  105. - void **set_root_motion_track** **(** :ref:`NodePath<class_NodePath>` value **)**
  106. - :ref:`NodePath<class_NodePath>` **get_root_motion_track** **(** **)**
  107. The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by ``":"``. For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
  108. If the track has type :ref:`Animation.TYPE_TRANSFORM<class_Animation_constant_TYPE_TRANSFORM>`, the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` and :ref:`RootMotionView<class_RootMotionView>`.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_AnimationTree_property_tree_root:
  112. .. rst-class:: classref-property
  113. :ref:`AnimationNode<class_AnimationNode>` **tree_root**
  114. .. rst-class:: classref-property-setget
  115. - void **set_tree_root** **(** :ref:`AnimationNode<class_AnimationNode>` value **)**
  116. - :ref:`AnimationNode<class_AnimationNode>` **get_tree_root** **(** **)**
  117. The root animation node of this **AnimationTree**. See :ref:`AnimationNode<class_AnimationNode>`.
  118. .. rst-class:: classref-section-separator
  119. ----
  120. .. rst-class:: classref-descriptions-group
  121. Method Descriptions
  122. -------------------
  123. .. _class_AnimationTree_method_advance:
  124. .. rst-class:: classref-method
  125. void **advance** **(** :ref:`float<class_float>` delta **)**
  126. Manually advance the animations by the specified time (in seconds).
  127. .. rst-class:: classref-item-separator
  128. ----
  129. .. _class_AnimationTree_method_get_root_motion_transform:
  130. .. rst-class:: classref-method
  131. :ref:`Transform<class_Transform>` **get_root_motion_transform** **(** **)** |const|
  132. Retrieve the motion of the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Transform<class_Transform>` that can be used elsewhere. If :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` is not a path to a track of type :ref:`Animation.TYPE_TRANSFORM<class_Animation_constant_TYPE_TRANSFORM>`, returns an identity transformation. See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_AnimationTree_method_rename_parameter:
  136. .. rst-class:: classref-method
  137. void **rename_parameter** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
  138. .. container:: contribute
  139. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  140. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  141. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  142. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  143. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`