Plugin to remember tool and its settings for a layer

If it does not exist, I would want to make a script/plugin, that would save the last used brush with its options (colour/opacity/brush settings/mode) used on each layer, upon layer change and restore them, once one switches back to this layer. Ideally this would be a layer property, so that some layers may escape this treatment.

Is this possible at all, via a python script? Is there enough API for that? I am grateful for pointers - while I programmed some python (too) quite a while back, I have no good idea on what hooks are best used in such a scenario.

Rationale: I draw lines to a fill layer, colours to a normal layer and text/bubbles to fill layers, with quite different brushes and every time I change a layer, I have to set all this back up again. This slows down my process and bores the hell out of me.

2 Likes

Well, considering the responses I got, I assume, that this is not as easily possible as I had hoped.

I think it depends on the Python API that krita has.
I mean, I haven’t worked with krita’s Python API, but having some experience in blender’s API I know that sometimes the API does not allow to do some things. Most of the times simply because the developers don’t think anyone would need to use a setting or change it at any point.

So it depends on what the API allows you to do. If you can track states like for layers for example, you can check if a layer is selected, if it is load the brush and bursh settings. But then you must have a logic that records the bursh and bursh settings beforehand. Not to mention how to track layer selection and then loading the settings.

In the end I don’t think it’s impossible or that hard but it will take time and good knowledge of the API.

1 Like

I think you can for the most part. Not everything you want is open now. The sucky part is that any changes will not be detected to my knowledge, you need to make a timer to actually check periodically. Color opacity I know you can get layers I think you should be able too but I never touched that too much.

Considering the limitations I donno if it is not worth doing it in another perspective. Like a save state entry or something. As a plug-in you really do not have access to signals and events from the program as your a child of it and you can only react to your own events.

On second thought I think it would not react as you might expect it too.

1 Like