diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-11-02 16:41:49 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-11-02 17:42:23 +0300 |
commit | 38c7fd36ff7a6eb4522a688d38faa086a6313ae6 (patch) | |
tree | ea1136a788b1d3db9d46f9a19900c396e30ce3f1 /source/blender/editors/transform | |
parent | 0fc958a174192b2b25c4187c170ec4a394dc308a (diff) |
Refactor: Rename Object->imat to Object->world_to_object
The goal is to improve clarity and readability, without
introducing big design changes.
Follows the recent obmat to object_to_world refactor: the
similar naming is used, and it is a run-time only rename,
meaning, there is no affect on .blend files.
This patch does not touch the redundant inversions. Those
can be removed in almost (if not all) cases, but it would
be the best to do it as a separate change.
Differential Revision: https://developer.blender.org/D16367
Diffstat (limited to 'source/blender/editors/transform')
3 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform_convert_particle.c b/source/blender/editors/transform/transform_convert_particle.c index f212f042773..e6ff730d4d1 100644 --- a/source/blender/editors/transform/transform_convert_particle.c +++ b/source/blender/editors/transform/transform_convert_particle.c @@ -95,7 +95,7 @@ static void createTransParticleVerts(bContext *UNUSED(C), TransInfo *t) unit_m4(mat); - invert_m4_m4(ob->imat, ob->object_to_world); + invert_m4_m4(ob->world_to_object, ob->object_to_world); for (i = 0, point = edit->points; i < edit->totpoint; i++, point++) { TransData *head, *tail; diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 2be210d24e7..71a449ad10c 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -751,7 +751,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, #define FOREACH_EDIT_OBJECT_BEGIN(ob_iter, use_mat_local) \ { \ - invert_m4_m4(obedit->imat, obedit->object_to_world); \ + invert_m4_m4(obedit->world_to_object, obedit->object_to_world); \ uint objects_len = 0; \ Object **objects = BKE_view_layer_array_from_objects_in_edit_mode( \ scene, view_layer, CTX_wm_view3d(C), &objects_len); \ @@ -780,7 +780,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, float mat_local[4][4]; if (use_mat_local) { - mul_m4_m4m4(mat_local, obedit->imat, ob_iter->object_to_world); + mul_m4_m4m4(mat_local, obedit->world_to_object, ob_iter->object_to_world); } BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) { @@ -800,7 +800,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, float mat_local[4][4]; if (use_mat_local) { - mul_m4_m4m4(mat_local, obedit->imat, ob_iter->object_to_world); + mul_m4_m4m4(mat_local, obedit->world_to_object, ob_iter->object_to_world); } LISTBASE_FOREACH (EditBone *, ebo, arm->edbo) { if (EBONE_VISIBLE(arm, ebo)) { @@ -833,7 +833,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, float mat_local[4][4]; if (use_mat_local) { - mul_m4_m4m4(mat_local, obedit->imat, ob_iter->object_to_world); + mul_m4_m4m4(mat_local, obedit->world_to_object, ob_iter->object_to_world); } nu = nurbs->first; @@ -893,7 +893,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, float mat_local[4][4]; if (use_mat_local) { - mul_m4_m4m4(mat_local, obedit->imat, ob_iter->object_to_world); + mul_m4_m4m4(mat_local, obedit->world_to_object, ob_iter->object_to_world); } LISTBASE_FOREACH (MetaElem *, ml, mb->editelems) { @@ -913,7 +913,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, float mat_local[4][4]; if (use_mat_local) { - mul_m4_m4m4(mat_local, obedit->imat, ob_iter->object_to_world); + mul_m4_m4m4(mat_local, obedit->world_to_object, ob_iter->object_to_world); } while (a--) { @@ -939,7 +939,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, } } else if (ob && (ob->mode & OB_MODE_POSE)) { - invert_m4_m4(ob->imat, ob->object_to_world); + invert_m4_m4(ob->world_to_object, ob->object_to_world); uint objects_len = 0; Object **objects = BKE_object_pose_array_get(scene, view_layer, v3d, &objects_len); @@ -954,7 +954,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C, float mat_local[4][4]; if (use_mat_local) { - mul_m4_m4m4(mat_local, ob->imat, ob_iter->object_to_world); + mul_m4_m4m4(mat_local, ob->world_to_object, ob_iter->object_to_world); } /* Use channels to get stats. */ diff --git a/source/blender/editors/transform/transform_mode_vert_slide.c b/source/blender/editors/transform/transform_mode_vert_slide.c index cc1ea188fbc..a54888fe515 100644 --- a/source/blender/editors/transform/transform_mode_vert_slide.c +++ b/source/blender/editors/transform/transform_mode_vert_slide.c @@ -444,9 +444,9 @@ void drawVertSlide(TransInfo *t) ED_view3d_win_to_delta(t->region, xy_delta, zfac, co_dest_3d); - invert_m4_m4(TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->imat, + invert_m4_m4(TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->world_to_object, TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->object_to_world); - mul_mat3_m4_v3(TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->imat, co_dest_3d); + mul_mat3_m4_v3(TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->world_to_object, co_dest_3d); add_v3_v3(co_dest_3d, curr_sv->co_orig_3d); |