Sculpt: Remove hardcoded plane offset value for clay brushes

The Clay and Clay Strips brush have a built-in hardcoded Plane Offset of
0.40m and 0.18m, respectively. This value is added to the displacement
scalar after the pressure sensitivity is factored into the calculation,
leading to the pre-bundled essential assets not responding to tablet
pressure when enabled and potentially confusing behavior otherwise.

Pull Request: https://projects.blender.org/blender/blender/pulls/144382
This commit is contained in:
Sean Kim
2025-08-31 00:04:12 +02:00
committed by Sean Kim
parent 4bdcc7643b
commit 0d3788ff00
3 changed files with 5 additions and 5 deletions

Binary file not shown.

View File

@@ -166,7 +166,7 @@ void do_clay_brush(const Depsgraph &depsgraph,
/* This implementation skips a factor calculation as it currently has
* no user-facing impact (i.e. is effectively a constant)
* See: #123518 */
float displace = fabsf(initial_radius * (0.25f + offset + 0.15f));
float displace = fabsf(initial_radius * offset);
const bool flip = ss.cache->bstrength < 0.0f;
if (flip) {

View File

@@ -468,8 +468,8 @@ CursorSampleResult calc_node_mask(const Depsgraph &depsgraph,
const SculptSession &ss = *object.sculpt;
const bool flip = (ss.cache->bstrength < 0.0f);
const float offset = brush_plane_offset_get(brush, ss);
const float displace = ss.cache->radius * (0.18f + offset) * (flip ? -1.0f : 1.0f);
const float displace = ss.cache->radius * brush_plane_offset_get(brush, ss) *
(flip ? -1.0f : 1.0f);
/* TODO: Test to see if the sqrt2 extra factor can be removed */
const float initial_radius_squared = math::square(ss.cache->radius * math::numbers::sqrt2);