Skip to content

Instantly share code, notes, and snippets.

@manuq
Created December 30, 2025 17:37
Show Gist options
  • Select an option

  • Save manuq/2381eb0ab1d7a2707608c9d246904b63 to your computer and use it in GitHub Desktop.

Select an option

Save manuq/2381eb0ab1d7a2707608c9d246904b63 to your computer and use it in GitHub Desktop.
--[[
Aseprite script to export all layers as sprite sheets.
]]
local spr = app.activeSprite
if not spr then
return print('No active sprite')
end
local path,title = spr.filename:match("^(.+[/\\])(.-).([^.]*)$")
for i,layer in ipairs(spr.layers) do
local fn = path .. title .. '-' .. layer.name
-- Ignore layers starting with "xxx":
if layer.name:find("^" .. "xxx") then
goto continue
end
app.command.ExportSpriteSheet{
ui=false,
recent=false,
askOverwrite=false,
type=SpriteSheetType.HORIZONTAL,
textureFilename=fn .. '.png',
-- mergeDuplicates=true,
layer=layer.name,
}
::continue::
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment