AnimationNodeBlendSpace2D.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimationNodeBlendSpace2D" inherits="AnimationRootNode" version="3.4">
  3. <brief_description>
  4. Blends linearly between three [AnimationNode] of any type placed in a 2D space.
  5. </brief_description>
  6. <description>
  7. A resource to add to an [AnimationNodeBlendTree].
  8. This node allows you to blend linearly between three animations using a [Vector2] weight.
  9. You can add vertices to the blend space with [method add_blend_point] and automatically triangulate it by setting [member auto_triangles] to [code]true[/code]. Otherwise, use [method add_triangle] and [method remove_triangle] to create up the blend space by hand.
  10. </description>
  11. <tutorials>
  12. <link title="AnimationTree">https://docs.godotengine.org/en/3.3/tutorials/animation/animation_tree.html</link>
  13. <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
  14. </tutorials>
  15. <methods>
  16. <method name="add_blend_point">
  17. <return type="void">
  18. </return>
  19. <argument index="0" name="node" type="AnimationRootNode">
  20. </argument>
  21. <argument index="1" name="pos" type="Vector2">
  22. </argument>
  23. <argument index="2" name="at_index" type="int" default="-1">
  24. </argument>
  25. <description>
  26. Adds a new point that represents a [code]node[/code] at the position set by [code]pos[/code]. You can insert it at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array.
  27. </description>
  28. </method>
  29. <method name="add_triangle">
  30. <return type="void">
  31. </return>
  32. <argument index="0" name="x" type="int">
  33. </argument>
  34. <argument index="1" name="y" type="int">
  35. </argument>
  36. <argument index="2" name="z" type="int">
  37. </argument>
  38. <argument index="3" name="at_index" type="int" default="-1">
  39. </argument>
  40. <description>
  41. Creates a new triangle using three points [code]x[/code], [code]y[/code], and [code]z[/code]. Triangles can overlap. You can insert the triangle at a specific index using the [code]at_index[/code] argument. If you use the default value for [code]at_index[/code], the point is inserted at the end of the blend points array.
  42. </description>
  43. </method>
  44. <method name="get_blend_point_count" qualifiers="const">
  45. <return type="int">
  46. </return>
  47. <description>
  48. Returns the number of points in the blend space.
  49. </description>
  50. </method>
  51. <method name="get_blend_point_node" qualifiers="const">
  52. <return type="AnimationRootNode">
  53. </return>
  54. <argument index="0" name="point" type="int">
  55. </argument>
  56. <description>
  57. Returns the [AnimationRootNode] referenced by the point at index [code]point[/code].
  58. </description>
  59. </method>
  60. <method name="get_blend_point_position" qualifiers="const">
  61. <return type="Vector2">
  62. </return>
  63. <argument index="0" name="point" type="int">
  64. </argument>
  65. <description>
  66. Returns the position of the point at index [code]point[/code].
  67. </description>
  68. </method>
  69. <method name="get_triangle_count" qualifiers="const">
  70. <return type="int">
  71. </return>
  72. <description>
  73. Returns the number of triangles in the blend space.
  74. </description>
  75. </method>
  76. <method name="get_triangle_point">
  77. <return type="int">
  78. </return>
  79. <argument index="0" name="triangle" type="int">
  80. </argument>
  81. <argument index="1" name="point" type="int">
  82. </argument>
  83. <description>
  84. Returns the position of the point at index [code]point[/code] in the triangle of index [code]triangle[/code].
  85. </description>
  86. </method>
  87. <method name="remove_blend_point">
  88. <return type="void">
  89. </return>
  90. <argument index="0" name="point" type="int">
  91. </argument>
  92. <description>
  93. Removes the point at index [code]point[/code] from the blend space.
  94. </description>
  95. </method>
  96. <method name="remove_triangle">
  97. <return type="void">
  98. </return>
  99. <argument index="0" name="triangle" type="int">
  100. </argument>
  101. <description>
  102. Removes the triangle at index [code]triangle[/code] from the blend space.
  103. </description>
  104. </method>
  105. <method name="set_blend_point_node">
  106. <return type="void">
  107. </return>
  108. <argument index="0" name="point" type="int">
  109. </argument>
  110. <argument index="1" name="node" type="AnimationRootNode">
  111. </argument>
  112. <description>
  113. Changes the [AnimationNode] referenced by the point at index [code]point[/code].
  114. </description>
  115. </method>
  116. <method name="set_blend_point_position">
  117. <return type="void">
  118. </return>
  119. <argument index="0" name="point" type="int">
  120. </argument>
  121. <argument index="1" name="pos" type="Vector2">
  122. </argument>
  123. <description>
  124. Updates the position of the point at index [code]point[/code] on the blend axis.
  125. </description>
  126. </method>
  127. </methods>
  128. <members>
  129. <member name="auto_triangles" type="bool" setter="set_auto_triangles" getter="get_auto_triangles" default="true">
  130. If [code]true[/code], the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point].
  131. </member>
  132. <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" enum="AnimationNodeBlendSpace2D.BlendMode" default="0">
  133. Controls the interpolation between animations. See [enum BlendMode] constants.
  134. </member>
  135. <member name="max_space" type="Vector2" setter="set_max_space" getter="get_max_space" default="Vector2( 1, 1 )">
  136. The blend space's X and Y axes' upper limit for the points' position. See [method add_blend_point].
  137. </member>
  138. <member name="min_space" type="Vector2" setter="set_min_space" getter="get_min_space" default="Vector2( -1, -1 )">
  139. The blend space's X and Y axes' lower limit for the points' position. See [method add_blend_point].
  140. </member>
  141. <member name="snap" type="Vector2" setter="set_snap" getter="get_snap" default="Vector2( 0.1, 0.1 )">
  142. Position increment to snap to when moving a point.
  143. </member>
  144. <member name="x_label" type="String" setter="set_x_label" getter="get_x_label" default="&quot;x&quot;">
  145. Name of the blend space's X axis.
  146. </member>
  147. <member name="y_label" type="String" setter="set_y_label" getter="get_y_label" default="&quot;y&quot;">
  148. Name of the blend space's Y axis.
  149. </member>
  150. </members>
  151. <signals>
  152. <signal name="triangles_updated">
  153. <description>
  154. Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
  155. </description>
  156. </signal>
  157. </signals>
  158. <constants>
  159. <constant name="BLEND_MODE_INTERPOLATED" value="0" enum="BlendMode">
  160. The interpolation between animations is linear.
  161. </constant>
  162. <constant name="BLEND_MODE_DISCRETE" value="1" enum="BlendMode">
  163. The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations.
  164. </constant>
  165. <constant name="BLEND_MODE_DISCRETE_CARRY" value="2" enum="BlendMode">
  166. Similar to [constant BLEND_MODE_DISCRETE], but starts the new animation at the last animation's playback position.
  167. </constant>
  168. </constants>
  169. </class>