Mirror Copy with a Script for Actuator

Copy content of the layer and create a mirrored copy (horizontal right) on a new layer above using a Script Step in Actuator Plugin.

Copy content of the layer and create a mirrored copy (horizontal right) on a new layer above using a Script Step in Actuator Plugin.

from PyQt5.QtCore import QPoint

from krita import Krita

app = Krita.instance()

def run():
    doc = app.activeDocument()
    if not doc:
        return

    app.action('edit_copy').trigger()
    app.action('edit_paste').trigger()
    doc.waitForDone()

    active_layer = doc.activeNode()
    bounds = active_layer.bounds()
    x, y, w, h = bounds.x(), bounds.y(), bounds.width(), bounds.height()
    center = QPoint(x + w, y)

    active_layer.scaleNode(center, -w, h, "Hermite")
    
run()

Note. The script will make a new layer below. So the additional step with “move_layer_down” needs to be added.

Download this sequence.