As some of you might already know, for the last 8 months I’ve been working on porting Krita’s brush editor’s backend to the new framework named “Lager”. The project might look a bit weird from the user’s point of view. It does not change anything visually in the GUI. It’s goal is to rewrite internals of the editor only. But the project will let us do important things in the future:
After this refactoring we will be able to change GUI of the editor in a way we like and/or split it into multiple dialogs. Right now it is impossible to do because the brush backend is tightly linked to the existing GUI.
We will also be able to port the GUI to QML when we finally start implementing mobile GUI for Krita.
Yesterday I finished the first milestone of the project: I have fully ported “Pixel Brush” to the new framework. That was the most difficult part of the project, now I just need to replicate the changes to other brush engines, which is just mechanical work.
While I’m porting other brush engines, I would really like it if someone tested the branch in its current state. I had to basically rewrite thousands(!) of lines of code in the brush editor and I could easily make some stupid mistakes
Could you please check these packages and see if the brush editor page for the pixel brush still works correctly?
Try to change any brush options (“Size”, “Rotation” and so on). All the widgets and curves should be connected to the brush stroke
Try to change any sensors (“Pressure”, “Fuzzy” and so on). They should behave as expected, especially complex sensors with custom widgets, like “Drawing Angle”, “Fade”, “Time” and “Distance”
Check if legend on the sensor curves is correct or at least “sane” (this part was changed significantly in the code, I hope I haven’t messed it up )
Try to close and reopen the brush editor, the settings should still be the same
Try the preset saving functions, like “Override” and “Reload”. They should behave in a sane way and reset the brush editor to the expected state.
Check if Precision option is loaded/saved/used by the brush
Pay attention to “linked” properties:
“Lightness strength” option should be enabled only when a predefined brush tip with lightness mode is enabled
“Painting Mode” should automatically reset and lock into “Wash” mode when “Masking Brush” is enabled
“Instant Preview” checkbox should automatically react when brush settings change:
it should cross-out when the size of the brush is below the threshold
when brush “Size” has a random sensor enabled or when “Randomness” or “Density” brush tip settings are active, it should show a tooltip with explanation under an asterisk sign
WARNING
Currently only Pixel Brush is ported and tested. Other brush engines are not ported and are expected to crash randomly!
PS:
Here is the stat line for the current state of the branch. It definitely needs a lot of testing!
Masked Brush’s Rotation Curve option takes over the functionality of the main Rotation Curve option. You can see what I mean if you select Ink-4 Pen Rough. The Rotation Curve option under Masked Brush is enabled even though it’s supposed to be disabled, and it acts as the base Rotation Curve option while the actual base Rotation Curve option does nothing.
Fade slider for the Brush Tip is buggy. The slider visual doesn’t update on reload, and either slider sometimes functionally lags behind the other, noticeable through the brush tip preview. Try it on Basic-5 Size.
The default predefined brush tip size seems to be 1000 px. In stable it’s 5 px, but I would suggest making it inherit the diameter setting of the auto brush tip.
I get the following warnings on creating a new document:
Failed to load embedded resource KoResourceSignature("patterns", "", "", "")
Failed to load embedded resource KoResourceSignature("patterns", "", "", "")
QObject::connect: Can't find method on instance of class KisMultipliersDoubleSliderSpinBox
Failed to load embedded resource KoResourceSignature("patterns", "", "", "")
You also get a similar warning regarding resources when first selecting certain brushes such as Basic-5 Size Opacity.
Be sure i am gonna test this deeply. I appreciate a lot all the effort. Let’s go!
How do you want the feedback, everything together or things as i am discovering weird behaviors? OS:Windows 10 Device: Wacom Intuos 4 pro S
Testing in Preview,Scratch Pad, and document with Brush Editor Detached 2. SIZE, ROTATION,… BEHAVIOUR ROTATION OPTION
Select the “b) Basic 2 opacity” and change the ratio to see better the rotation. Activate rotation. close the brush editor and open again. The rotation is not active. Also happens if you have the brush ediitor detached and Rotation is active
Rotation controled by Pressure, Drawing Angle, Fuzzy Dab, Tilt Direction… are not working. It seems to be completely disconected. Tested With Auto, Predefined and Text.
Weird because testing other brushes have Drawing angle active. Maybe is the Ratio modified what cause this?
Select e) Marker Dry And Tilt seems to work fine in Rotation. Not Drawing angle and Fuzzy dab and so on.
Tested also in Kubuntu 20.04 with Wacom Bamboo Pen.
PD: If we are rewriting the Brush editor it would be more useful at least for making brushes to have “share curve across all settings” disabled. Also if we could choose to have a curve by default selected in each option, i would choose Drawing angle in Rotation option. That way we can have Static and rotatated with less effort.
SIZE OPTION
I can’t test Rotation and Tangential pressure because i don’t have special stylus for that. Auto default Pixel Engine brushtip
Preview in brush editor= OK
Scratchpad =OK
Document = (with detached Brush editor)= OK
IT seems to work ok with a default created Pixel Engine brush. NOTE: If Brush Editor is detached and we activate time sensor and increase the value, there is a point where the window decoration is lost. At least in laptop with Kubuntu
Predefined Brushtip= Chalk
By default the brush size is at 1000px. too big for a default.
Preview in brush editor= OK (time doesn’t produce changes but distort the Curve widget area.
Scratchpad = OK
Document = OK
NOTE: Fuzzy Stroke seems to create a not real variation between min and max. value when is combined with Fuzzy dab. Am i doing something wrong?
RATIO OPTION Auto default Pixel Engine brushtip
Preview in brush editor= to do
Scratchpad =to do
Document = (with detached Brush editor)= to do
OPTIONS rembembered?
Mirror is not remember if Horizontally or vertically is active
Scatter is using X and Y active. If you deactivate them. This is not remembered.
Rotation option activation is not remembered
Linked Properties.
Lightness Strength option works OK. with an RGBA brushtip and “Lightness map active”. If you select Alpha mask, Color image or Gradient map. with an RGBA brushtip they work ok, but you can’t control the “Lightness strength”
“Painting mode” option Change automatically if we add a masked brush from buildup to wash mode.
Instant View. Make Krita crash several times . I try to reproduce the same steps.
it should cross-out when the size of the brush is below the threshold= OK
when brush “Size” has a random sensor enabled or when “Randomness” or “Density” brush tip settings are active, it should show a tooltip with explanation under an asterisk sign= OK, but if you remove one of the parameters, the tooltip is not correct.
By the way, @raghukamath i would post this as a pinned thread, because is important for everybody. So if you think is ok i would be happy
I haven’t done any extensive testing yet, but some things I’ve already noticed:
“Instant Preview” checkbox should automatically react when brush settings change:
it should cross-out when the size of the brush is below the threshold
This works as expected.
when brush “Size” has a random sensor enabled or when “Randomness” or “Density” brush tip settings are active, it should show a tooltip with explanation under an asterisk sign
This does not work as expected; the tooltip only updates when turning on or off the asterisk. So if you change more than one of these settings, the tooltip will become inconsistent (for example, the Randomness message being shown after you already turned it off, because Density was also enabled, while the Density message isn’t being shown).
Until some brush setting gets modified, texture patterns don’t work(!), and print this warning when using the brush (which includes switching to it in the brush editor): WARNING: Couldn't load the pattern for a stroke (KisTextureProperties).
(It’s really obvious with Ramon’s Sketch pencil brushes.)
There’s a warning about Failed to load embedded resource KoResourceSignature("patterns", "", "", "") when switching to a brush that uses the Texture Strength option without using the Texture Pattern option (“b) Basic-5 Size Opacity”, for instance, or all of the default Stamp brushes), but only after using a brush with a Texture Pattern first.
There’s a debug message of id = [0,1,2] being printed when switching between auto, predefined, and text brushtips.
It seems to set the diameter based on the size of whichever default brushtip it decided to use; for me it’s using something called “3 brush”, with a size of 27px. That isn’t the first one I have alphabetically, and I have no idea why it’s using that one. It also initially gets named “Current Brush Preset”.
(In stable, it uses the first one alphabetically with a correct name, and a size of 5px.)
I am available for testing but I need to learn how to test on Windows in a way that won’t impact my current Krita. I know how to do it in Linux and Android but not Windows.
Can anyone share a link or give me a few words on how to proceed? Thx
The Windows test package is a portable version (basically the equivalent of a Linux appimage), so you can use it alongside an installed version, just by unpacking the .zip file somewhere and opening the krita shortcut.
The only effect it can have on another version of Krita is that they will share the same settings, so it could be wise to back up %LOCALAPPDATA%\kritarc, or your resource folder, whichever settings files you don’t want impacted.
Brush Tip Fade Slider
The fade slider doesn’t seem to work. Also, it doesn’t return to its default setting after changing it and then clicking on the refresh icon, even though the yellow triangle “brush changed” icon disappears.
To reproduce: b) Basic-5 Size plus - Fade default is 0.94. Change it a few times, ending with a setting of 1.0. Click brush refresh icon, fade is not returned to original setting. Close brush editor, reopen, fade is still set on 1.0 but the brush editor doesn’t show the yellow triangle “brush changed” icon.
Texture - Pattern and Strength
Texture Options - Scale slider doesn’t return to default.
Strength is checked but Enable Pen Settings is not checked (maybe this is ok?). The strength slider does work as expected.
See j) WaterC Basic Lines-Wet-Pattern
Masked brush - Rotation
I saw several brushes with rotation selected even though there is no masked brush. See b) Basic-4 Flow Opacity and b) Basic-6 Details.
Thanks again for your efforts on testing this branch! I think I have fixed all the issues you mentioned in the reports
fixed “Rotation” sensor no to be overridden by the masking brush
fixed “Fade” sliders in the Auto Brush
fixed the “default size of 1000 px for predefined brushes”. Now the size is explicitly shared among auto and predefined brushes.
fixed a spurious warning from about missing textures
fixed checkboxes in “Mirror”, “Scatter” and “Spacing” options not saving (they were accidentally shadowed by the same options of the masking brush)
fixed the tooltip of the lod-availability widget to be updated properly
fixed textured brushes to be textured right after loading, now you don’t need to change any options to get them working
removed ‘id = [0,1,2]’ debugging line
fixed predefined brush not to have a placeholder name (“Current Brush Preset”) on the first opening of the editor
Could you please make one more round of testing and at least confirm that all the issues you reported are fixed now? I was really careful with reading your reports, but I could have missed something
Ah you’re right… I think I must’ve randomly selected brushes made of other brush engines while switching the presets.
Ignore my post plz if that’s an expected behavior.
I have have one completed more milestone in the Lager project! I have ported colorsmudge brush engine, which was one of the most complicated parts of our brush editor!
If you have time, could you please check the updated packages?
Test plan
Check if all the options of Color Smudge brush still work as expected
Pay great attention to “linked” properties (that was the most difficult part of the refactoring, and the main reason for the refactoring itself ):
Paint thickness option should be available only when a predeined brush with Lightness mode is selected
“New engine” mode should be forced when a non-masking mode of a predefined brush is selected (e.g. Gradient, Color Stamp or Lightness Map)
“Overlay” mode should be forcefully disabled when the brush works in Lightness Map mode.
Overlay option should block and disable Instant Preview checkbox
[the most funny] Smudge Radius option should change its max value depending on the selection of new or old engine. With the old engine, Smudge Radius should have max value of 300%, with the new engine — 100%. Basically, enabling the Lightness Map mode in the brush should now only trigger the new engine, but also crop the smudge radius value by 100% level
I made a new Color Smudge brush just to try everything out.
When I check or uncheck any of the checkboxes in the brush menu, the diameter/size of the brush always goes back to the value that is stated as the size under the “brush tip” menu.
This looks as if it doesn’t happen when I use an already existing Color Smudge brush. Can someone confirm?
2.1. Paint thickness only works on my end if the correct brush tip mode is selected.
2.2. Seems working also
2.3. Working
2.4. Doesn’t seem to work for me, I can toggle Instant Preview. You mean View - Instant Preview Mode, right?
2.5. Yep, working. The value of 99 stays in the brush I tested, however it changes the “length” of the slider where 99 is almost full on one, and 99 is only a third since the base value went up to 300%.
Tested under Windows 10 if that is of any value for you.
First, I’ve confirmed all the issues I previously mentioned with Pixel brushes have been fixed.
Now, for Color Smudge brushes:
When using Color Image, Lightness Map, or Gradient Map mode, SAFE ASSERT (krita): "m_brush->brushApplication() == ALPHAMASK || m_smudgeRateOption.useNewEngine()" in file C:/dev/env-13-lager/krita/plugins/paintops/colorsmudge/kis_colorsmudgeop.cpp, line 73 occurs.
Paint thickness is correctly disabled when not using a Lightness brush, but the message reads “XXX Disabled:” instead of just “Disabled:” like the other messages.
Everything else listed under 2. Linked Properties seems to work fine:
When using Color Image, Lightness Map, or Gradient Map mode, Smudge Length → “Use new smudge algorithm” is force-enabled.
Overlay mode is disabled in Lightness Map mode.
Overlay mode disables Instant Preview.
“New engine mode” caps smudge radius at 100%, setting back to “old mode” without changing the value remembers if the value was above 100% (for example, 200%).
It refers to a checkbox labeled “Instant Preview” on the bottom of the Brush Editor.