Sneaky visibility - change layer visibility not added to undo stack

Layer visibility being always added to the undo stack messes up my workflow a lot so i made this plugin to avoid that.

You have 3 ways to use it:

  • shortcut
  • clicking the action in the layer menu
  • adding the action to the toolbar

This plugin works on selected layers so you can select multiple layers and change the visibility of all of them with just one action.

Warning! This plugin doesnt change the action of the visibility icon on the layer docker (beside each layer). If you use that the change will continue to be added to the undo stack

Instructions in the readme

8 Likes

This should be safe, I think, since it requests a gui-blocking synchronous refresh of the whole image projection (the button in the toolbox kicks of a background refresh of only the part covered by the layer). Though in the KritaUtils.py wherever the active document is retrieved, it might be a good idea to check it’s not None.

And of course, the document isn’t set to modified, so if you change the visibility of a layer and press save, the document won’t be saved.

Yes that’s the intention.

But that is something a lot people would consider a bug – they don’t expect invisible layers to be visible again when loading the image.

I think this is for the people who don’t want the current arrangement of adding layer visibility in undo stack. So this gives them that option. They know what the behaviour is and know what effect it will have so I think it is okay for them. This plugin is a good option for the people wanting old behaviour

2 Likes

I do plugins first and foremost for myself, i share them in case others find useful.

For me changing the layer visibility and setting the file as modified is not always good. As many times i may open the file hide a layer and export. Then i just close and it’s back to it’s original state.

If others think it’s a bug i will just say it’s intentional, if they want they can just fork or just edit for it to do that. Or if someone wants to save after hiding or showing a layer people can use the button in the layer docker and save.

1 Like

Thanks a lot for this! :slightly_smiling_face:

…but I have to say, it’s very sad that it’s even necessary to fix a basic functionality with a plugin. I don’t know any other graphics program that adds visibility toggling to the undo stack. Imho it was a very bad decision to begin with.

Also, not saving when I explicitly ask it to - that’s what I’d call a bug.

3 Likes

It’s not a fix, as it has been implemented because it was asked and some users need the current implementation for their workflows too :slight_smile:

But there’s already a long debate about this and the subject is known by development team
If you follow development news, the subject is not taken in account because there’s more impact than “just” rollback or put an option for users, there’s use case that are problematic and also things related to undo/redo stack, for what I remember

Grum999

1 Like

Yeah, I know. But such a severe change should’ve been made optional, because for my (and many other’s) workflow, it’s broken as it is now. I cannot count how many times this has thrown me off and forced me to fiddle with Compositions feature (which has its own idiosyncrasies) and what not.

2 Likes

i agree with you, being completely honest i wish i didnt need to do this plugin at all but after all the time waiting i needed a solution for myself cause i hate the current behavior.

completely agree, and the few programs i know have a toggle to opt out this behavior

I wish i could change the behavior at the layer docker but looked to be too much work

1 Like

The same thing happens to me only that I use the snapshot panel.

And yes, I think that it should have been an option and not something imposed by default.

If I remember correctly, they had commented that they would find a way to make it an option.

Something that obviously can take time but I think it’s necessary because there are many users who are still stuck in version 4.x due to this decision, not counting many of the people who continue to complain.

sharing some news on the plugin, i noticed that it wasnt working for group layers (what would happen is that you wouldn’t be able to use the action or shortcut when selecting a group node) so a made a small fix.

Just need to download the plugin again or just edit sneakyVisibility.action file and change the line <activationFlags> to 0 as this was the only change i had to make

3 Likes

You are my hero! :kiki_love: Made the edit and tried with combinations of group, different layer types, filter layer, masks… and it works. Great!

If I may ask: is there any chance to improve the performance somehow? In certain constellations (not even many layers) switching can be quite slow. But at least it works, so thanks again for that.

1 Like

thats good to know!
i cant promise anything but i will try to look into it. i also noticed the delay. i imagine its the refresh projection taking time to process as it affects the whole canvas but if it is that i have no idea how to work around it.

2 Likes

Yeah, that might be it. No worries and no hurry - it’s nice to have this option at all. :slightly_smiling_face:

2 Likes