Skip to content

Instantly share code, notes, and snippets.

@dacap
Created November 28, 2022 19:07
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/43e47966292f12e933b9c497a9f6e997 to your computer and use it in GitHub Desktop.
Save dacap/43e47966292f12e933b9c497a9f6e997 to your computer and use it in GitHub Desktop.
New Frame without moving one frame tags
local s = app.activeSprite
if not s then return end
local f = app.activeFrame
local readjustTags = {}
for _,t in ipairs(s.tags) do
if t.fromFrame.frameNumber == f.frameNumber and
t.toFrame.frameNumber == f.frameNumber then
table.insert(readjustTags, t)
end
end
app.transaction(function()
app.command.NewFrame{ content="frame" }
for _,t in ipairs(readjustTags) do
t.toFrame = t.toFrame.frameNumber-1
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment