[Wish] "Quick Clipping Group" feature, better auto-naming

Recently, I started to experiment with splitting my artwork into silhouettes. I put them on separate layers, from the scratch, or more exactly just after the sketch is done. It has advantages: I can preserve firm edges for silhouettes while painting and it also has advantages to fine-tune shading and compositing of each element later on in the process.

And so, I’m using Quick Clipping Group a lot, but I’m spending a lot of time just renaming my layer stack. That’s why I wish it was possible to get better auto-naming out of the box to speed up my process.

Initial situation

I paint the silhouette and name the layer.

Initial situation: illustration.

The problem

I select each layer and press the Ctrl+Shift+G shortcut to start Clipping Groups (or right click on the layer in Layer Stack Docker → Group → Quick Clipping Group). The problem here is the naming of the result: I have now plenty of Clipping Group1, 2, 3 etc… as top-level groups (see picture under). Also, the clipping base is named after the original layer name.

My layer stack is now hard to read and, I have to rename all my groups manually, and clipping base as well. It is a lot of duplicate effort. It’s almost OK to do it manually on a picture like that with only 6 groups. But after doing the 4th picture this way, I start to be tired of this step. I also can’t imagine going through this process on a larger project (eg. a comic episode with many pages/panels).

The problem: this naming convention is not useful.

The wish

I wish the Clipping Group could inherit directly the name of the target layer. I also wish the “Clipping base” of the group to be named “Clipping base - <NameOfTheLayer>”.

Here is how it looks when I rename all manually. Really easier to work this way :smiling_face:

My layer stack manually renamed, I wish Ctrl+Shift+G could do that, out of the box.


I inspired my “Clipping base - <NameOfTheLayer>” naming convention from @tiar 's screenshot here. And thanks to @freyalupen who solved my other wish about optional renaming “merged” suffix, merging top level Clipping Group (eg. “Dragon”) don’t auto end up anymore into “Dragon Merged”.

Definitely would use and appreciate this, as someone who is not good about naming their layers but wants to improve and get organized. I use hot keys on my tablet, so reaching for my keyboard to have to type new names is kind of a problem (particularly when on laptop, since my tablet lays over my keyboard entirely).

1 Like

Some thoughts on this:

What would happen in the case that a quick clipping group is made containing more than one layer? Implementation-wise it seems that inheriting the name of first selected layer (that is, first one clicked on) may be easier than from, say, the bottom layer.

Is this something that could be done with a script, one that could assign a hotkey to make a quick clipping group and rename the layers accordingly? (I don’t know whether it’s possible.)

And a technical question, is there a way to have layer renames as part of the “Quick Clipping Group” undo command? (In my investigation I’ve only gotten as far as using node->setName which isn’t even undoable at all.)

To answer my question of whether it’s doable with a script; running this in the Scripter will add renaming to the Quick Clipping Group action. It has the aforementioned issue of the renames not being undoable.

def rename():
    maskLayer = Krita.activeDocument().activeNode()
    clipGroup = maskLayer.parentNode()
    clipBases = clipGroup.childNodes()
    del clipBases[-1]
    inheritedName = clipBases[0].name()
    for layer in clipBases:
        layer.setName("Clipping Base - "+layer.name())


@starsworne Ha yes, it might help users of Krita on mobile and pen displays. Thanks for the input.


I checked what Krita does now, and it sounds like all layers selected are joining the Clipping Group.

I’m not sure about renaming all of them with a "clipping base - " prefix. I really plan to use Clipping Group on a single Paint Layer so for me, it’s ok, but for an eventual other user, I don’t know.

I understand if other want to use that on multiple shapes (Clipping Base) and use other later type (eg. vector). I’m open to ideas, very interesting question. I saw your script has a loop:

for layer in clipBases:
        layer.setName("Clipping Base - "+layer.name())

So, I’ll see when I’ll experiment with it. :+1:

That can work for me, yes.

I have zero skill with Python script, but it sounds like a good idea. Thank you very much for your script. I’ll play with it. I sort of can read the logic of it. Very interesting to see you can influence the behavior of the feature this way. Thanks for posting it.

@Deevad I like the idea!
Are you also proposing that you select the layers you want to have as quick clipping group and that a clipping group is created for each separately? So that each group contains only a base layer and the clip layer on top? That might also help you save time.

Hi @Hologram , thanks. Yes, for my specific case it might help, but I prefer the design where ‘every layers/groups selected ends into a clipping base for a single clipping group’.

On my side, going threw the stack and pressing Ctrl+Shift+G to ‘quick clipping group’ is not much effort. And I always prefer the modularity of a design instead of too much automatism.

Right now my main personal question I evaluate is, in case of multiple groups/layers selected, if they should just join a new created group named ‘clipping base’, and of course, placed at the root of the ‘quick clipping group’. This way, the group conserve only one node at the bottom (a group) and the layers/groups inside preserve their name.

I mean, there could be an automated option alongside the current one if that helps (and I’m sure it does). :wink:

And then also the rest of your proposal, which I very much agree with.