Sculpt: fix clay brush

* BRUSH_MAPPING_INHERIT is now respected
  when unset.
* Also added inherit icon to
  input mapping curves ui.
This commit is contained in:
Joseph Eagar 2021-09-23 21:39:20 -07:00
parent aca54ad3e6
commit 33cd635a82
7 changed files with 212 additions and 44 deletions

View File

@ -171,12 +171,17 @@ class UnifiedPaintPanel:
path = ""
is_toolset = False
pressurech = ch
if ch.inherit or toolsettings_only:
sd = context.tool_settings.sculpt
#ensure channel exists in tool settings channel set
sd.channels.ensure(ch)
finalch = sd.channels.channels[prop_name]
if ch.mappings["PRESSURE"].inherit:
pressurech = finalch
is_toolset = True
path = "tool_settings.sculpt.channels.channels[\"%s\"]" % ch.idname
else:
@ -193,7 +198,7 @@ class UnifiedPaintPanel:
props.channel = ch.idname
props.direction = 1
if ui_editing:
if ui_editing and not header:
row.prop(ch, "show_in_workspace", text="", icon="HIDE_OFF")
#row.prop(ch, "ui_order", text="")
@ -226,7 +231,7 @@ class UnifiedPaintPanel:
pressure = pressure and ch.type not in ["BOOL", "ENUM", "BITMASK", "CURVE"]
if pressure:
row.prop(finalch.mappings["PRESSURE"], "enabled", text="", icon="STYLUS_PRESSURE")
row.prop(pressurech.mappings["PRESSURE"], "enabled", text="", icon="STYLUS_PRESSURE")
#if pressure_name:
@ -251,7 +256,11 @@ class UnifiedPaintPanel:
row.prop(ch, "ui_expanded", text="", icon="TRIA_DOWN" if ch.ui_expanded else "TRIA_RIGHT")
if ch.ui_expanded:
for mp in finalch.mappings:
for i, mp in enumerate(ch.mappings):
mp0 = mp
if mp.inherit:
mp = finalch.mappings[i]
row2 = layout.row()
name = mp.type.lower()
@ -261,8 +270,9 @@ class UnifiedPaintPanel:
name = "name error"
row2.label(text=name)
row2.prop(mp0, "inherit", text="", icon="BRUSHES_ALL")
row2.prop(mp, "enabled", text="", icon="STYLUS_PRESSURE")
row2.prop(mp, "ui_expanded", text="", icon="TRIA_DOWN" if mp.ui_expanded else "TRIA_RIGHT")
row2.prop(mp0, "ui_expanded", text="", icon="TRIA_DOWN" if mp.ui_expanded else "TRIA_RIGHT")
if mp.ui_expanded:
layout.template_curve_mapping(mp, "curve", brush=True)

View File

