generate_state_machine
Add an AnimationNodeStateMachine sub-resource block directly into a .tscn file, defining visual state blocks and transitions without opening the Godot editor. Use this tool to automate state machine setup for animations in your scene.
Instructions
State Machine Graph Generator: Inject an AnimationNodeStateMachine sub-resource block into a .tscn file -- define visual state blocks without opening the editor.
Each state dict must have:
'name': state name (e.g. 'Idle')
'animation': animation clip name (e.g. 'idle')
'position': optional [x, y] graph layout coordinates
Args: scene_path: Absolute path to the .tscn scene file. node_name: Name for the AnimationTree node (e.g. 'AnimationTree'). states: List of state definition dicts. anim_player_path: NodePath to the AnimationPlayer. start_state: Start state name (defaults to first state).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| states | Yes | ||
| node_name | Yes | ||
| scene_path | Yes | ||
| start_state | No | ||
| anim_player_path | No | AnimationPlayer |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |