Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework for nested AnimationNodeStateMachine #75759

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/AnimationNode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<param index="0" name="time" type="float" />
<param index="1" name="seek" type="bool" />
<param index="2" name="is_external_seeking" type="bool" />
<param index="3" name="test_only" type="bool" />
<description>
When inheriting from [AnimationRootNode], implement this virtual method to run some code when this node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute.
Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
Expand Down Expand Up @@ -97,6 +98,7 @@
<param index="4" name="blend" type="float" />
<param index="5" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
<param index="6" name="sync" type="bool" default="true" />
<param index="7" name="test_only" type="bool" default="false" />
<description>
Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree]. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).
</description>
Expand All @@ -111,6 +113,7 @@
<param index="5" name="blend" type="float" />
<param index="6" name="filter" type="int" enum="AnimationNode.FilterAction" default="0" />
<param index="7" name="sync" type="bool" default="true" />
<param index="8" name="test_only" type="bool" default="false" />
<description>
Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition.
</description>
Expand Down
18 changes: 18 additions & 0 deletions doc/classes/AnimationNodeStateMachine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,23 @@
<member name="allow_transition_to_self" type="bool" setter="set_allow_transition_to_self" getter="is_allow_transition_to_self" default="false">
If [code]true[/code], allows teleport to the self state with [method AnimationNodeStateMachinePlayback.travel]. When the reset option is enabled in [method AnimationNodeStateMachinePlayback.travel], the animation is restarted. If [code]false[/code], nothing happens on the teleportation to the self state.
</member>
<member name="reset_ends" type="bool" setter="set_reset_ends" getter="are_ends_reset" default="false">
If [code]true[/code], treat the cross-fade to the start and end nodes as a blend with the RESET animation.
In most cases, when additional cross-fades are performed in the parent [AnimationNode] of the state machine, setting this property to [code]false[/code] and matching the cross-fade time of the parent [AnimationNode] and the state machine's start node and end node gives good results.
</member>
<member name="state_machine_type" type="int" setter="set_state_machine_type" getter="get_state_machine_type" enum="AnimationNodeStateMachine.StateMachineType" default="0">
This property can define the process of transitions for different use cases. See also [enum AnimationNodeStateMachine.StateMachineType].
</member>
</members>
<constants>
<constant name="STATE_MACHINE_TYPE_ROOT" value="0" enum="StateMachineType">
Seeking to the beginning is treated as playing from the start state. Transition to the end state is treated as exiting the state machine.
</constant>
<constant name="STATE_MACHINE_TYPE_NESTED" value="1" enum="StateMachineType">
Seeking to the beginning is treated as seeking to the beginning of the animation in the current state. Transition to the end state, or the absence of transitions in each state, is treated as exiting the state machine.
</constant>
<constant name="STATE_MACHINE_TYPE_GROUPED" value="2" enum="StateMachineType">
This is a grouped state machine that can be controlled from a parent state machine. It does not work on standalone. There must be a state machine with [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor.
</constant>
</constants>
</class>
Loading