Sculpt Expand: Fix texture strength when switching falloffs
This commit is contained in:
parent
5e56eb8ca2
commit
38e61c04ea
|
@ -1639,11 +1639,7 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *
|
|||
/* Transform Pivot. */
|
||||
if (pcontext->paint && pcontext->paint->flags & PAINT_SCULPT_SHOW_PIVOT) {
|
||||
cursor_draw_point_screen_space(
|
||||
pcontext->pos,
|
||||
pcontext->region,
|
||||
pcontext->ss->pivot_pos,
|
||||
pcontext->vc.obact->obmat,
|
||||
2);
|
||||
pcontext->pos, pcontext->region, pcontext->ss->pivot_pos, pcontext->vc.obact->obmat, 2);
|
||||
}
|
||||
|
||||
if (brush->sculpt_tool == SCULPT_TOOL_BOUNDARY) {
|
||||
|
|
|
@ -157,7 +157,8 @@ static float sculpt_expand_falloff_value_vertex_get(SculptSession *ss,
|
|||
const float avg = BKE_brush_sample_tex_3d(
|
||||
expand_cache->scene, expand_cache->brush, vertex_co, rgba, 0, ss->tex_pool);
|
||||
|
||||
const float distorsion = (avg - 0.5f) * expand_cache->texture_distorsion_strength;
|
||||
const float distorsion = (avg - 0.5f) * expand_cache->texture_distorsion_strength *
|
||||
expand_cache->max_falloff_factor;
|
||||
return expand_cache->falloff_factor[i] + distorsion;
|
||||
}
|
||||
|
||||
|
@ -171,7 +172,8 @@ static float sculpt_expand_max_vertex_falloff_factor_get(ExpandCache *expand_cac
|
|||
return expand_cache->max_falloff_factor;
|
||||
}
|
||||
|
||||
return expand_cache->max_falloff_factor + (0.5f * expand_cache->texture_distorsion_strength);
|
||||
return expand_cache->max_falloff_factor +
|
||||
(0.5f * expand_cache->texture_distorsion_strength * expand_cache->max_falloff_factor);
|
||||
}
|
||||
|
||||
static bool sculpt_expand_state_get(SculptSession *ss, ExpandCache *expand_cache, const int i)
|
||||
|
@ -868,12 +870,12 @@ static void sculpt_expand_cache_data_free(ExpandCache *expand_cache)
|
|||
MEM_SAFE_FREE(expand_cache);
|
||||
}
|
||||
|
||||
static void sculpt_expand_cache_free(SculptSession *ss) {
|
||||
sculpt_expand_cache_data_free(ss->expand_cache);
|
||||
ss->expand_cache = NULL;
|
||||
static void sculpt_expand_cache_free(SculptSession *ss)
|
||||
{
|
||||
sculpt_expand_cache_data_free(ss->expand_cache);
|
||||
ss->expand_cache = NULL;
|
||||
}
|
||||
|
||||
|
||||
static void sculpt_expand_restore_face_set_data(SculptSession *ss, ExpandCache *expand_cache)
|
||||
{
|
||||
PBVHNode **nodes;
|
||||
|
@ -1524,11 +1526,11 @@ static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event
|
|||
break;
|
||||
}
|
||||
case SCULPT_EXPAND_MODAL_TEXTURE_DISTORSION_INCREASE: {
|
||||
expand_cache->texture_distorsion_strength += expand_cache->max_falloff_factor * SCULPT_EXPAND_TEXTURE_DISTORSION_STEP;
|
||||
expand_cache->texture_distorsion_strength += SCULPT_EXPAND_TEXTURE_DISTORSION_STEP;
|
||||
break;
|
||||
}
|
||||
case SCULPT_EXPAND_MODAL_TEXTURE_DISTORSION_DECREASE: {
|
||||
expand_cache->texture_distorsion_strength -= expand_cache->max_falloff_factor * SCULPT_EXPAND_TEXTURE_DISTORSION_STEP;
|
||||
expand_cache->texture_distorsion_strength -= SCULPT_EXPAND_TEXTURE_DISTORSION_STEP;
|
||||
expand_cache->texture_distorsion_strength = max_ff(
|
||||
expand_cache->texture_distorsion_strength, 0.0f);
|
||||
break;
|
||||
|
|
|
@ -620,8 +620,7 @@ static void rna_def_paint(BlenderRNA *brna)
|
|||
|
||||
prop = RNA_def_property(srna, "show_sculpt_pivot", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SCULPT_SHOW_PIVOT);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Show Pivot", "Show Transform Tool Sculpt Pivot");
|
||||
RNA_def_property_ui_text(prop, "Show Pivot", "Show Transform Tool Sculpt Pivot");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "use_sculpt_delay_updates", PROP_BOOLEAN, PROP_NONE);
|
||||
|
|
Loading…
Reference in New Issue