Animation
animationBuild AnimationPlayer keyframe tracks, SpriteFrames from sprite sheets, and AnimationTree state machines in one call; all edits undoable.
Instructions
Animate anything: build AnimationPlayer animations with all tracks and keys in one call (property tweens, method calls, sounds, 3D transforms), SpriteFrames for AnimatedSprite2D/3D from image files or a sliced sprite sheet, and AnimationTree state machines / blend spaces / blend trees with transitions and conditions. All edits are undoable.
Actions:
create: {name ('walk' or 'lib/walk'), tracks: [{type?=value, path: 'Sprite2D:modulate', keys: [{time, value, easing?}]}], length? (default: last key time), loop?: none|linear|pingpong|true, path? (AnimationPlayer; created if it doesn't exist), parent?/player? (where/what to name a new player), library?='', autoplay?, reset?=true (key the current values of animated properties into the default library's RESET animation, like the editor does; the editor applies RESET before saving so previews/AnimationTrees don't leak into the scene), step?, validate?=true, overwrite?=true} build a complete animation; adds an AnimationPlayer when the scene has none. Values: '#ff0000', [x,y], numbers, 'res://tex.png'. 2D 'rotation' is radians (or animate 'rotation_degrees'). Call methods with a method track: {type: 'method', path: 'Player', keys: [{time, method, args}]}.
list: {path?} animations (length, loop, track summary) of one player, or of every AnimationPlayer in the scene.
get: {path?, name} full tracks and keys of an animation.
edit: {path?, name, length?, loop?, step?} change animation settings.
add_track: {path?, name, tracks: [{type, path, keys}]} (or track: {...}) add tracks to an existing animation; extends length to fit keys (extend?=true); reset?=true adds missing RESET tracks.
set_keys: {path?, name, track: index|'Sprite2D:modulate', keys: [...], replace?=true} replace a track's keys (replace=false merges, overwriting keys at the same time).
remove_track: {path?, name, track: index|path}
delete: {path?, name} delete an animation.
rename: {path?, name, new_name}
set_autoplay: {path?, name} play this animation when the scene starts (name='' clears).
sprite_frames: {path: AnimatedSprite2D/3D node or res://frames.tres, animations: {name: {frames: ['res://run_1.png', 'res://run_*.png', {texture, duration}] | sheet: {texture, hframes, vframes, row? | frames?: [indices] | start?/count?, frame_size?: [w,h], margin?, separation?}, fps?=10, loop?=true|false|pingpong}}, autoplay? (animation name, or true = the first one), play? (animation shown in the editor), replace? (default merges into existing frames), save_path?} create SpriteFrames and assign it (sheets are sliced into AtlasTextures). If the sprite already uses a SpriteFrames .tres file, that file is updated.
tree: {path? (AnimationTree; created if missing) | parent?+name?, anim_player? (default: the only AnimationPlayer), type?=state_machine|blend_space_1d|blend_space_2d|blend_tree, states: ['idle', {name, animation?} | {name, type: blend_space_2d, blend_points}], transitions: [{from (name, list or '*'), to, condition?, expression?, switch_mode?: immediate|sync|at_end, auto?, xfade?, priority?}], start?, blend_points?: [{animation, pos: number|[x,y]}], min_space?, max_space?, nodes?/connections? (blend_tree: [{name, type: animation|blend2|blend3|add2|sub2|one_shot|time_scale|time_seek|transition, animation?, inputs? (transition: ['idle', 'run']), props?}], [{from, to: name|'output', port?: index or input name}]), parameters?: {'conditions/moving': false, 'shot/request': 'fire'}, props? (AnimationTree node props), active?=true, reset?=true (add missing RESET tracks so the tree playing in the editor can't leak its pose into the saved scene)} build a complete AnimationTree in one call; replaces the tree_root of an existing tree.
tree_info: {path?} describe an AnimationTree: states, transitions, blend points, settable parameters, problems (missing animations).
set_parameter: {path?, name: 'conditions/moving' | 'blend_position' | 'shot/request' (fire|abort|fade_out) | 'state/transition_request', value} or {parameters: {name: value}} set AnimationTree parameters (in game code: $AnimationTree.set('parameters/conditions/moving', true)).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | Keys [{time, value, easing?}] (method: {time, method, args}). | |
| loop | No | none | linear | pingpong (true = linear). | |
| name | No | Animation name ('walk' or 'library/walk'); for tree: the new AnimationTree's name. | |
| path | No | AnimationPlayer / AnimationTree / AnimatedSprite node path (or res://*.tres for sprite_frames). Optional when the scene has exactly one player/tree. | |
| play | No | sprite_frames: animation the sprite shows in the editor. | |
| step | No | Keyframe snap step in seconds. | |
| type | No | Track type filter (set_keys/remove_track), or AnimationTree root type (tree). | |
| nodes | No | tree (blend_tree): [{name, type, animation?, props?}]. | |
| props | No | tree: properties of the AnimationTree node itself, e.g. {callback_mode_process: 'physics'}. | |
| reset | No | create/add_track/tree: add missing RESET tracks with the current property values (default true). | |
| scene | No | res:// scene to operate on; opened in the editor if needed. Defaults to the currently edited scene. | |
| start | No | tree: start state (default: the first state). | |
| track | No | add_track: a track object. set_keys/remove_track: track index or path. | |
| value | No | ||
| action | Yes | What to do. See the tool description for each action's parameters. | |
| active | No | tree: AnimationTree.active (default true). | |
| extend | No | Extend the animation length to fit new keys (default true). | |
| length | No | Animation length in seconds. | |
| parent | No | Parent node for a new AnimationPlayer / AnimationTree. | |
| player | No | Name for a new AnimationPlayer (create). | |
| states | No | tree: states ['idle', 'run'] or [{name, animation?, type?, blend_points?}]. | |
| tracks | No | Tracks to build. | |
| library | No | Animation library name (default '' = the player's default library). | |
| replace | No | set_keys: replace all keys (default true). sprite_frames: start from empty SpriteFrames. | |
| autoplay | No | create: true to autoplay this animation. sprite_frames: animation name to autoplay (true = the first one). | |
| new_name | No | New animation name (rename). | |
| validate | No | Check that track nodes/properties exist (default true). | |
| max_space | No | Blend space maximum (number or [x,y]); default from the points. | |
| min_space | No | Blend space minimum (number or [x,y]); default from the points. | |
| overwrite | No | create: replace an existing animation of the same name (default true). | |
| save_path | No | sprite_frames: also save the SpriteFrames as this res:// .tres. | |
| animations | No | sprite_frames: {name: {frames | sheet, fps?, loop?}}. | |
| parameters | No | tree/set_parameter: {parameter: value}, e.g. {'conditions/moving': true, 'move/blend_position': [1, 0]}. | |
| root_props | No | tree: properties of the root AnimationNode (e.g. a state machine's allow_transition_to_self). | |
| anim_player | No | tree: AnimationPlayer node path (relative to the scene root). | |
| connections | No | tree (blend_tree): [{from, to, port?}] ('output' is the final node). | |
| transitions | No | tree: [{from, to, condition?, expression?, switch_mode?, auto?, xfade?}]. | |
| blend_points | No | tree: blend space points [{animation, pos}]. |