class_animationtree.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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. Description
  12. -----------
  13. A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
  14. \ **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.
  15. Tutorials
  16. ---------
  17. - :doc:`Using AnimationTree <../tutorials/animation/animation_tree>`
  18. - `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
  19. Properties
  20. ----------
  21. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  22. | :ref:`bool<class_bool>` | :ref:`active<class_AnimationTree_property_active>` | ``false`` |
  23. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  24. | :ref:`NodePath<class_NodePath>` | :ref:`advance_expression_base_node<class_AnimationTree_property_advance_expression_base_node>` | ``NodePath(".")`` |
  25. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  26. | :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
  27. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  28. | :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` | :ref:`process_callback<class_AnimationTree_property_process_callback>` | ``1`` |
  29. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  30. | :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` | ``NodePath("")`` |
  31. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  32. | :ref:`AnimationNode<class_AnimationNode>` | :ref:`tree_root<class_AnimationTree_property_tree_root>` | |
  33. +------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
  34. Methods
  35. -------
  36. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`advance<class_AnimationTree_method_advance>` **(** :ref:`float<class_float>` delta **)** |
  38. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` **(** **)** |const| |
  40. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`rename_parameter<class_AnimationTree_method_rename_parameter>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)** |
  42. +---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. Signals
  44. -------
  45. .. _class_AnimationTree_signal_animation_player_changed:
  46. - **animation_player_changed** **(** **)**
  47. Emitted when the :ref:`anim_player<class_AnimationTree_property_anim_player>` is changed.
  48. Enumerations
  49. ------------
  50. .. _enum_AnimationTree_AnimationProcessCallback:
  51. .. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS:
  52. .. _class_AnimationTree_constant_ANIMATION_PROCESS_IDLE:
  53. .. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL:
  54. enum **AnimationProcessCallback**:
  55. - **ANIMATION_PROCESS_PHYSICS** = **0** --- The animations will progress during the physics frame (i.e. :ref:`Node._physics_process<class_Node_method__physics_process>`).
  56. - **ANIMATION_PROCESS_IDLE** = **1** --- The animations will progress during the idle frame (i.e. :ref:`Node._process<class_Node_method__process>`).
  57. - **ANIMATION_PROCESS_MANUAL** = **2** --- The animations will only progress manually (see :ref:`advance<class_AnimationTree_method_advance>`).
  58. Property Descriptions
  59. ---------------------
  60. .. _class_AnimationTree_property_active:
  61. - :ref:`bool<class_bool>` **active**
  62. +-----------+-------------------+
  63. | *Default* | ``false`` |
  64. +-----------+-------------------+
  65. | *Setter* | set_active(value) |
  66. +-----------+-------------------+
  67. | *Getter* | is_active() |
  68. +-----------+-------------------+
  69. If ``true``, the ``AnimationTree`` will be processing.
  70. ----
  71. .. _class_AnimationTree_property_advance_expression_base_node:
  72. - :ref:`NodePath<class_NodePath>` **advance_expression_base_node**
  73. +-----------+-----------------------------------------+
  74. | *Default* | ``NodePath(".")`` |
  75. +-----------+-----------------------------------------+
  76. | *Setter* | set_advance_expression_base_node(value) |
  77. +-----------+-----------------------------------------+
  78. | *Getter* | get_advance_expression_base_node() |
  79. +-----------+-----------------------------------------+
  80. The path to the :ref:`Node<class_Node>` used to evaluate the AnimationNode :ref:`Expression<class_Expression>` if one is not explicitly specified internally.
  81. ----
  82. .. _class_AnimationTree_property_anim_player:
  83. - :ref:`NodePath<class_NodePath>` **anim_player**
  84. +-----------+-----------------------------+
  85. | *Default* | ``NodePath("")`` |
  86. +-----------+-----------------------------+
  87. | *Setter* | set_animation_player(value) |
  88. +-----------+-----------------------------+
  89. | *Getter* | get_animation_player() |
  90. +-----------+-----------------------------+
  91. The path to the :ref:`AnimationPlayer<class_AnimationPlayer>` used for animating.
  92. ----
  93. .. _class_AnimationTree_property_process_callback:
  94. - :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **process_callback**
  95. +-----------+-----------------------------+
  96. | *Default* | ``1`` |
  97. +-----------+-----------------------------+
  98. | *Setter* | set_process_callback(value) |
  99. +-----------+-----------------------------+
  100. | *Getter* | get_process_callback() |
  101. +-----------+-----------------------------+
  102. The process mode of this ``AnimationTree``. See :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` for available modes.
  103. ----
  104. .. _class_AnimationTree_property_root_motion_track:
  105. - :ref:`NodePath<class_NodePath>` **root_motion_track**
  106. +-----------+------------------------------+
  107. | *Default* | ``NodePath("")`` |
  108. +-----------+------------------------------+
  109. | *Setter* | set_root_motion_track(value) |
  110. +-----------+------------------------------+
  111. | *Getter* | get_root_motion_track() |
  112. +-----------+------------------------------+
  113. 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"``.
  114. If the track has type :ref:`Animation.TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`Animation.TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` or :ref:`Animation.TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` 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>`.
  115. ----
  116. .. _class_AnimationTree_property_tree_root:
  117. - :ref:`AnimationNode<class_AnimationNode>` **tree_root**
  118. +----------+----------------------+
  119. | *Setter* | set_tree_root(value) |
  120. +----------+----------------------+
  121. | *Getter* | get_tree_root() |
  122. +----------+----------------------+
  123. The root animation node of this ``AnimationTree``. See :ref:`AnimationNode<class_AnimationNode>`.
  124. Method Descriptions
  125. -------------------
  126. .. _class_AnimationTree_method_advance:
  127. - void **advance** **(** :ref:`float<class_float>` delta **)**
  128. Manually advance the animations by the specified time (in seconds).
  129. ----
  130. .. _class_AnimationTree_method_get_root_motion_transform:
  131. - :ref:`Transform3D<class_Transform3D>` **get_root_motion_transform** **(** **)** |const|
  132. Retrieve the motion of the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Transform3D<class_Transform3D>` 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_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`Animation.TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` or :ref:`Animation.TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>`, returns an identity transformation. See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
  133. ----
  134. .. _class_AnimationTree_method_rename_parameter:
  135. - void **rename_parameter** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
  136. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  137. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  138. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  139. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  140. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  141. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`