One more clay fix

This commit is contained in:
Joseph Eagar 2021-09-29 03:29:21 -07:00
parent 159211da8f
commit 7b19b47cbf
3 changed files with 29 additions and 19 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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};