diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-31 14:36:00 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-31 20:01:47 +0300 |
commit | 5c5de14ad70d14c05b63602a946a6e72a45d6a4f (patch) | |
tree | 357eadcc5b50163119f9ffd43d1f48647fffb728 /source/blender/editors | |
parent | 6075b0a4546248d1aa289b1309cc472d834c3f0a (diff) |
Cleanup: avoid some unnecessary inverse matrix math.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index f3a06988f1b..a9e5a243865 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5168,8 +5168,8 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st sculpt_restore_mesh(sd, ob); if (sd->flags & (SCULPT_DYNTOPO_DETAIL_CONSTANT | SCULPT_DYNTOPO_DETAIL_MANUAL)) { - float object_space_constant_detail = sd->constant_detail * mat4_to_scale(ob->imat); - BKE_pbvh_bmesh_detail_size_set(ss->pbvh, 1.0f / object_space_constant_detail); + float object_space_constant_detail = mat4_to_scale(ob->obmat) / sd->constant_detail; + 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); @@ -6115,8 +6115,8 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op)) size = max_fff(dim[0], dim[1], dim[2]); /* update topology size */ - float object_space_constant_detail = sd->constant_detail * mat4_to_scale(ob->imat); - BKE_pbvh_bmesh_detail_size_set(ss->pbvh, 1.0f / object_space_constant_detail); + float object_space_constant_detail = mat4_to_scale(ob->obmat) / sd->constant_detail; + BKE_pbvh_bmesh_detail_size_set(ss->pbvh, object_space_constant_detail); sculpt_undo_push_begin("Dynamic topology flood fill"); sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_COORDS); |