class_animationnodestatemachinetransition.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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/AnimationNodeStateMachineTransition.xml.
  6. .. _class_AnimationNodeStateMachineTransition:
  7. AnimationNodeStateMachineTransition
  8. ===================================
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Tutorials
  11. ---------
  12. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  13. Properties
  14. ----------
  15. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  16. | :ref:`StringName<class_StringName>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``&""`` |
  17. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  18. | :ref:`String<class_String>` | :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` | ``""`` |
  19. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  20. | :ref:`NodePath<class_NodePath>` | :ref:`advance_expression_base_node<class_AnimationNodeStateMachineTransition_property_advance_expression_base_node>` | ``NodePath("")`` |
  21. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  22. | :ref:`bool<class_bool>` | :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>` | ``false`` |
  23. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  24. | :ref:`bool<class_bool>` | :ref:`disabled<class_AnimationNodeStateMachineTransition_property_disabled>` | ``false`` |
  25. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  26. | :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
  27. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  28. | :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
  29. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  30. | :ref:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeStateMachineTransition_property_xfade_curve>` | |
  31. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  32. | :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
  33. +------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+------------------+
  34. Signals
  35. -------
  36. .. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed:
  37. - **advance_condition_changed** **(** **)**
  38. Emitted when :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is changed.
  39. Enumerations
  40. ------------
  41. .. _enum_AnimationNodeStateMachineTransition_SwitchMode:
  42. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
  43. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
  44. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
  45. enum **SwitchMode**:
  46. - **SWITCH_MODE_IMMEDIATE** = **0** --- Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
  47. - **SWITCH_MODE_SYNC** = **1** --- Switch to the next state immediately, but will seek the new state to the playback position of the old state.
  48. - **SWITCH_MODE_AT_END** = **2** --- Wait for the current state playback to end, then switch to the beginning of the next state animation.
  49. Property Descriptions
  50. ---------------------
  51. .. _class_AnimationNodeStateMachineTransition_property_advance_condition:
  52. - :ref:`StringName<class_StringName>` **advance_condition**
  53. +-----------+------------------------------+
  54. | *Default* | ``&""`` |
  55. +-----------+------------------------------+
  56. | *Setter* | set_advance_condition(value) |
  57. +-----------+------------------------------+
  58. | *Getter* | get_advance_condition() |
  59. +-----------+------------------------------+
  60. Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree<class_AnimationTree>` that can be controlled from code (see `Using AnimationTree <../tutorials/animation/animation_tree.html#controlling-from-code>`__). For example, if :ref:`AnimationTree.tree_root<class_AnimationTree_property_tree_root>` is an :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` and :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is set to ``"idle"``:
  61. .. tabs::
  62. .. code-tab:: gdscript
  63. $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
  64. .. code-tab:: csharp
  65. GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.x == 0));
  66. ----
  67. .. _class_AnimationNodeStateMachineTransition_property_advance_expression:
  68. - :ref:`String<class_String>` **advance_expression**
  69. +-----------+-------------------------------+
  70. | *Default* | ``""`` |
  71. +-----------+-------------------------------+
  72. | *Setter* | set_advance_expression(value) |
  73. +-----------+-------------------------------+
  74. | *Getter* | get_advance_expression() |
  75. +-----------+-------------------------------+
  76. Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code.
  77. ----
  78. .. _class_AnimationNodeStateMachineTransition_property_advance_expression_base_node:
  79. - :ref:`NodePath<class_NodePath>` **advance_expression_base_node**
  80. +-----------+-----------------------------------------+
  81. | *Default* | ``NodePath("")`` |
  82. +-----------+-----------------------------------------+
  83. | *Setter* | set_advance_expression_base_node(value) |
  84. +-----------+-----------------------------------------+
  85. | *Getter* | get_advance_expression_base_node() |
  86. +-----------+-----------------------------------------+
  87. The path to the :ref:`Node<class_Node>` used to evaluate an :ref:`Expression<class_Expression>` if one is not explicitly specified internally.
  88. ----
  89. .. _class_AnimationNodeStateMachineTransition_property_auto_advance:
  90. - :ref:`bool<class_bool>` **auto_advance**
  91. +-----------+-------------------------+
  92. | *Default* | ``false`` |
  93. +-----------+-------------------------+
  94. | *Setter* | set_auto_advance(value) |
  95. +-----------+-------------------------+
  96. | *Getter* | has_auto_advance() |
  97. +-----------+-------------------------+
  98. Turn on the transition automatically when this state is reached. This works best with :ref:`SWITCH_MODE_AT_END<class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END>`.
  99. ----
  100. .. _class_AnimationNodeStateMachineTransition_property_disabled:
  101. - :ref:`bool<class_bool>` **disabled**
  102. +-----------+---------------------+
  103. | *Default* | ``false`` |
  104. +-----------+---------------------+
  105. | *Setter* | set_disabled(value) |
  106. +-----------+---------------------+
  107. | *Getter* | is_disabled() |
  108. +-----------+---------------------+
  109. Don't use this transition during :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
  110. ----
  111. .. _class_AnimationNodeStateMachineTransition_property_priority:
  112. - :ref:`int<class_int>` **priority**
  113. +-----------+---------------------+
  114. | *Default* | ``1`` |
  115. +-----------+---------------------+
  116. | *Setter* | set_priority(value) |
  117. +-----------+---------------------+
  118. | *Getter* | get_priority() |
  119. +-----------+---------------------+
  120. Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
  121. ----
  122. .. _class_AnimationNodeStateMachineTransition_property_switch_mode:
  123. - :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode**
  124. +-----------+------------------------+
  125. | *Default* | ``0`` |
  126. +-----------+------------------------+
  127. | *Setter* | set_switch_mode(value) |
  128. +-----------+------------------------+
  129. | *Getter* | get_switch_mode() |
  130. +-----------+------------------------+
  131. The transition type.
  132. ----
  133. .. _class_AnimationNodeStateMachineTransition_property_xfade_curve:
  134. - :ref:`Curve<class_Curve>` **xfade_curve**
  135. +----------+------------------------+
  136. | *Setter* | set_xfade_curve(value) |
  137. +----------+------------------------+
  138. | *Getter* | get_xfade_curve() |
  139. +----------+------------------------+
  140. Ease curve for better control over cross-fade between this state and the next.
  141. ----
  142. .. _class_AnimationNodeStateMachineTransition_property_xfade_time:
  143. - :ref:`float<class_float>` **xfade_time**
  144. +-----------+-----------------------+
  145. | *Default* | ``0.0`` |
  146. +-----------+-----------------------+
  147. | *Setter* | set_xfade_time(value) |
  148. +-----------+-----------------------+
  149. | *Getter* | get_xfade_time() |
  150. +-----------+-----------------------+
  151. The time to cross-fade between this state and the next.
  152. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  153. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  154. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  155. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  156. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  157. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`