[Bf-blender-cvs] [2d541b2e39f] sculpt-dev: Sculpt: fix shift-smooth strength option
Joseph Eagar
noreply at git.blender.org
Mon Oct 4 11:09:49 CEST 2021
Commit: 2d541b2e39f7b7108f75fb897f4bc5d13894eea9
Author: Joseph Eagar
Date: Mon Oct 4 02:09:08 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB2d541b2e39f7b7108f75fb897f4bc5d13894eea9
Sculpt: fix shift-smooth strength option
Finally fixed the last of what turned out
to be many bugs that were causing it
to be ignored.
===================================================================
M source/blender/blenkernel/intern/brush_engine.c
M source/blender/editors/sculpt_paint/sculpt.c
===================================================================
diff --git a/source/blender/blenkernel/intern/brush_engine.c b/source/blender/blenkernel/intern/brush_engine.c
index 73fd791a19a..4e8962ac413 100644
--- a/source/blender/blenkernel/intern/brush_engine.c
+++ b/source/blender/blenkernel/intern/brush_engine.c
@@ -1537,11 +1537,11 @@ void BKE_builtin_apply_hard_edge_mode(BrushChannelSet *chset, bool do_apply)
}
}
-void BKE_builtin_commandlist_create(Brush *brush,
- BrushChannelSet *chset,
- BrushCommandList *cl,
- int tool,
- BrushMappingData *mapdata)
+ATTR_NO_OPT void BKE_builtin_commandlist_create(Brush *brush,
+ BrushChannelSet *chset,
+ BrushCommandList *cl,
+ int tool,
+ BrushMappingData *mapdata)
{
BrushCommand *cmd;
BrushChannel *ch;
@@ -1560,9 +1560,8 @@ void BKE_builtin_commandlist_create(Brush *brush,
float radius = BKE_brush_channelset_get_float(chset, "radius", NULL);
- bool no_autosmooth = ELEM(
- brush->sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_MASK);
- bool no_rake = ELEM(brush->sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_MASK);
+ bool no_autosmooth = ELEM(tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_MASK);
+ bool no_rake = ELEM(tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_MASK);
;
/* build autosmooth command */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 76362b58b1f..1ec5035a223 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -8726,6 +8726,11 @@ void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings
ok = ok && !(brush->flag & (BRUSH_ANCHORED | BRUSH_DRAG_DOT));
+ if (ss->cache->alt_smooth && brush->sculpt_tool == SCULPT_TOOL_SMOOTH) {
+ float factor = BRUSHSET_GET_FLOAT(ss->cache->channels_final, smooth_strength_factor, NULL);
+ BRUSHSET_SET_FLOAT(ss->cache->channels_final, strength, factor);
+ }
+
if (ok) {
if (SCULPT_stroke_is_first_brush_step(ss->cache)) {
if (ss->cache->commandlist) {
@@ -8734,11 +8739,6 @@ void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings
BrushCommandList *list = ss->cache->commandlist = BKE_brush_commandlist_create();
- if (ss->cache->alt_smooth && brush->sculpt_tool == SCULPT_TOOL_SMOOTH) {
- float factor = BRUSHSET_GET_FLOAT(ss->cache->channels_final, smooth_strength_factor, NULL);
- BRUSHSET_SET_FLOAT(ss->cache->channels_final, strength, factor);
- }
-
BKE_builtin_commandlist_create(
brush, ss->cache->channels_final, list, brush->sculpt_tool, &ss->cache->input_mapping);
}
More information about the Bf-blender-cvs
mailing list