build_sprite_frames
Create a Godot 4 SpriteFrames .tres resource from spritesheet atlas regions, defining animation names, frame rectangles, FPS, and loop settings for use in Godot projects.
Instructions
Create a Godot 4.x SpriteFrames .tres resource from atlas regions.
This writes a format=3 Godot 4 resource. The image must live inside
project_root because Godot needs a res:// URI. Each animation
becomes an entry in the SpriteFrames animations array, and each frame
becomes an AtlasTexture sub-resource referencing the image.
Args:
project_root: Absolute path to the Godot project directory (the folder
containing project.godot).
image_path: Path to the spritesheet. It may be absolute, relative to
the project root, or already written as res://.... It must be
inside project_root.
animations: List of animation dictionaries. Example:
[{"name": "idle", "fps": 10.0, "loop": True, "frames": [ {"x": 0, "y": 0, "w": 32, "h": 32}, {"x": 32, "y": 0, "w": 32, "h": 32}]}].
Every animation requires a unique name and a frames list.
fps defaults to 10.0 and loop defaults to true. An optional
per-frame duration defaults to 1.0; playback timing is normally
controlled by the animation speed.
output_tres: Destination .tres path. An absolute path or res:// URI
is recommended; a relative path is resolved against
project_root. Parent directories are created automatically.
Returns:
Metadata including the absolute output_tres path, the Godot
texture_path URI, load_steps, animation_count and
frame_count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| animations | Yes | ||
| image_path | Yes | ||
| output_tres | Yes | ||
| project_root | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||