Hi, I am creating a clipping group for all selected paint layers. If the layer blending mode is set to hard light I want to fill the Mask Layer with 50% grey. With this code:
doc.setActiveNode(mask_layer)
if shading_layer_type == "hard_light":
view.setForeGroundColor(grey_50)
app.action('fill_selection_foreground_color').trigger()
view.setForeGroundColor(fg_color)
It fills the selected layer (the base of the clipping group) instead of the mask layer. If I use a QMessageBox to debug the code before this code it fills the correct layer. I tried with doc.refreshProject() but it doesn’t help.
@KnowZero I was to quick to say that the singleShot was the correct solution. Now I have different problem and that is that it fills with incorrect foreground color.
This is what I tried but it’s not working.
As for how to get guarantees from the docker, it would be like this:
from krita import *
def rowchanged(i,i2):
print ( "Data=",i.data() )
smodel.currentRowChanged.disconnect(rowchanged)
qdock = next((w for w in Krita.instance().dockers() if w.objectName() == 'History'), None)
wobj = qdock.findChild(QListView)
smodel = wobj.selectionModel()
smodel.currentRowChanged.connect(rowchanged)
The i.data() will contain the action name that you can verify, then disconnect