Rework StateMachine and nested StateMachine process

Breaking compatibility: If a StateMachineTransition is connected to a nested StateMachine prior to this, it is removed. Also, there was a feature to connect another StateMachine as the End of a StateMachine, which is also removed to avoid reference confusion. It was like a GoTo Statement, also further passing the same reference to the blending process, causing the blending calculation to break or causing some StateMachines to not work.
This commit is contained in:
Silc Renew
2023-02-18 11:02:28 +09:00
committed by Silc Lizard (Tokage) Renew
parent a7d0e18a31
commit 991e6e90ba
15 changed files with 1273 additions and 1158 deletions

View File

@@ -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>