/godot-dev:godot-2d-spritesfrom godot-dev
Converts sprite frames (frames.json + PNGs) into Godot SpriteFrames resources and AnimatedSprite2D scenes. Handles sheet slicing, pivot alignment, pixel-art import settings, and animation metadata.
Ships in godot-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A frames/1 set becomes a SpriteFrames resource written as text, one animation per clip, and
an AnimatedSprite2D seated so the set's pivot (the feet) sits on the node's position.
| The situation | Read |
|---|---|
A frame folder with frames.json from codex-visual or sprite-from-video; "import these frames" | The conversion below, then reference/spriteframes.md §1-3 |
| The feet float or sink, the sprite jumps between animations, which way the pivot's y goes | reference/spriteframes.md §2 |
A hand-drawn grid sheet with no frames.json | reference/spriteframes.md §3 (--sheet) |
| Playing, chaining a one-shot into a loop, footstep frames, syncing a run cycle to speed | reference/spriteframes.md §5 |
Building the SpriteFrames inside Godot (runtime content, a tool script) | reference/spriteframes.md §6 · resources/sprite_frames_builder.gd |
Pixel art that blurs or shimmers; what the .import file can and cannot set | reference/pixel-art-import.md |
| How big the courier draws; one scale for every set of a character | reference/spriteframes.md §4 · reference/pixel-art-import.md §3 |
| Proving a conversion without a window | reference/spriteframes.md §7 |
| Draw order, y-sorting, 2D lights, outlines | godot-2d-rendering |
| Bones and weighted parts instead of frames | godot-2d-rig |
| Animation trees and state machines over the clips | godot-animation |
python3 scripts/frames_to_spriteframes.py \
game/art/courier/courier_run=run game/art/courier/courier_land=land \
--out game/art/courier/courier.tres --scene game/art/courier/courier.tscn --node-name Courier
It writes, beside --out, inside the Godot project:
| File | What it is |
|---|---|
courier.tres | the SpriteFrames: run at the run set's fps_hint, looping; land at its own, a one-shot. Each frame an AtlasTexture region of the sheet. Metadata pivot_px, box_px, core_height_px, pixel_block_px |
courier.png | every frame packed into one sheet (--layout files keeps one texture per PNG instead) |
courier.png.import | only for a pixel set and only when none exists: lossless, no mipmaps, 3D detection off |
courier.tscn | an AnimatedSprite2D node named Courier: centered = false, offset = -pivot_px, nearest filtering for a pixel set |
Then import the project once (godot --headless -l en --path game --import) so the sheet is a
texture Godot can load. The script needs no Godot itself; it reads PNGs with the standard library.
Exit codes: 0 written · 1 refused (a usage error, a stamp other than frames/1, a frames/1
file missing a required key, a failed producer verdict without --accept-failed, a frame off the
canvas, a texture outside the project, a files layout over two canvases) · 3 a missing or
unreadable file.
pivot_norm has its origin bottom-left, y
up. Godot textures are y down from the top-left, so pivot_px = (x * W, (1 - y) * H) and the
node gets offset = -pivot_px with centered = false. SpriteFrames has no per-animation
offset, so every animation in one resource must share a pivot: the atlas layout packs a mix of
canvases into one common box, the files layout refuses the mix.fps_hint is the animation speed; loop is the
loop mode; hold_last needs nothing more than loop: false, because a finished animation
stops on its last frame and holds it.verdict.ok is false was failed by its
own gate; it is refused until the set is fixed or --accept-failed says otherwise.path="courier.png", relative to the .tres, which
Godot resolves against the resource's folder; no uid= is written, so the files survive a
move inside the project..import file sets
compression, mipmaps and the 3D switch; nearest sampling is texture_filter = 1 on the node or
rendering/textures/canvas_textures/default_texture_filter=0 for the project.const SpriteFramesBuilder = preload("res://tools/sprite_frames_builder.gd")
@onready var courier: AnimatedSprite2D = $Courier
func swap_frames(frames: SpriteFrames) -> void:
SpriteFramesBuilder.seat(courier, frames) # re-applies the pivot from the metadata
func land() -> void:
courier.play(&"land")
await courier.animation_finished
courier.play(&"run")
scale.x = -1 on the courier's parent Node2D, which mirrors about the pivot.world_height / core_height_px, one factor for every set of the character.stop() returns to frame
0, pause() keeps the frame.Godot renders nothing headless, but the data can all be proved there:
.tres; animation names, frame counts, speeds and loops match the folders;AtlasTexture region is the box size, and AtlasTexture.get_image returns the source
frame's pixels (the pixel just above pivot_px is the one above the feet in every frame);offset is -pivot_px; a one-shot ends on its last frame with one
animation_finished.scripts/frames_to_spriteframes.py --selftest does exactly that in a temp project (it needs
GODOT_BIN): two frame folders with different canvases and asymmetric pivots, a grid sheet, the
pixel .import read back after --import, the in-engine builder, and every refusal's exit
code. Judge a Godot run by its sentinel line and the absence of ERROR: and SCRIPT ERROR:
lines, never by its exit code (Godot exits 0 after errors; godot-verify).
pivot_norm there and convert again.reference_core_height_px per character..tres is generated; changing a speed by hand is lost on the
next conversion. Change fps_hint at the source and convert again..import files beside the PNGs; never commit .godot/.| Need | Skill |
|---|---|
| The frames themselves: generating, keying, cutting a sheet into frames/1 | codex-visual |
| Loops cut from video into frames/1 | sprite-from-video |
| Draw order, y-sorting, 2D lights, shaders on sprites | godot-2d-rendering |
| Skeletal 2D from a layered character | godot-2d-rig |
| Animation trees, blending, state machines | godot-animation |
| Running Godot headless and trusting the result | godot-verify |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
godot, spriteframes, animated-sprite-2d, pixel-art, frame-animation
Other plugins' skills for the same job
28 skills in this plugin
/godot-2d-controllerMove a 2D character in Godot: CharacterBody2D jump, coyote time, jump buffer, slopes, one-way and moving platforms, top-down movement./godot-2d-renderingGodot 2D look: draw order, z_index and y-sort, CanvasLayer, 2D lights and shadows, canvas shaders, Parallax2D, pixel-perfect scaling./godot-2d-rigA layered 2D character into Godot: rig2d.json to Skeleton2D, Bone2D and weighted Polygon2D parts, cut-out animation, 2D IK.npx claudepluginhub tipoli5890/game-studio --plugin godot-dev