Fix T81715: Unprojected radius mode messes up sculpt texture radius
We really need to fix how unprojected radius (scene unit) works. What happened is the paint code updates the brush's normal radius with the current unprojected pixel radius, which was then used by texture brush tiled mode. To fix this I just cached the pixel radius at stroke start in UnifiedPaintSettings->start_pixel_radius.
This commit is contained in:
Submodule release/scripts/addons updated: 67e43f9083...7025cd28ed
@@ -2029,7 +2029,7 @@ float BKE_brush_sample_tex_3d(const Scene *scene,
|
||||
/* leave the coordinates relative to the screen */
|
||||
|
||||
/* use unadjusted size for tiled mode */
|
||||
invradius = 1.0f / BKE_brush_size_get(scene, br);
|
||||
invradius = 1.0f / ups->start_pixel_radius;
|
||||
|
||||
x = point_2d[0];
|
||||
y = point_2d[1];
|
||||
@@ -2142,7 +2142,7 @@ float BKE_brush_sample_masktex(
|
||||
/* leave the coordinates relative to the screen */
|
||||
|
||||
/* use unadjusted size for tiled mode */
|
||||
invradius = 1.0f / BKE_brush_size_get(scene, br);
|
||||
invradius = 1.0f / ups->start_pixel_radius;
|
||||
|
||||
x = point_2d[0];
|
||||
y = point_2d[1];
|
||||
|
@@ -923,6 +923,8 @@ PaintStroke *paint_stroke_new(bContext *C,
|
||||
|
||||
BKE_paint_set_overlay_override(br->overlay_flags);
|
||||
|
||||
ups->start_pixel_radius = BKE_brush_size_get(CTX_data_scene(C), br);
|
||||
|
||||
return stroke;
|
||||
}
|
||||
|
||||
|
@@ -1255,8 +1255,7 @@ typedef struct UnifiedPaintSettings {
|
||||
* In case of anchored brushes contains the anchored radius */
|
||||
float pixel_radius;
|
||||
float initial_pixel_radius;
|
||||
|
||||
char _pad[4];
|
||||
float start_pixel_radius;
|
||||
|
||||
/* drawing pressure */
|
||||
float size_pressure_value;
|
||||
|
Submodule source/tools updated: c1586ae295...53b7c02a06
Reference in New Issue
Block a user