Ten Brush Slots

Hey everyone, I’m releasing my brush switching plugin for Krita!
It is designed to be similar to the Ten Brushes plugin but with additional shortcut and settings that allows me to have a more efficient workflow when switching brushes of similar properties.

There are 4 levels of brush switching, Kits > Slots > Groups > Positions.
A kit consists of 10 slots that are mapped to 10 configurable shortcuts.
Each slot can contain any amount of groups created by the user, groups are represented
Each group can contain any amount of brush presets.
Each brush preset occupies a position in a group.

You can switch kits using the next/previous kit shortcuts if you have 2 or more kits, it replaces saved brush presets and groups of each slot with the individual setups of that kit.
Each slot can be activated with the 10 shortcuts. Pressing the same shortcut again switches the brush to the same position of the next group in the slot by default if there are 2 or more groups in it.
You can also switch group using the next/previous group shortcut. If the same position does not exist on the other group, the first brush of the other group is activated.
Finally, you can cycle brushes in a group using the next/previous position shortcut.

Kits can be reordered and must have a unique name.
A kit cannot contain duplicate brush presets in the slots.
To create groups, insert divider blocks using the group button of the slot. Presets separated by the divider is considered a different group.
You can freely drag and drop any brush presets and divider blocks to rearrange the order or move between the slots.
All changes in the editor are automatically saved when switching between kits or exiting the editor.

Like ten brushes, you can set it to auto select the freehand brush tool when activating the shortcuts. However, this plugin checks whether you have already selected the freehand brush tool first when you press the same shortcut again. If selected, it will either switch to previous brush or next group/position. If not, then it will activate the same brush in the shortcut while selecting the tool.

I have also added sync settings that are helpful for maintaining the same erase mode / brush size / painting opacity / painting flow / brush rotation / blending mode settings when switching between presets in the same slot/group.

Example use case:
I have a square brush preset angled at 0 and 90 degrees. It also have a soft brush edge and a hard brush edge setting. I can set the soft edge versions in the same group and hard brush versions in another, with 0 degrees at the first position of each group. Now I can press the same shortcut again to switch between hard and soft edges while maintaining the angle, size etc, and use switch position shortcuts to change the angle maintaining the edge setting, size etc.

28 Likes

What an amazing plugin. Thank you for sharing it with us.

3 Likes

Updated the plugin to fix an error caused by autosave when deleting the only kit and renaming it.
Please download and update the plugin to the latest release version. Cheers!

8 Likes

New version out! It’s been awhile since I’ve worked on this plugin :grin:

Added multi-window support and fixed various bugs related to it in this version.
Now each new window should be able to have kits/slots/presets independent from the initial window.

6 Likes

v1.1 Improved Customization Update

Expanded Sync Options

  • Added ability to enable different settings for individual slots of each kit
  • May also enable syncing only for presets of the same group in slot

Additional 2nd Press Switching Options

  • Switching group to be its own option instead of being tied with switch to previous brush
  • Enforce previous brush option is therefore removed
  • Switching group also has additional option to switch position instead

Other Changes

Name Validations

  • Preset Chooser now prevents preset with names containing “,” or “;” from being added
  • Editor will auto rename kit with names containing “,”(replaced with empty space)

Switching Group/Position

  • Now uses current brush preset to determine current slot instead of last activated shortcut

Switch to Previous Brush

  • Previous brush will now sync if in same slot/group as the current brush
  • Switching group/position shortcuts will now cycle properly after Switch to Previous Brush

Get the latest version with the link on the top post. Enjoy!

6 Likes

amazing plugin, Lucifer. very useful!

1 Like

hi, i run the plugin and got this error message

Traceback (most recent call last):

  File "C:\Users\Lenovo\AppData\Roaming\krita\pykrita\tenbrushslots\tenbrushslots.py", line 444, in activateSlot
    if preset.name == currentPreset.name() and (not self.autoBrush or self.brushTool.isChecked()):

AttributeError: 'NoneType' object has no attribute 'isChecked'

1 Like

hmm it seems like the plugin couldn’t find the brush tool in the toolbox panel but i have no idea why it’s happening for you.

could you let me know the steps you have taken to produce this error and the krita version you are using?

:slight_smile: Hello @rahmanb, and welcome to the forum!

What’s your version of Krita, and what is your OS?

Michelist

1 Like

I’m use Windows 10 and Krita 5.2.9

Error happen when i try to switch next brush in same group

1 Like

Then my guess was a shot into the dark and hit nothing, I thought you may be on a 4.x version.

Michelist

1 Like

Now I know the problem. Sorry :sweat_smile: because I thought press again hotkey to activate brush slot (ex:Ctrl+Alt+1) was to switch next brush in same group (it was Shift+ -/Shift+= apparently). I try to uncheck option “Auto-Select Freehand Brush Tool” and the error message is gone. The error only occurs if I press again hotkey to activate brush slot (ex:Ctrl+Alt+1) when already in those group brush.

2 Likes

hi, thanks for providing more info! you are right in that you should be able to switch next brush in same group by pressing the same hotkey, but you need to set it to switch position instead of group. however the plugin bugging out in your case is related to the plugin locating the freehand brush tool widget on the toolbox docker instead.

however, i’m still unsure of the cause as it did not happen on my linux machine. there should not be any errors when auto-select freehand brush tool option is checked.

already try it and still have same issue

1 Like

Unsure about your GitHub knowledge, did you follow this quick guide ↓ to download the patch instead of the current release, because the link give above leads to the wrong page?


By the way, below point one initially stands written “main”!

Michelist

1 Like

yes, i downloaded that branch

1 Like

Okay, because many would have failed at this point, not knowing how to get to the file.

Michelist

1 Like

T_T i can only guess the problem from 2 angles, either the brush tool cannot be located on the toolbox docker or the notifier for windows created is not working on your krita.

first, could you go to tools/script/scripter then run the code below and give me the output?

from krita import *

qdock = next((w for w in Krita.instance().dockers() if w.objectName() == 'ToolBox'), None)
wobj = qdock.findChild(QToolButton,'KritaShape/KisToolBrush')
print(wobj)

next download and replace the tenbrushslots.py file again from GitHub - lucifer9683/TenBrushSlots at lucifer9683-patch-1. i have deliberately induced an error in the code to check if the notifier is working for your krita. give me the error message and if there is no error when you open krita, then it means something is wrong with your krita.

Here is the output from scripter

Then after replace the tenbrushslots.py file there is error when i open krita

Traceback (most recent call last):

  File "C:\Users\Lenovo\AppData\Roaming\krita\pykrita\tenbrushslots\tenbrushslots.py", line 210, in newWindow
    self.loadTool()

  File "C:\Users\Lenovo\AppData\Roaming\krita\pykrita\tenbrushslots\tenbrushslots.py", line 231, in loadTool
    toolBox = Application.activeWindow().qwindow.findChild(QDockWidget, 'ToolBox')

AttributeError: 'builtin_function_or_method' object has no attribute 'findChild'
1 Like

ok if the scripter outputted “None”, i think it’s got to do with this interface.

dock

actually i found the problem, the krita ui redesign plugin disabled the toolbox docker thus the code couldn’t locate the freehand brush widget.

1 Like