Page MenuHome

GPencil: show brush size in Draw tool cursor
ClosedPublic

Authored by Sietse Brouwer (SietseB) on Dec 22 2022, 9:48 PM.
Tokens
"Party Time" token, awarded by hissatsuneko."Love" token, awarded by Raimund58."Love" token, awarded by filedescriptor."Like" token, awarded by antoniov."Love" token, awarded by bazza_."Like" token, awarded by marcluzmedia."Love" token, awarded by hamza.elbarmaki."Burninate" token, awarded by frogstomp.

Details

Summary

When drawing strokes in Grease Pencil, it was always a bit hard
to predict how thick the strokes would be, because there was
no visual reference of the thickness in the cursor.
This patch adds that visual reference. It shows the brush size
as a circle in the draw cursor.
Showing the brush size can be toggled in the Cursor menu
of the Grease Pencil draw tool.

Request in RCS with 26 upvotes for this option:
https://blender.community/c/rightclickselect/0zfbbc

On the technical side: the brush size is calculated
in 3D space and takes zoom level into account, as well as
object/layer transfrom, layer thickness change (gpl->line_change)
and thickness scale (gpd->pixfactor).



Diff Detail

Repository
rB Blender
Branch
gp-draw-sized-cursor (branched from master)
Build Status
Buildable 25135
Build 25135: arc lint + arc unit

Event Timeline

Sietse Brouwer (SietseB) requested review of this revision.Dec 22 2022, 9:48 PM
Sietse Brouwer (SietseB) created this revision.

Thanks for the patch. IMHO this can be useful for some artists. Also, as you can disable it, not a problem if you don't like it.

@Daniel Martinez Lara (pepeland) @Matias Mendiola (mendio) pleae, test this patch. I remember we were testing this idea in the past and we keep the small size because it was very intrusive, but maybe with this option to disable can be interesting.

At code level, LGTM...waiting for the Artists opinion.

This revision is now accepted and ready to land.Dec 23 2022, 11:05 AM

Thank you @Sietse Brouwer (SietseB) for the patch, Nice work! IIRC @Antonio Vazquez (antoniov) the reason why we didn't implemented this before was the zoom problem that this patch seems to tackle effectively taking the zoom level into account.
And since the feature is optional there is no problem to toggle ON/OFF when needed.

As a side note, to be resolved in this patch or another, right now when using the F key shortcut to set the brush size the gizmo is not taking into account the actual size of the brush giving no clue to the users of the real final brush size.
Maybe following the same zoom principle of this patch could this be solved?

Yeah, I noticed that too, the F gizmo is showing the brush radius in screen space pixels. It would be nice indeed if that could be properly scaled to world space.
I took a quick look in the keymap: the F key invokes a wm.radial_control operator with a data path to tool_settings.gpencil_paint.brush.size. So that's a window manager operator, fully agnostic of any GP knowlegde about scaling... So that's a puzzle to solve.
I can have a look at it, but that will be in first week of the new year.

And I forgot to say: thanks all for the quick responses, it feels like a warm welcome!

Ok, no rush, as I mentioned you can open a new task for a possible F key gizmo solution

I,m going to commit this patch..the F key would be a different patch.