Neat idea!
Krita uses scripts to automate actions,
I think we can achive this by sequencing action.
I tried scripting this
from krita import Krita
from PyQt5.QtCore import QTimer
app = Krita.instance()
doc = app.activeDocument()
current = doc.activeNode()
topNode = current.parentNode()
#this script merge the current layer below and adds new layer
def addLayer():
paint_node = doc.createNode("Layer", "paintlayer")
topNode.addChildNode(paint_node, None)
app.action("merge_layer").trigger()
#added timer cause when adding new layers it goes to the most bottom instead of top of merged layer
timer = QTimer()
timer.setInterval(100)
timer.setSingleShot(True)
timer.timeout.connect(addLayer)
timer.start()
There’s also another way but it uses “Select All” so it will override your current selection if you have one
You can run this script by going to Tools >> Script >> Scripter, copy/paste this and click the play button.
If you want to save this and assign a keyboard shortcut, click the “File” in scripter and save it, then go to Tools >> Scripts >> Ten Scripts, click the “…” button and select your saved script file.
You can assign a shortcut in Keyboard Shortcut settings >> Scripts >> Ten Scripts.
There’s also a cool Docker Plugin for sequencing actions
Actuator