Fix T71868: Clay Strips brush collapsed geometry
We are now modifying the relation between pressure and radius using custom functions to improve the brushes, but dyntopo was not prepared for this. This fix sends the unmodified radius to dyntopo so it modifies the geometry correctly. Reviewed By: jbakker Maniphest Tasks: T71868 Differential Revision: https://developer.blender.org/D6299
This commit is contained in:
parent
c9e7d8030f
commit
e85ab2cdc2
Notes:
blender-bot
2023-02-14 00:09:01 +01:00
Referenced by issue #71868, Clay Strips brush Collapsed geometry
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue