Created
May 15, 2024 21:06
-
-
Save freitzzz/53e09ac724637ca37d1e2b898858cc57 to your computer and use it in GitHub Desktop.
krita pyton move 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 * | |
import random | |
application = Krita.instance() | |
currentDoc = application.activeDocument() | |
currentDocWidth = currentDoc.width() | |
currentDocHeight = currentDoc.height() | |
# gets layers that are not nested | |
# you will need to loop through them if you want all layers | |
nodesList = currentDoc.topLevelNodes() | |
for layer in nodesList: | |
layer.move(random.randrange(0, currentDocWidth), random.randrange(0, currentDocHeight)) | |
print(layer.position()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment