Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-31 14:36:00 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-01-31 20:01:47 +0300
commit5c5de14ad70d14c05b63602a946a6e72a45d6a4f (patch)
tree357eadcc5b50163119f9ffd43d1f48647fffb728 /source
parent6075b0a4546248d1aa289b1309cc472d834c3f0a (diff)
Cleanup: avoid some unnecessary inverse matrix math.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/object_update.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index a716750ee73..5cf40cd13a4 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -282,7 +282,7 @@ void BKE_object_synchronize_to_original(Depsgraph *depsgraph, Object *object)
object_orig->base_flag = object->base_flag;
/* Transformation flags. */
copy_m4_m4(object_orig->obmat, object->obmat);
- invert_m4_m4(object_orig->imat, object_orig->obmat);
+ copy_m4_m4(object_orig->imat, object->imat);
copy_m4_m4(object_orig->constinv, object->constinv);
object_orig->transflag = object->transflag;
object_orig->flag = object->flag;
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);