Shortcut to rotate brush

Thank you, now it’s clear to me. When I saw that mock-up I had no idea what I was looking at because I didn’t know the toolbar has all these options and the dropdown to replace the current property.

I will check how this part is implemented. I think some of the actions will show here naturally, but adding a new option slider probably needs explicit coding.

2 Likes

This is possible, but maybe it is enough to make this function available to these sliders in the same way as the previous options Size, Opacity and Flow are implemented there, since Pattern Scaling contains another option on top of that, the matter looks different again.

Michelist

While almost all options there use “Krita Slider”, the texture scale uses “Krita Slider + Combobox”, so I’m sure it’s possible to put different Widgets there.

This rotation widget implemented by deiflou is already used in status bar for canvas rotation, and a few other places too, so I hope it should be possible to create a new instance in the “Custom sliders” for controlling brush rotation

1 Like

FYI @TheTwo

Adding a simple slider like this was no big deal. It really does depend on some of the same code that was required for Python :slight_smile:

Is this good enough? Or would you prefer that Angle selector circle?
image
The bar slider is nice in this regard that it fits well with the other controls in that box.


As for the Python support, the PR is up, but I ran into some MyPaint weirdness and also need to fix some tests. Will continue tomorrow.


Lastly, the first change that added the rotate actions with assignable hotkeys is merged and should be available in the next nightly build tomorrow :tada:

4 Likes

Thank you! I personally prefer the Angle selector circle.

But at present, it is already sufficient because this is an off topic in itself, and I will not ask for more (the original post requires more parameters on the one hand, and additional functions on the other hand)
If you are still interested in your current work after it is completed, you can further discuss it in that post

2 Likes

It is already exposed to the API in 5.2 via Preset, toXML will give you an xml representation which you can then do fromXML

from krita import *

view = Krita.instance().activeWindow().activeView()
preset = Preset(view.currentBrushPreset())

print ( preset.toXML() )

Shouldn’t these be done to the Preset, not the View?

2 Likes

Since this request is merged should we close this thread to release votes? Or let it open for few weeks to discuss. You can also make a new thread for discussing this further.

Yes, it can be closed. I know what to do.

@KnowZero adding it to the View was a suggestion I got. View already had other properties such as brush size. If this is not the right place, maybe explain in the MR. I still have to fix the tests before it can be merged, so we can iterate. Thanks.

It’s not the public API. You can read and write “some stuff” from and to the XML, but its format could change without notice between any two versions breaking the plugins.

Once this is exposed with a getter and setter, you have a guarantee that it will be there at least until krita 6 (and likely much longer).

So far these were in View class, so that seems to be the good place to extend the API.

That was probably cause Preset didn’t exist at the time, but I guess since there is a precedent of similar things being in the View, there shouldn’t be a problem

To be clear, I didn’t mean to say we shouldn’t have getters and setters API, if anything making everything getter and setter is the proper way to go about it.

But any API change would have to wait for 5.3 so I was simply pointing out it is possible with Krita 5.2 already if one wants to do it

I totally agree this two brush shortcuts to rotate clockwise and counterclockwise the brush tip would be necessary for many digital artists.

Just a feedback about tilt rotation to reply the feedback of RPictures:

The device you tried had obviously a low quality tilt hardware or driver implementation. I have many tablets, and I can tell you’ll find many difference of tilt quality in this area. Usually Cintiq and Intuos (pro models) are the reference in this domain. My tablets from other brands behaves more like what you describe. I even have one with tilt limited only to 30° angles…

About holding the pen in ‘unnatural positions’, it happens if you set the rotation to follow the absolute angle; but with the curve you can boost it so a 70° with your wrist result in a 90° on canvas. It helps at not rotating fully the wrist (I agree, unnatural positions).

About brush tip flipping mid-stroke; it looks like a hardware implementation issue. Some low quality sensors (and post-processing chipset in the tablets) jumps like this and return confusing events coordinate.

I can attest to the low quality of tilt on Huion products, at least on Windows (which I use). It seems erratic and unpredictable. I much better prefer if a brush has the angle connected to stroke direction or something (if that is useful for that brush).

That’s been one of the reasons I wanted to try a Wacom tablet one day, but I’m still waiting for them to refresh the Intuos Pro line. I’m not interested in a display tablet, and I’d like to get a device with large size, akin to Huion Giano.

2 Likes

This feature was really high on my wish list, can’t wait to try it out! Thanks @YRH for working on this. If the brush rotation doesn’t end up in the shortcut composer addon, do you think it is possible to expose it to the Canvas Input settings, so you could drag the brush to rotate (like with brush resizing)? That would allow for more possible input combinations to activate the feature than just shortcuts.

3 Likes

Hey, you’re welcome! If you wish to test the brush rotation via shortcut keys, that’s already available in Krita nightly builds for 5.3.

Now that I started working on it, I will continue refining the support as requested. Exposing the rotation to scripts is next, I should finish the PR today. After that, I’ll have the slider UI added in the top window bar.

I haven’t looked at canvas input. I’m not sure if it can be extended to other brush properties, I think only one thing can be primary (i.e. the size). Shortcut Composer is my favorite plugin, so I’ll definitely help (if needed) to get support added there, if it makes sense.

2 Likes

I’ll create a “future” version of the plugin that relies on krita 5.3dev for those who use nightly builds.

It should be available right after the feature is merged.

3 Likes

Regarding the UI change, I posted the update in that other thread:

1 Like

OK, the scripting API change has been submitted as well. It should appear in the nightly within a day.

I think that concludes this topic and it can be closed :slight_smile:

4 Likes