Is it possible to programmatically create compositions?

I see Update composition and Rename composition actions here, but no Create composition or something like that. Is it possible to add compositions via Python?

You can do it via calling the GUI

from krita import *

qdock = next((w for w in Krita.instance().dockers() if w.objectName() == 'CompositionDocker'), None)
compName = qdock.findChild(QLineEdit,'saveNameEdit')
compSave = qdock.findChild(QToolButton,'saveButton')

#this is optional if you want to give it a name
compName.setText('Name of Composition')
compSave.click()
3 Likes

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.