When I’m drawing my cleanline and shade on top of my sketch i find i run into the problem that if I set the layer to be transparent I it becomes very difficult to follow along with my shading, and to see which lines I’ve drawn. So I made a plugin that lets you set a keyboard shortcut to hide and show a layer named “reference”
It works Thank you
If I name two layers as ‘reference’ there is some confusion and I can’t work out the logic of what happens but that’s the sort of thing I like to do - don’t worry about it.
Well for me so far it’s actually been using the most lately named layer but I might have just been lucky. What would you like to happen? That it hides/reveals all layers named reference?
I’m not asking for changes as such, it was just an observation. I also figured out (forehead slap) that it can toggle an entire group if the group layer is called ‘reference’.
Thinking more about it, there could be a situation where you want those layers to be distributed among the working layers, for whatever reason, so having it turn off every layer called ‘reference’ or even ‘reference…’ would be useful.
If you could make it do that then it would be even more flexible. It’s up to you and thank you again.
It actually gave me an interesting challenge because you might have nested layers indefinitely called reference. so praised be pythons ability to call a function within itself since this allowed my to indefinitely just continue recursively looking through layers.
as an added bonus/consequence of this way of doing it the last visibility state is remebered, so if a reference layer is manually toggled and you press the button you will have oposing visibilites
Thanks for +1 useful feature in Krita! Is it possible to make toggling by color layer (that applying by right-click menu)? For example, pressing shortcut hide/reveal layer/s marked with red color.
I’ve just downloaded and used it and it works very well.
You can use the ‘added bonus’ behaviour to toggle between two sets of reference images, or two sets of groups of references, or a mixture of the two.
You have to use it to see how useful it can be.
Interesting thing: if there are any visible layer with filter mask, even if layer are totally covered with other image/paint, there are delay in reaction to on/off reference layer. In 2800x3900 document is about 2-3 seconds.
Hmm I’m working in a document about that size and it’s nearly instant for me. How long does it take to manually toggle visibility by clicking the eye icon?
Manual switching and in-system shortcut hide/show layer work fast. Only if filter mask is visible, for example color balance, on a visible layer than there is a delay in switching any other marked as “reference” layer with the plugin. (And instead of “reference” I use color label by @wojtryb modification)
Anyway I rarely use filter masks, so this issue is not so issuable thing.
This is similar to my script, I share my script follow.
Just bind script file to Ten Script plugin.
from PyQt5.QtGui import QIcon
from krita import *
colorLabel:int = 7
# 0:✖ 1:🟦 2:🟩 3:🟨 4:🟧 5:🟫 6:🟥 7:🟪 8:⬛
def foo():
app = Krita.instance()
doc = app.activeDocument()
layerUUID = doc.annotation("LayerNameBuffer")
layer = doc.nodeByUniqueID(QUuid(layerUUID))
if layer != None:
if layer == doc.activeNode():
null = QByteArray()
doc.setAnnotation("LayerNameBuffer","Store layer UUID for toggle its visibility",null)
doc.activeNode().setColorLabel(0)
app.activeWindow().activeView().showFloatingMessage("Undo mark current layer",QIcon(),1000,1)
else:
doc.setActiveNode(layer)
app.action('toggle_layer_visibility').trigger()
app.action('switchToPreviouslyActiveNode').trigger()
app.activeWindow().activeView().showFloatingMessage("Toggle reference layer visibility finishied",QIcon(),1000,1)
else:
uuid = doc.activeNode().uniqueId().toByteArray()
doc.setAnnotation("LayerNameBuffer","Store layer UUID for toggle its visibility",uuid)
doc.activeNode().setColorLabel(colorLabel)
app.activeWindow().activeView().showFloatingMessage("No found reference layer,Marked current layer",QIcon(),1000,1)
foo()
I used UUID mark layer and save data to current document file. You can change "colorLabel " filed to make reference layer stand out, but I dont use color label to trace layer.
I didn’t feel lag while using it. But it cant toggle visibility of multiple layers. You can improve it and add to your plugin.