[Bf-blender-cvs] [7b19b47cbf3] sculpt-dev: One more clay fix
Joseph Eagar
noreply at git.blender.org
Wed Sep 29 12:29:40 CEST 2021
Commit: 7b19b47cbf354baabf07e7aea18aa88cd218cda0
Author: Joseph Eagar
Date: Wed Sep 29 03:29:21 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB7b19b47cbf354baabf07e7aea18aa88cd218cda0
One more clay fix
===================================================================
M source/blender/blenkernel/intern/brush_engine.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_smooth.c
===================================================================
diff --git a/source/blender/blenkernel/intern/brush_engine.c b/source/blender/blenkernel/intern/brush_engine.c
index 59e29beb582..847e0dbaab1 100644
--- a/source/blender/blenkernel/intern/brush_engine.c
+++ b/source/blender/blenkernel/intern/brush_engine.c
@@ -1522,6 +1522,13 @@ void BKE_builtin_commandlist_create(Brush *brush,
ch->flag |= BRUSH_CHANNEL_INHERIT;
}
+ ch = BRUSHSET_LOOKUP(cmd->params, strength);
+ ch2 = BRUSHSET_LOOKUP(chset, autosmooth);
+
+ for (int j = 0; j < BRUSH_MAPPING_MAX; j++) {
+ BKE_brush_mapping_copy_data(ch->mappings + j, ch2->mappings + j);
+ }
+
int_set_uninherit(cmd->params, use_ctrl_invert, false);
float_set_uninherit(cmd->params, strength, autosmooth);
float_set_uninherit(cmd->params, radius, radius * autosmooth_scale);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 614ca8d6d33..62d66fcff12 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -9133,8 +9133,17 @@ static void SCULPT_run_command_list(
ss->cache->brush = &brush2;
- ss->cache->bstrength = brush_strength(
- sd, ss->cache, calc_symmetry_feather(sd, ss->cache), ups);
+ if (cmd->tool == SCULPT_TOOL_SMOOTH) {
+ ss->cache->bstrength = brush2.alpha;
+
+ if (ss->cache->invert && BRUSHSET_GET_INT(cmd->params_final, use_ctrl_invert, NULL)) {
+ ss->cache->bstrength = -ss->cache->bstrength;
+ }
+ }
+ else {
+ ss->cache->bstrength = brush_strength(
+ sd, ss->cache, calc_symmetry_feather(sd, ss->cache), ups);
+ }
brush2.alpha = fabs(ss->cache->bstrength);
@@ -9357,8 +9366,13 @@ static void SCULPT_run_command_list(
ss->cache->brush = brush2;
ups->alpha = BRUSHSET_GET_FLOAT(cmd->params_mapped, strength, NULL);
- ss->cache->bstrength = brush_strength(
- sd, ss->cache, calc_symmetry_feather(sd, ss->cache), ups);
+ if (cmd->tool == SCULPT_TOOL_SMOOTH) {
+ ss->cache->bstrength = brush2->alpha;
+ }
+ else {
+ ss->cache->bstrength = brush_strength(
+ sd, ss->cache, calc_symmetry_feather(sd, ss->cache), ups);
+ }
if (!BRUSHSET_GET_INT(cmd->params_mapped, use_ctrl_invert, NULL)) {
ss->cache->bstrength = fabsf(ss->cache->bstrength);
diff --git a/source/blender/editors/sculpt_paint/sculpt_smooth.c b/source/blender/editors/sculpt_paint/sculpt_smooth.c
index 3ae42cff3ad..aa39eb9e025 100644
--- a/source/blender/editors/sculpt_paint/sculpt_smooth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_smooth.c
@@ -74,21 +74,10 @@
#include <math.h>
#include <stdlib.h>
-#if 0
-ATTR_NO_OPT void SCULPT_neighbor_coords_average_interior(SculptSession *ss,
- float result[3],
- SculptVertRef vertex,
- float projection,
- float slide_fset,
- float bound_smooth,
- SculptCustomLayer *bound_scl,
- bool do_origco)
-#else
-ATTR_NO_OPT void SCULPT_neighbor_coords_average_interior(SculptSession *ss,
- float result[3],
- SculptVertRef vertex,
- SculptSmoothArgs *args)
-#endif
+void SCULPT_neighbor_coords_average_interior(SculptSession *ss,
+ float result[3],
+ SculptVertRef vertex,
+ SculptSmoothArgs *args)
{
float avg[3] = {0.0f, 0.0f, 0.0f};
More information about the Bf-blender-cvs
mailing list