Created
November 28, 2022 19:07
-
-
Save dacap/43e47966292f12e933b9c497a9f6e997 to your computer and use it in GitHub Desktop.
New Frame without moving one frame tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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