2
0

class_animationnodestatemachinetransition.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. .. container:: contribute
  11. There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  12. .. rst-class:: classref-introduction-group
  13. Tutorials
  14. ---------
  15. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  22. | :ref:`StringName<class_StringName>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``&""`` |
  23. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  24. | :ref:`String<class_String>` | :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` | ``""`` |
  25. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  26. | :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` | :ref:`advance_mode<class_AnimationNodeStateMachineTransition_property_advance_mode>` | ``1`` |
  27. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  28. | :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
  29. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  30. | :ref:`bool<class_bool>` | :ref:`reset<class_AnimationNodeStateMachineTransition_property_reset>` | ``true`` |
  31. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  32. | :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
  33. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  34. | :ref:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeStateMachineTransition_property_xfade_curve>` | |
  35. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  36. | :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
  37. +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Signals
  42. -------
  43. .. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed:
  44. .. rst-class:: classref-signal
  45. **advance_condition_changed** **(** **)**
  46. Emitted when :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is changed.
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Enumerations
  51. ------------
  52. .. _enum_AnimationNodeStateMachineTransition_SwitchMode:
  53. .. rst-class:: classref-enumeration
  54. enum **SwitchMode**:
  55. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_IMMEDIATE** = ``0``
  58. Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
  59. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_SYNC** = ``1``
  62. Switch to the next state immediately, but will seek the new state to the playback position of the old state.
  63. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_AT_END** = ``2``
  66. Wait for the current state playback to end, then switch to the beginning of the next state animation.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _enum_AnimationNodeStateMachineTransition_AdvanceMode:
  70. .. rst-class:: classref-enumeration
  71. enum **AdvanceMode**:
  72. .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_DISABLED:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **ADVANCE_MODE_DISABLED** = ``0``
  75. Don't use this transition.
  76. .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_ENABLED:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **ADVANCE_MODE_ENABLED** = ``1``
  79. Only use this transition during :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>`.
  80. .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_AUTO:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **ADVANCE_MODE_AUTO** = ``2``
  83. Automatically use this transition if the :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` and :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` checks are true (if assigned).
  84. .. rst-class:: classref-section-separator
  85. ----
  86. .. rst-class:: classref-descriptions-group
  87. Property Descriptions
  88. ---------------------
  89. .. _class_AnimationNodeStateMachineTransition_property_advance_condition:
  90. .. rst-class:: classref-property
  91. :ref:`StringName<class_StringName>` **advance_condition** = ``&""``
  92. .. rst-class:: classref-property-setget
  93. - void **set_advance_condition** **(** :ref:`StringName<class_StringName>` value **)**
  94. - :ref:`StringName<class_StringName>` **get_advance_condition** **(** **)**
  95. 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"``:
  96. .. tabs::
  97. .. code-tab:: gdscript
  98. $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
  99. .. code-tab:: csharp
  100. GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0));
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_AnimationNodeStateMachineTransition_property_advance_expression:
  104. .. rst-class:: classref-property
  105. :ref:`String<class_String>` **advance_expression** = ``""``
  106. .. rst-class:: classref-property-setget
  107. - void **set_advance_expression** **(** :ref:`String<class_String>` value **)**
  108. - :ref:`String<class_String>` **get_advance_expression** **(** **)**
  109. 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.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_AnimationNodeStateMachineTransition_property_advance_mode:
  113. .. rst-class:: classref-property
  114. :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **advance_mode** = ``1``
  115. .. rst-class:: classref-property-setget
  116. - void **set_advance_mode** **(** :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` value **)**
  117. - :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **get_advance_mode** **(** **)**
  118. Determines whether the transition should disabled, enabled when using :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>`, or traversed automatically if the :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` and :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` checks are true (if assigned).
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_AnimationNodeStateMachineTransition_property_priority:
  122. .. rst-class:: classref-property
  123. :ref:`int<class_int>` **priority** = ``1``
  124. .. rst-class:: classref-property-setget
  125. - void **set_priority** **(** :ref:`int<class_int>` value **)**
  126. - :ref:`int<class_int>` **get_priority** **(** **)**
  127. Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`advance_mode<class_AnimationNodeStateMachineTransition_property_advance_mode>` is set to :ref:`ADVANCE_MODE_AUTO<class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_AUTO>`.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_AnimationNodeStateMachineTransition_property_reset:
  131. .. rst-class:: classref-property
  132. :ref:`bool<class_bool>` **reset** = ``true``
  133. .. rst-class:: classref-property-setget
  134. - void **set_reset** **(** :ref:`bool<class_bool>` value **)**
  135. - :ref:`bool<class_bool>` **is_reset** **(** **)**
  136. If ``true``, the destination animation is played back from the beginning when switched.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_AnimationNodeStateMachineTransition_property_switch_mode:
  140. .. rst-class:: classref-property
  141. :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode** = ``0``
  142. .. rst-class:: classref-property-setget
  143. - void **set_switch_mode** **(** :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` value **)**
  144. - :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **get_switch_mode** **(** **)**
  145. The transition type.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_AnimationNodeStateMachineTransition_property_xfade_curve:
  149. .. rst-class:: classref-property
  150. :ref:`Curve<class_Curve>` **xfade_curve**
  151. .. rst-class:: classref-property-setget
  152. - void **set_xfade_curve** **(** :ref:`Curve<class_Curve>` value **)**
  153. - :ref:`Curve<class_Curve>` **get_xfade_curve** **(** **)**
  154. Ease curve for better control over cross-fade between this state and the next.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_AnimationNodeStateMachineTransition_property_xfade_time:
  158. .. rst-class:: classref-property
  159. :ref:`float<class_float>` **xfade_time** = ``0.0``
  160. .. rst-class:: classref-property-setget
  161. - void **set_xfade_time** **(** :ref:`float<class_float>` value **)**
  162. - :ref:`float<class_float>` **get_xfade_time** **(** **)**
  163. The time to cross-fade between this state and the next.
  164. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  165. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  166. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  167. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  168. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  169. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`