Fix #111490: paint radius set to 1 (shift-smoothing but brush missing) #111516

Merged
Philipp Oeser merged 5 commits from lichtwerk/blender:111490 into main 2023-08-29 13:44:42 +02:00

5 Commits

Author SHA1 Message Date
4224c7b5c9 remove comment (wrong copy-paste) 2023-08-29 13:41:57 +02:00
c78b704168 Merge branch 'main' into 111490 2023-08-29 13:15:25 +02:00
ea40efbbd4 use CLOG_WARN 2023-08-28 14:45:13 +02:00
6fa104b306 simplify checks 2023-08-25 16:48:29 +02:00
98823b6c16 Fix #111490: paint radius set to 1 (shift-smoothing but brush missing)
This affected sculpt, vertex- and weightpaint.

So attempting to (temporarily) switching to the smooth/blur tools from
another tool using the "Shift" shortcut can fail if the corresponding
smooth/blur brush is not found/missing [which was the case in the report
because the brush was deleted].

In this case, brushes dont really get switched, but blender would still
try to cache the size (because the smooth/blur brush temporarily uses
the same size as the previous brush) of the smooth brush in
`StrokeCache` (see `smooth_brush_toggle_on`). Then in
`smooth_brush_toggle_off` it was assumed brushes were actually switched
and the (non-existing) size of the (missing) smooth brush was applied to
the **actual** brush.

Now restructure code a bit so in the case of a missing brush we can
early out (without affecting the **actual** brush then).
2023-08-25 12:43:12 +02:00