Skip to content

Instantly share code, notes, and snippets.

@dacap
Created January 4, 2020 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacap/ecd88cbd235ff496f861f22d34723889 to your computer and use it in GitHub Desktop.
Save dacap/ecd88cbd235ff496f861f22d34723889 to your computer and use it in GitHub Desktop.
Save each cel/layer of the file in its own file
local sprite = app.activeSprite
for _,layer in ipairs(sprite.layers) do
local cel = layer.cels[1]
if cel then
cel.image:saveAs('layer-' .. cel.layer.name .. '.png')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment