Apply specified blending mode to the set of selected layers.
from PyQt5 import QtWidgets
from krita import Krita
from actuator.api.blend import BLENDING_MODES
def set_blending_mode(mode):
if mode not in BLENDING_MODES:
QtWidgets.QMessageBox.warning(None, "Warning", f'Unknown blending mode: "{mode}"')
return
win = Krita.instance().activeWindow()
view = win.activeView()
selected_nodes = view.selectedNodes()
for s in selected_nodes:
s.setBlendingMode(mode)
set_blending_mode("multiply")
Download this sequence.