Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Aseprite script to copy multiple sprites into the active one (each sprite as a layer)
local filenames = {
"/Users/david/piano00.png",
"/Users/david/drums00.png",
"/Users/david/bass00.png"
}
local spr = app.activeSprite
if not spr then return app.alert "No active sprite" end
for _,fn in ipairs(filenames) do
local newLayer = spr:newLayer()
newLayer.name = app.fs.fileTitle(fn)
app.command.OpenFile{ filename=fn, sequence="agree" }
local subSprite = app.activeSprite
for _,cel in ipairs(subSprite.cels) do
while #spr.frames < cel.frameNumber do
spr:newEmptyFrame()
end
spr:newCel(newLayer, cel.frameNumber, cel.image, cel.position)
end
subSprite:close()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment