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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user