[Bf-blender-cvs] [8fcf3e96fed] blender-v2.92-release: Fix T85079: Thumb brush unstable when producing larger displacements
Pablo Dobarro
noreply at git.blender.org
Wed Feb 10 01:10:15 CET 2021
Commit: 8fcf3e96fedc3641d44e8b3e230149f935f901f0
Author: Pablo Dobarro
Date: Tue Jan 26 18:12:38 2021 +0100
Branches: blender-v2.92-release
https://developer.blender.org/rB8fcf3e96fedc3641d44e8b3e230149f935f901f0
Fix T85079: Thumb brush unstable when producing larger displacements
The thumb brush was updating the area normal per brush sample, which was
making unstable sampled normals for setting the displacement direction
when the vertices are moved too much from their original positions.
Now it always uses the original normal except when using anchored
strokes. In those cases, the normal always needs to be updated.
Reviewed By: JacquesLucke
Maniphest Tasks: T85079
Differential Revision: https://developer.blender.org/D10214
===================================================================
M source/blender/editors/sculpt_paint/sculpt.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 410b83217b4..cb5d708908b 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2721,11 +2721,11 @@ static void update_sculpt_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int t
const Brush *brush = BKE_paint_brush(&sd->paint);
StrokeCache *cache = ob->sculpt->cache;
/* Grab brush does not update the sculpt normal during a stroke. */
- const bool update_normal = !(brush->flag & BRUSH_ORIGINAL_NORMAL) &&
- !(brush->sculpt_tool == SCULPT_TOOL_GRAB) &&
- !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) &&
- !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK &&
- cache->normal_weight > 0.0f);
+ const bool update_normal =
+ !(brush->flag & BRUSH_ORIGINAL_NORMAL) && !(brush->sculpt_tool == SCULPT_TOOL_GRAB) &&
+ !(brush->sculpt_tool == SCULPT_TOOL_THUMB && !(brush->flag & BRUSH_ANCHORED)) &&
+ !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) &&
+ !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && cache->normal_weight > 0.0f);
if (cache->mirror_symmetry_pass == 0 && cache->radial_symmetry_pass == 0 &&
(SCULPT_stroke_is_first_brush_step_of_symmetry_pass(cache) || update_normal)) {
More information about the Bf-blender-cvs
mailing list