← All guides

How to Export a Godot 4 SpriteFrames (.tres) from SpritePilot

5 min read · Updated October 2026

Godot 4 is the one engine SpritePilot can hand a finished resource: the "SpriteFrames" export is a .tres file holding every frame and one animation per tag, ready for an AnimatedSprite2D. This guide covers the export settings, where the two files go, and the Godot JSON alternative for your own scripts. Playing, switching and flipping the animations from GDScript is covered in the Godot animation article linked at the end.

Open Export & Download — free, in your browser, no signup.

Path A — a SpriteFrames .tres (recommended)

  1. Put the frames in play order. Get your frames into SpritePilot (with Grid Slice, "Send to Export & Download" in the GIF or video converter, or "Send to Session" in the Pixel Art Editor) and open Export & Download. The .tres keeps the export order, so check it under "Rename & Reorder Sprites" and fix it with the arrow buttons. Names don’t matter for this format: the .tres doesn’t store them.
  2. Add one tag per animation. Open "Animation Tags", click "Add Tag", and give each animation a name and a frame range, for example idle 0–3, hop 4–9 and attack 10–14. Ranges count from 0, while the Rename & Reorder list numbers frames from 1. Each tag becomes a named animation; with no tags you get one animation called "default" with every frame.
  3. Choose SpriteFrames and download. Choose PNG, keep "Export metadata file" ticked, pick "SpriteFrames" (Godot 4 .tres resource) and click "Download Sprite Sheet". You get sprite-sheet.png and sprite-frames.tres. Any layout works, and so do "Trim transparency", "Padding" and "Extrude": every frame is an AtlasTexture pointing at its own rectangle, and trimmed frames get a margin that restores their original size.
  4. Copy both files into the project root. The .tres looks for its texture at res://sprite-sheet.png, so put both files in your project’s root folder and keep the sheet’s file name. Prefer a subfolder? Open the .tres in a text editor and change the path on the ext_resource line near the top.
  5. Load it into an AnimatedSprite2D. Add an AnimatedSprite2D node and drag sprite-frames.tres from the FileSystem dock onto its "Sprite Frames" property in the Inspector. Your animations appear in the SpriteFrames panel at the bottom of the editor.
  6. Set speed and looping. Every animation arrives at 12 FPS, looping, with each frame’s duration at 1.0. Change the FPS in the SpriteFrames panel, and switch looping off for anything that should play once, such as an attack. A tag’s reverse or ping-pong direction isn’t carried into the file.

Path B — Godot JSON for your own scripts

The "Godot JSON" format (sprite-sheet.godot.json) lists each frame’s name from Rename & Reorder, its region in the sheet, its trim offset and original size, and the pivot from the "Pivot Point" picker; Animation Tags become an "animations" list. Godot doesn’t read it on its own, so it suits static sprites and your own import code. This builds one AtlasTexture per frame, keyed by name:

func _ready() -> void:
    var sheet: Texture2D = load("res://sprite-sheet.png")
    var data: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://sprite-sheet.godot.json"))
    var textures := {}
    for f in data["frames"]:
        var r: Dictionary = f["region"]
        var tex := AtlasTexture.new()
        tex.atlas = sheet
        tex.region = Rect2(r["x"], r["y"], r["w"], r["h"])
        if f["trimmed"]:
            # put back the border that Trim transparency cut off
            var o: Dictionary = f["offset"]
            var s: Dictionary = f["sourceSize"]
            tex.margin = Rect2(o["x"], o["y"], s["w"] - r["w"], s["h"] - r["h"])
        textures[f["name"]] = tex
    $Sprite2D.texture = textures["walk_0001"]  # a Sprite2D child node

Tips

Go deeper

Related guides