@ -55,7 +55,7 @@ struct Sculpt;
#define MAKE_BUILTIN_CH_NAME(idname) BRUSH_BUILTIN_##idname
/*these macros check channel names at compile time*/
/* these macros check channel names at compile time */
#define BRUSHSET_LOOKUP(chset, channel) \
BKE_brush_channelset_lookup(chset, MAKE_BUILTIN_CH_NAME(channel))
@ -67,6 +67,10 @@ struct Sculpt;
BKE_brush_channelset_get_int(chset, MAKE_BUILTIN_CH_NAME(channel), mapdata)
#define BRUSHSET_ENSURE_BUILTIN(chset, channel) \
BKE_brush_channelset_ensure_builtin(chset, MAKE_BUILTIN_CH_NAME(channel))
#define BRUSHSET_SET_FLOAT(chset, channel, val) \
BKE_brush_channelset_set_float(chset, MAKE_BUILTIN_CH_NAME(channel), val)
#define BRUSHSET_SET_INT(chset, channel, val) \
BKE_brush_channelset_set_int(chset, MAKE_BUILTIN_CH_NAME(channel), val)
//#define DEBUG_CURVE_MAPPING_ALLOC
#ifdef DEBUG_CURVE_MAPPING_ALLOC
@ -134,7 +138,7 @@ typedef struct BrushCommandList {
void BKE_brush_channel_free_data(BrushChannel *ch);
void BKE_brush_channel_free(BrushChannel *ch);
void BKE_brush_channel_copy_data(BrushChannel *dst, BrushChannel *src);
void BKE_brush_channel_copy_data(BrushChannel *dst, BrushChannel *src, bool keep_mappings);
void BKE_brush_channel_init(BrushChannel *ch, BrushChannelType *def);
BrushChannelSet *BKE_brush_channelset_create();

View File

@ -74,10 +74,14 @@ places in rna_engine_codebase are relevent:
# define MAKE_FLOAT_EX(idname, name, tooltip, val, min, max, smin, smax, pressure_enabled) \
MAKE_BUILTIN_CH_DEF(idname)
# define MAKE_FLOAT_EX_FLAG( \
idname, name, tooltip, val, min, max, smin, smax, pressure_enabled, flag) \
MAKE_BUILTIN_CH_DEF(idname)
# define MAKE_FLOAT_EX_INV(idname, name, tooltip, val, min, max, smin, smax, pressure_enabled) \
MAKE_BUILTIN_CH_DEF(idname)
# define MAKE_FLOAT_EX_EX( \
idname, name, tooltip, val, min, max, smin, smax, pressure_enabled, inv) \
idname, name, tooltip, val, min, max, smin, smax, pressure_enabled, inv, flag) \
MAKE_BUILTIN_CH_DEF(idname)
# define MAKE_FLOAT(idname, name, tooltip, val, min, max) MAKE_BUILTIN_CH_DEF(idname);
# define MAKE_INT_EX(idname, name, tooltip, val, min, max, smin, smax) \
@ -112,8 +116,8 @@ places in rna_engine_codebase are relevent:
"used for smoothing", 1.0f, 0.001f, 5.0f, 0.01f, 2.0f, false)
MAKE_FLOAT_EX(topology_rake_radius_scale, "Radius Scale", "Ratio between the brush radius and the radius that is going to be "
"used for topology rake", 1.0f, 0.001f, 5.0f, 0.01f, 2.0f, false)
MAKE_FLOAT_EX(dyntopo_radius_scale, "Radius Scale", "Ratio between the brush radius and the radius that is going to be "
"used for DynTopo", 1.0f, 0.001f, 5.0f, 0.01f, 2.0f, false)
MAKE_FLOAT_EX_FLAG(dyntopo_radius_scale, "Radius Scale", "Ratio between the brush radius and the radius that is going to be "
"used for DynTopo", 1.0f, 0.001f, 5.0f, 0.01f, 2.0f, false, BRUSH_CHANNEL_INHERIT)
MAKE_FLOAT_EX(projection, "Projection", "Amount of volume preserving projection", 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, false)
MAKE_FLOAT_EX(autosmooth_projection, "Projection", "Amount of volume preserving projection", 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, false)
MAKE_FLOAT_EX(topology_rake_projection, "Projection", "Amount of volume preserving projection", 0.975f, 0.0f, 1.0f, 0.0f, 1.0f, false)
@ -140,7 +144,7 @@ places in rna_engine_codebase are relevent:
}), BRUSH_CHANNEL_INHERIT_IF_UNSET)
MAKE_BOOL_EX(dyntopo_disabled, "Disable Dyntopo", "", false, BRUSH_CHANNEL_NO_MAPPINGS)
MAKE_FLAGS_EX(dyntopo_mode, "Dyntopo Operators", "s", DYNTOPO_COLLAPSE|DYNTOPO_CLEANUP|DYNTOPO_SUBDIVIDE, _({\
MAKE_FLAGS_EX(dyntopo_mode, "Dyntopo Operators", "", DYNTOPO_COLLAPSE|DYNTOPO_CLEANUP|DYNTOPO_SUBDIVIDE, _({
{DYNTOPO_COLLAPSE, "COLLAPSE", ICON_NONE, "Collapse", ""},
{DYNTOPO_SUBDIVIDE, "SUBDIVIDE", ICON_NONE, "Subdivide", ""},
{DYNTOPO_CLEANUP, "CLEANUP", ICON_NONE, "Cleanup", ""},
@ -148,7 +152,7 @@ places in rna_engine_codebase are relevent:
{DYNTOPO_LOCAL_SUBDIVIDE, "LOCAL_SUBDIVIDE", ICON_NONE, "Local Subdivide", ""},
{-1}
}), BRUSH_CHANNEL_INHERIT)
MAKE_ENUM(slide_deform_type, "Slide Deform Type", "", BRUSH_SLIDE_DEFORM_DRAG, _({\
MAKE_ENUM(slide_deform_type, "Slide Deform Type", "", BRUSH_SLIDE_DEFORM_DRAG, _({
{BRUSH_SLIDE_DEFORM_DRAG, "DRAG", ICON_NONE, "Drag", ""},
{BRUSH_SLIDE_DEFORM_PINCH, "PINCH", ICON_NONE, "Pinch", ""},
{BRUSH_SLIDE_DEFORM_EXPAND, "EXPAND", ICON_NONE, "Expand", ""},
@ -159,7 +163,7 @@ places in rna_engine_codebase are relevent:
MAKE_FLOAT(hardness, "Hardness", "Brush falloff hardness", 0.0f, 0.0f, 1.0f)
MAKE_FLOAT(tip_roundness, "Tip Roundness", "", 0.0f, 0.0f, 1.0f)
MAKE_BOOL(accumulate, "Accumulate", "", false)
MAKE_ENUM(direction, "Direction", "", 0, _({\
MAKE_ENUM(direction, "Direction", "", 0, _({
{0, "ADD", "ADD", "Add", "Add effect of brush"},
{1, "SUBTRACT", "REMOVE", "Subtract", "Subtract effect of brush"},
{-1}
@ -186,11 +190,11 @@ MAKE_BOOL(use_weighted_smooth, "Weight By Area", "Weight by face area to get a s
MAKE_BOOL(preserve_faceset_boundary, "Preserve Faceset Boundary", "Preserve face set boundaries", true)
MAKE_BOOL(hard_edge_mode, "Hard Edge Mode", "Forces all brushes into hard edge face set mode (sets face set slide to 0)", false)
MAKE_BOOL(grab_silhouette, "Grab Silhouette", "Grabs trying to automask the silhouette of the object", false)
MAKE_FLOAT(dyntopo_detail_percent, "Detail Percent", "Detail Percent", 25.0f, 0.0f, 1000.0f)
MAKE_FLOAT(dyntopo_detail_range, "Detail Range", "Detail Range", 0.45f, 0.01f, 0.99f)
MAKE_FLOAT_EX(dyntopo_detail_size, "Detail Size", "Detail Size", 8.0f, 0.1f, 100.0f, 0.001f, 500.0f, false)
MAKE_FLOAT_EX(dyntopo_constant_detail, "Constaint Detail", "", 3.0f, 0.001f, 1000.0f, 0.0001, FLT_MAX, false)
MAKE_FLOAT_EX(dyntopo_spacing, "Spacing", "Dyntopo Spacing", 35.0f, 0.01f, 300.0f, 0.001f, 50000.0f, false)
MAKE_FLOAT_EX_FLAG(dyntopo_detail_percent, "Detail Percent", "Detail Percent", 25.0f, 0.0f, 1000.0f, 0.0f, 1000.0f, false, BRUSH_CHANNEL_INHERIT)
MAKE_FLOAT_EX_FLAG(dyntopo_detail_range, "Detail Range", "Detail Range", 0.45f, 0.01f, 0.99f, 0.01f, 0.99f, false, BRUSH_CHANNEL_INHERIT)
MAKE_FLOAT_EX_FLAG(dyntopo_detail_size, "Detail Size", "Detail Size", 8.0f, 0.1f, 100.0f, 0.001f, 500.0f, false, BRUSH_CHANNEL_INHERIT)
MAKE_FLOAT_EX_FLAG(dyntopo_constant_detail, "Constaint Detail", "", 3.0f, 0.001f, 1000.0f, 0.0001, FLT_MAX, false, BRUSH_CHANNEL_INHERIT)
MAKE_FLOAT_EX_FLAG(dyntopo_spacing, "Spacing", "Dyntopo Spacing", 35.0f, 0.01f, 300.0f, 0.001f, 50000.0f, false, BRUSH_CHANNEL_INHERIT)
MAKE_FLOAT(concave_mask_factor, "Cavity Factor", "", 0.35f, 0.0f, 1.0f)
MAKE_INT_EX(automasking_boundary_edges_propagation_steps, "Propagation Steps",
"Distance where boundary edge automasking is going to protect vertices "

View File

@ -229,8 +229,63 @@ ATTR_NO_OPT void BKE_brush_channel_free(BrushChannel *ch)
MEM_freeN(ch);
}
ATTR_NO_OPT void BKE_brush_channel_copy_data(BrushChannel *dst, BrushChannel *src)
ATTR_NO_OPT static void copy_channel_data_keep_mappings(BrushChannel *dst, BrushChannel *src)
{
BLI_strncpy(dst->name, src->name, sizeof(dst->name));
BLI_strncpy(dst->idname, src->idname, sizeof(dst->idname));
dst->def = src->def;
dst->flag = src->flag;
dst->type = src->type;
dst->ui_order = src->ui_order;
switch (src->type) {
case BRUSH_CHANNEL_CURVE:
dst->curve.preset = src->curve.preset;
if (dst->curve.curve && IS_CACHE_CURVE(dst->curve.curve)) {
RELEASE_CACHE_CURVE(dst->curve.curve);
}
else if (dst->curve.curve) {
BKE_curvemapping_free(dst->curve.curve);
}
if (src->curve.curve && !IS_CACHE_CURVE(src->curve.curve)) {
dst->curve.curve = BKE_curvemapping_cache_get(
BKE_curvemapping_cache_global(), src->curve.curve, false);
}
else {
dst->curve.curve = src->curve.curve;
if (dst->curve.curve) {
CURVE_ADDREF(dst->curve.curve);
}
}
break;
case BRUSH_CHANNEL_FLOAT:
dst->fvalue = src->fvalue;
break;
case BRUSH_CHANNEL_BOOL:
case BRUSH_CHANNEL_ENUM:
case BRUSH_CHANNEL_BITMASK:
case BRUSH_CHANNEL_INT:
dst->ivalue = src->ivalue;
break;
case BRUSH_CHANNEL_VEC3:
case BRUSH_CHANNEL_VEC4:
copy_v4_v4(dst->vector, src->vector);
break;
}
}
ATTR_NO_OPT void BKE_brush_channel_copy_data(BrushChannel *dst,
BrushChannel *src,
bool keep_mapping)
{
if (keep_mapping) {
copy_channel_data_keep_mappings(dst, src);
return;
}
if (src->type == BRUSH_CHANNEL_CURVE) {
if (dst->curve.curve && IS_CACHE_CURVE(dst->curve.curve)) {
RELEASE_CACHE_CURVE(dst->curve.curve);
@ -513,7 +568,7 @@ ATTR_NO_OPT void BKE_brush_channelset_add_duplicate(BrushChannelSet *chset, Brus
BrushChannel *chnew = MEM_callocN(sizeof(*chnew), "brush channel copy");
#endif
BKE_brush_channel_copy_data(chnew, ch);
BKE_brush_channel_copy_data(chnew, ch, false);
BKE_brush_channelset_add(chset, chnew);
namestack_pop(NULL);
@ -641,7 +696,7 @@ ATTR_NO_OPT void BKE_brush_channelset_merge(BrushChannelSet *dst,
BKE_brush_channelset_add_duplicate(dst, ch);
}
else {
BKE_brush_channel_copy_data(ch2, ch);
BKE_brush_channel_copy_data(ch2, ch, false);
}
}
}
@ -657,8 +712,7 @@ ATTR_NO_OPT void BKE_brush_channelset_merge(BrushChannelSet *dst,
}
if (ch->flag & BRUSH_CHANNEL_INHERIT) {
BKE_brush_channel_copy_data(mch, pch);
continue;
BKE_brush_channel_copy_data(mch, pch, true);
}
/*apply mapping inheritance flags, which are respected
@ -671,6 +725,10 @@ ATTR_NO_OPT void BKE_brush_channelset_merge(BrushChannelSet *dst,
}
}
if (ch->flag & BRUSH_CHANNEL_INHERIT) {
continue;
}
if (ch->type == BRUSH_CHANNEL_BITMASK && (ch->flag & BRUSH_CHANNEL_INHERIT_IF_UNSET)) {
mch->ivalue = ch->ivalue | pch->ivalue;
}

View File

@ -57,7 +57,7 @@ To enable converting to/from old data:
#define ICON_NONE "NONE"
/* clang-format off */
#define MAKE_FLOAT_EX_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled, pressure_inv) \
#define MAKE_FLOAT_EX_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled, pressure_inv, flag1) \
{.name = name1, \
.idname = #idname1, \
.fvalue = value1,\
@ -65,6 +65,7 @@ To enable converting to/from old data:
.min = min1,\
.max = max1,\
.soft_min = smin1,\
.flag = flag1,\
.soft_max = smax1,\
.type = BRUSH_CHANNEL_FLOAT,\
.mappings = {\
@ -72,9 +73,12 @@ To enable converting to/from old data:
}\
},
#define MAKE_FLOAT_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled)\
MAKE_FLOAT_EX_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled, false)
MAKE_FLOAT_EX_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled, false, 0)
#define MAKE_FLOAT_EX_INV(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled)\
MAKE_FLOAT_EX_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled, true)
MAKE_FLOAT_EX_EX(idname1, name1, tooltip1, value1, min1, max1, smin1, smax1, pressure_enabled, true, 0)
#define MAKE_FLOAT_EX_FLAG( \
idname, name, tooltip, val, min, max, smin, smax, pressure_enabled, flag) MAKE_FLOAT_EX_EX(idname, name, tooltip, val, min, max, smin, smax, pressure_enabled, false, flag)
#define MAKE_FLOAT(idname, name, tooltip, value, min, max) MAKE_FLOAT_EX(idname, name, tooltip, value, min, max, min, max, false)
@ -604,17 +608,101 @@ ATTR_NO_OPT void BKE_brush_channelset_compat_load(BrushChannelSet *chset,
BKE_brush_channelset_set_int(chset, "dyntopo_mode", brush->dyntopo.flag & mask);
BKE_brush_channelset_set_int(
chset, "dyntopo_mode", brush->dyntopo.flag & DYNTOPO_DISABLED ? 1 : 0);
chset, "dyntopo_disabled", brush->dyntopo.flag & DYNTOPO_DISABLED ? 1 : 0);
#define SETCH(key, val) BKE_brush_channelset_set_float(chset, #key, val)
SETCH(dyntopo_detail_range, brush->dyntopo.detail_range);
SETCH(dyntopo_detail_percent, brush->dyntopo.detail_percent);
SETCH(dyntopo_detail_size, brush->dyntopo.detail_size);
SETCH(dyntopo_constant_detail, brush->dyntopo.constant_detail);
SETCH(dyntopo_spacing, brush->dyntopo.spacing);
BRUSHSET_SET_FLOAT(chset, dyntopo_detail_range, brush->dyntopo.detail_range);
BRUSHSET_SET_FLOAT(chset, dyntopo_detail_percent, brush->dyntopo.detail_percent);
BRUSHSET_SET_FLOAT(chset, dyntopo_detail_size, brush->dyntopo.detail_size);
BRUSHSET_SET_FLOAT(chset, dyntopo_constant_detail, brush->dyntopo.constant_detail);
BRUSHSET_SET_FLOAT(chset, dyntopo_spacing, brush->dyntopo.spacing);
}
/* pen pressure flags */
if (brush_to_channels) {
if (brush->flag & BRUSH_SIZE_PRESSURE) {
BRUSHSET_LOOKUP(chset, radius)->mappings[BRUSH_MAPPING_PRESSURE].flag |=
BRUSH_MAPPING_ENABLED;
}
else {
BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag &=
~BRUSH_MAPPING_ENABLED;
}
if (brush->flag & BRUSH_ALPHA_PRESSURE) {
BRUSHSET_LOOKUP(chset, strength)->mappings[BRUSH_MAPPING_PRESSURE].flag |=
BRUSH_MAPPING_ENABLED;
}
else {
BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag &=
~BRUSH_MAPPING_ENABLED;
}
if (brush->flag & BRUSH_JITTER_PRESSURE) {
BRUSHSET_LOOKUP(chset, jitter)->mappings[BRUSH_MAPPING_PRESSURE].flag |=
BRUSH_MAPPING_ENABLED;
}
else {
BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag &=
~BRUSH_MAPPING_ENABLED;
}
if (brush->flag & BRUSH_SPACING_PRESSURE) {
BRUSHSET_LOOKUP(chset, spacing)->mappings[BRUSH_MAPPING_PRESSURE].flag |=
BRUSH_MAPPING_ENABLED;
}
else {
BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag &=
~BRUSH_MAPPING_ENABLED;
}
if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) {
BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag |=
BRUSH_MAPPING_INVERT;
}
else {
BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag &=
~BRUSH_MAPPING_INVERT;
}
}
else {
if (BRUSHSET_LOOKUP(chset, radius)->mappings[BRUSH_MAPPING_PRESSURE].flag &
BRUSH_MAPPING_ENABLED) {
brush->flag |= BRUSH_SIZE_PRESSURE;
}
else {
brush->flag &= ~BRUSH_SIZE_PRESSURE;
}
if (BRUSHSET_LOOKUP(chset, strength)->mappings[BRUSH_MAPPING_PRESSURE].flag &
BRUSH_MAPPING_ENABLED) {
brush->flag |= BRUSH_ALPHA_PRESSURE;
}
else {
brush->flag &= ~BRUSH_ALPHA_PRESSURE;
}
if (BRUSHSET_LOOKUP(chset, jitter)->mappings[BRUSH_MAPPING_PRESSURE].flag &
BRUSH_MAPPING_ENABLED) {
brush->flag |= BRUSH_JITTER_PRESSURE;
}
else {
brush->flag &= ~BRUSH_JITTER_PRESSURE;
}
if (BRUSHSET_LOOKUP(chset, spacing)->mappings[BRUSH_MAPPING_PRESSURE].flag &
BRUSH_MAPPING_ENABLED) {
brush->flag |= BRUSH_SPACING_PRESSURE;
}
else {
brush->flag &= ~BRUSH_SPACING_PRESSURE;
}
if (BRUSHSET_LOOKUP(chset, autosmooth)->mappings[BRUSH_MAPPING_PRESSURE].flag &
BRUSH_MAPPING_INVERT) {
brush->flag |= BRUSH_INVERSE_SMOOTH_PRESSURE;
}
else {
brush->flag &= ~BRUSH_INVERSE_SMOOTH_PRESSURE;
}
}
}
#undef SETCH
// adds any missing channels to brushes
void BKE_brush_builtin_patch(Brush *brush, int tool)
@ -894,6 +982,8 @@ ATTR_NO_OPT void BKE_brush_builtin_create(Brush *brush, int tool)
break;
case SCULPT_TOOL_CLAY_STRIPS: {
GETCH(radius)->mappings[BRUSH_MAPPING_PRESSURE].flag |= BRUSH_MAPPING_ENABLED;
GETCH(strength)->mappings[BRUSH_MAPPING_PRESSURE].flag |= BRUSH_MAPPING_ENABLED;
GETCH(tip_roundness)->fvalue = 0.18f;
GETCH(normal_radius_factor)->fvalue = 1.35f;
GETCH(strength)->fvalue = 0.8f;

View File

@ -7346,6 +7346,8 @@ static void do_clay_strips_brush_task_cb_ex(void *__restrict userdata,
}
}
BKE_pbvh_vertex_iter_end;
BKE_pbvh_node_mark_update(data->nodes[n]);
}
static void do_clay_strips_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
@ -8951,16 +8953,14 @@ ATTR_NO_OPT static void SCULPT_run_command_list(
float radius = BRUSHSET_GET_FLOAT(
ss->cache->channels_final, radius, &ss->cache->input_mapping);
radius = paint_calc_object_space_radius(ss->cache->vc, ss->cache->true_location, radius);
radius_max = max_ff(radius_max, radius);
ss->cache->brush = brush;
}
float ratio = radius_max /
BRUSHSET_GET_FLOAT(ss->cache->channels_final, radius, &ss->cache->input_mapping);
ss->cache->radius = start_radius * ratio;
ss->cache->radius_squared = start_radius * start_radius * ratio * ratio;
ss->cache->radius = radius_max;
ss->cache->radius_squared = radius_max * radius_max;
/* Check for unsupported features. */
PBVHType type = BKE_pbvh_type(ss->pbvh);
@ -9096,16 +9096,18 @@ ATTR_NO_OPT static void SCULPT_run_command_list(
for (int step = 0; step < list->totcommand; step++) {
BrushCommand *cmd = list->commands + step;
float radius = BRUSHSET_GET_FLOAT(cmd->params_final, radius, NULL);
BKE_brush_channelset_free(cmd->params_mapped);
cmd->params_mapped = BKE_brush_channelset_copy(cmd->params_final);
BKE_brush_channelset_apply_mapping(cmd->params_mapped, &ss->cache->input_mapping);
float radius = BRUSHSET_GET_FLOAT(cmd->params_mapped, radius, NULL);
radius = paint_calc_object_space_radius(ss->cache->vc, ss->cache->true_location, radius);
ss->cache->radius = radius;
ss->cache->radius_squared = radius * radius;
radius_scale = 1.0f;
ss->cache->initial_radius = radius;
BKE_brush_channelset_free(cmd->params_mapped);
cmd->params_mapped = BKE_brush_channelset_copy(cmd->params_final);
BKE_brush_channelset_apply_mapping(cmd->params_mapped, &ss->cache->input_mapping);
radius_scale = 1.0f;
float spacing = BRUSHSET_GET_FLOAT(cmd->params_mapped, spacing, NULL) / 100.0f;

View File

@ -67,7 +67,7 @@ int rna_BrushChannelSet_channels_assignint(struct PointerRNA *ptr,
BrushChannel *ch = BLI_findlink(&chset->channels, key);
if (ch) {
BKE_brush_channel_copy_data(ch, src);
BKE_brush_channel_copy_data(ch, src, false);
}
return 1;