Last active
December 30, 2022 02:11
-
-
Save toku-sa-n/b7967c03bae3d347346f5f4db6fc55eb to your computer and use it in GitHub Desktop.
A Krita script to lock all leaf layers
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
from krita import Krita | |
def lock_leaves(node): | |
children = node.childNodes() | |
if children: | |
node.setLocked(False) | |
for child in children: | |
lock_leaves(child) | |
else: | |
node.setLocked(True) | |
nodes = Krita.instance().activeDocument().topLevelNodes() | |
for node in nodes: | |
lock_leaves(node) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment