add_anim_state_machine
Add a named state machine node to an Animation Blueprint's top-level AnimGraph, mark it modified, and save without compiling; duplicate names return the existing node unchanged.
Instructions
Add a state machine node named machine_name to the top-level AnimGraph of an Animation Blueprint, then mark the blueprint structurally modified and save it without compiling (compile_anim_blueprint gives runtime effect). Idempotent by name: an existing machine is returned unchanged (already_existed true). The node starts with only its entry and is not connected to the Output Pose: wire it with connect_anim_graph_pins, fill it with add_anim_state, add_anim_conduit and add_anim_transition, or build it in one call with build_animation_state_machine. Refused while PIE runs unless force=true; a failed save is an error, the change kept in memory.
Returns: { anim_blueprint_path: string, machine_name: string, node_class: string, state_machine_graph: string, state_machine_created: bool, already_existed: bool, saved: bool, state_machine_count: int, save_error?: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| machine_name | Yes | Name for the new state machine | |
| blueprint_name | No | Alias of `anim_blueprint_path` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `anim_blueprint_path`. | |
| anim_blueprint_path | No | Path to the UAnimBlueprint asset |