diff options
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 7 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 2e98d463945..5e1a36e8873 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -6989,9 +6989,11 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, Po if (BKE_brush_use_size_pressure(scene, brush) && paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) { cache->radius = sculpt_brush_dynamic_size_get(brush, cache, cache->initial_radius); + cache->dyntopo_radius = cache->initial_radius * cache->pressure; } else { cache->radius = cache->initial_radius; + cache->dyntopo_radius = cache->initial_radius; } cache->radius_squared = cache->radius * cache->radius; @@ -7603,11 +7605,12 @@ static void sculpt_stroke_update_step(bContext *C, BKE_pbvh_bmesh_detail_size_set(ss->pbvh, object_space_constant_detail); } else if (sd->flags & SCULPT_DYNTOPO_DETAIL_BRUSH) { - BKE_pbvh_bmesh_detail_size_set(ss->pbvh, ss->cache->radius * sd->detail_percent / 100.0f); + BKE_pbvh_bmesh_detail_size_set(ss->pbvh, + ss->cache->dyntopo_radius * sd->detail_percent / 100.0f); } else { BKE_pbvh_bmesh_detail_size_set(ss->pbvh, - (ss->cache->radius / (float)ups->pixel_radius) * + (ss->cache->dyntopo_radius / (float)ups->pixel_radius) * (float)(sd->detail_size * U.pixelsize) / 0.4f); } diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 0b25ab31ce0..324ca250c86 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -318,6 +318,10 @@ typedef struct StrokeCache { float true_last_location[3]; float location[3]; float last_location[3]; + + /* This radius variable is not affected by pressure curves */ + float dyntopo_radius; + bool is_last_valid; bool pen_flip; |