You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set the isVisible property on a Layer inside a transaction, and then call app.undo(), the visibility change is not reverted.
Example code:
local function revealLayers(layers)
for i, layer in ipairs(layers) do
layer.isVisible = true
if layer.isGroup then
revealLayers(layer.layers)
end
end
end
app.transaction(function()
revealLayers(app.activeSprite.layers)
end)
app.undo() -- This has no effect.
Other actions that act directly on properties are reverted (I tested setting Layer.color instead of Layer.isVisible, for instance).
I suspect this is intentional in that it is consistent with the UI behavior; changing a layer's visibility doesn't seem to be revertable via Edit -> Undo. However, in a scripting context it would be useful to have a revertable visibility change. So if the behavior is intentional, this could be considered a feature request for something like Sprite:setVisibility(visibility, revertable=false), where setting the second parameter to true adds the visibility change to the edit history.
The text was updated successfully, but these errors were encountered:
If you set the
isVisible
property on a Layer inside a transaction, and then callapp.undo()
, the visibility change is not reverted.Example code:
Other actions that act directly on properties are reverted (I tested setting
Layer.color
instead ofLayer.isVisible
, for instance).I suspect this is intentional in that it is consistent with the UI behavior; changing a layer's visibility doesn't seem to be revertable via Edit -> Undo. However, in a scripting context it would be useful to have a revertable visibility change. So if the behavior is intentional, this could be considered a feature request for something like
Sprite:setVisibility(visibility, revertable=false)
, where setting the second parameter totrue
adds the visibility change to the edit history.The text was updated successfully, but these errors were encountered: