diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-30 11:14:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-30 11:18:30 +0300 |
commit | c57b0cae2811f33b0bf3edd9bc76ab01671289e6 (patch) | |
tree | 55927bd051b9cb4ea7734b971ad935ea779fe899 | |
parent | 4f9ef65dace0527f85d528662a953d436e8efc0d (diff) |
Cleanup: rename transform mode variables
Use the term 'mat_final' for calculated matrices used for transforming.
Also rename 'pivot' to 'pivot_local'.
4 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/editors/transform/transform_mode_shear.c b/source/blender/editors/transform/transform_mode_shear.c index ab5dd11a926..f5672887905 100644 --- a/source/blender/editors/transform/transform_mode_shear.c +++ b/source/blender/editors/transform/transform_mode_shear.c @@ -54,23 +54,23 @@ struct TransDataArgs_Shear { const TransInfo *t; const TransDataContainer *tc; - float totmat[3][3]; + float mat_final[3][3]; bool is_local_center; }; static void transdata_elem_shear(const TransInfo *t, const TransDataContainer *tc, TransData *td, - const float totmat[3][3], + const float mat_final[3][3], const bool is_local_center) { float tmat[3][3]; const float *center; if (t->flag & T_EDIT) { - mul_m3_series(tmat, td->smtx, totmat, td->mtx); + mul_m3_series(tmat, td->smtx, mat_final, td->mtx); } else { - copy_m3_m3(tmat, totmat); + copy_m3_m3(tmat, mat_final); } if (is_local_center) { @@ -112,7 +112,7 @@ static void transdata_elem_shear_fn(void *__restrict iter_data_v, if (td->flag & TD_SKIP) { return; } - transdata_elem_shear(data->t, data->tc, td, data->totmat, data->is_local_center); + transdata_elem_shear(data->t, data->tc, td, data->mat_final, data->is_local_center); } /** \} */ @@ -191,7 +191,7 @@ static eRedrawFlag handleEventShear(TransInfo *t, const wmEvent *event) static void applyShear(TransInfo *t, const int UNUSED(mval[2])) { - float smat[3][3], totmat[3][3], axismat[3][3], axismat_inv[3][3]; + float smat[3][3], axismat[3][3], axismat_inv[3][3], mat_final[3][3]; float value; int i; char str[UI_MAX_DRAW_STR]; @@ -230,7 +230,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2])) cross_v3_v3v3(axismat_inv[1], axismat_inv[0], axismat_inv[2]); invert_m3_m3(axismat, axismat_inv); - mul_m3_series(totmat, axismat_inv, smat, axismat); + mul_m3_series(mat_final, axismat_inv, smat, axismat); FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->data_len < TRANSDATA_THREAD_LIMIT) { @@ -239,7 +239,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2])) if (td->flag & TD_SKIP) { continue; } - transdata_elem_shear(t, tc, td, totmat, is_local_center); + transdata_elem_shear(t, tc, td, mat_final, is_local_center); } } else { @@ -248,7 +248,7 @@ static void applyShear(TransInfo *t, const int UNUSED(mval[2])) .tc = tc, .is_local_center = is_local_center, }; - copy_m3_m3(data.totmat, totmat); + copy_m3_m3(data.mat_final, mat_final); TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); diff --git a/source/blender/editors/transform/transform_mode_skin_resize.c b/source/blender/editors/transform/transform_mode_skin_resize.c index 45336602c5a..0a7eea8a989 100644 --- a/source/blender/editors/transform/transform_mode_skin_resize.c +++ b/source/blender/editors/transform/transform_mode_skin_resize.c @@ -48,7 +48,7 @@ struct TransDataArgs_SkinResize { const TransInfo *t; const TransDataContainer *tc; - float mat[3][3]; + float mat_final[3][3]; }; static void transdata_elem_skin_resize(const TransInfo *t, @@ -85,7 +85,7 @@ static void transdata_elem_skin_resize_fn(void *__restrict iter_data_v, if (td->flag & TD_SKIP) { return; } - transdata_elem_skin_resize(data->t, data->tc, td, data->mat); + transdata_elem_skin_resize(data->t, data->tc, td, data->mat_final); } /** \} */ @@ -96,7 +96,7 @@ static void transdata_elem_skin_resize_fn(void *__restrict iter_data_v, static void applySkinResize(TransInfo *t, const int UNUSED(mval[2])) { - float mat[3][3]; + float mat_final[3][3]; int i; char str[UI_MAX_DRAW_STR]; @@ -115,7 +115,7 @@ static void applySkinResize(TransInfo *t, const int UNUSED(mval[2])) applySnapping(t, t->values_final); } - size_to_mat3(mat, t->values_final); + size_to_mat3(mat_final, t->values_final); headerResize(t, t->values_final, str, sizeof(str)); @@ -126,7 +126,7 @@ static void applySkinResize(TransInfo *t, const int UNUSED(mval[2])) if (td->flag & TD_SKIP) { continue; } - transdata_elem_skin_resize(t, tc, td, mat); + transdata_elem_skin_resize(t, tc, td, mat_final); } } else { @@ -134,7 +134,7 @@ static void applySkinResize(TransInfo *t, const int UNUSED(mval[2])) .t = t, .tc = tc, }; - copy_m3_m3(data.mat, mat); + copy_m3_m3(data.mat_final, mat_final); TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); BLI_task_parallel_range(0, tc->data_len, &data, transdata_elem_skin_resize_fn, &settings); diff --git a/source/blender/editors/transform/transform_mode_trackball.c b/source/blender/editors/transform/transform_mode_trackball.c index 157283d08da..68177c6becf 100644 --- a/source/blender/editors/transform/transform_mode_trackball.c +++ b/source/blender/editors/transform/transform_mode_trackball.c @@ -52,7 +52,7 @@ struct TransDataArgs_Trackball { const TransDataContainer *tc; const float axis[3]; const float angle; - float mat[3][3]; + float mat_final[3][3]; }; static void transdata_elem_trackball(const TransInfo *t, @@ -60,15 +60,15 @@ static void transdata_elem_trackball(const TransInfo *t, TransData *td, const float axis[3], const float angle, - const float mat[3][3]) + const float mat_final[3][3]) { float mat_buf[3][3]; - const float(*mat_final)[3] = mat; + const float(*mat)[3] = mat_final; if (t->flag & T_PROP_EDIT) { axis_angle_normalized_to_mat3(mat_buf, axis, td->factor * angle); - mat_final = mat_buf; + mat = mat_buf; } - ElementRotation(t, tc, td, mat_final, t->around); + ElementRotation(t, tc, td, mat, t->around); } static void transdata_elem_trackball_fn(void *__restrict iter_data_v, @@ -80,7 +80,7 @@ static void transdata_elem_trackball_fn(void *__restrict iter_data_v, if (td->flag & TD_SKIP) { return; } - transdata_elem_trackball(data->t, data->tc, td, data->axis, data->angle, data->mat); + transdata_elem_trackball(data->t, data->tc, td, data->axis, data->angle, data->mat_final); } /** \} */ @@ -94,7 +94,7 @@ static void applyTrackballValue(TransInfo *t, const float axis2[3], const float angles[2]) { - float mat[3][3]; + float mat_final[3][3]; float axis[3]; float angle; int i; @@ -102,7 +102,7 @@ static void applyTrackballValue(TransInfo *t, mul_v3_v3fl(axis, axis1, angles[0]); madd_v3_v3fl(axis, axis2, angles[1]); angle = normalize_v3(axis); - axis_angle_normalized_to_mat3(mat, axis, angle); + axis_angle_normalized_to_mat3(mat_final, axis, angle); FOREACH_TRANS_DATA_CONTAINER (t, tc) { if (tc->data_len < TRANSDATA_THREAD_LIMIT) { @@ -111,7 +111,7 @@ static void applyTrackballValue(TransInfo *t, if (td->flag & TD_SKIP) { continue; } - transdata_elem_trackball(t, tc, td, axis, angle, mat); + transdata_elem_trackball(t, tc, td, axis, angle, mat_final); } } else { @@ -121,7 +121,7 @@ static void applyTrackballValue(TransInfo *t, .axis = {UNPACK3(axis)}, .angle = angle, }; - copy_m3_m3(data.mat, mat); + copy_m3_m3(data.mat_final, mat_final); TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index 55bfedf26b8..541237fb64c 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -59,7 +59,7 @@ struct TransDataArgs_Translate { const TransInfo *t; const TransDataContainer *tc; - const float tc_pivot[3]; + const float pivot_local[3]; const float vec[3]; bool apply_snap_align_rotation; bool is_valid_snapping_normal; @@ -68,7 +68,7 @@ struct TransDataArgs_Translate { static void transdata_elem_translate(const TransInfo *t, const TransDataContainer *tc, TransData *td, - const float pivot[3], + const float pivot_local[3], const float vec[3], const bool apply_snap_align_rotation, const bool is_valid_snapping_normal) @@ -97,7 +97,7 @@ static void transdata_elem_translate(const TransInfo *t, unit_m3(mat); } - ElementRotation_ex(t, tc, td, mat, pivot); + ElementRotation_ex(t, tc, td, mat, pivot_local); if (td->loc) { use_rotate_offset = true; @@ -156,7 +156,7 @@ static void transdata_elem_translate_fn(void *__restrict iter_data_v, transdata_elem_translate(data->t, data->tc, td, - data->tc_pivot, + data->pivot_local, data->vec, data->apply_snap_align_rotation, data->is_valid_snapping_normal); @@ -363,14 +363,14 @@ static void applyTranslationValue(TransInfo *t, const float vec[3]) /* Ideally "apply_snap_align_rotation" would only be used when a snap point is found: * `t->tsnap.status & POINT_INIT` - perhaps this function isn't the best place to apply rotation. * However snapping rotation needs to be handled before doing the translation - * (unless the pivot is also translated). */ + * (unless the pivot_local is also translated). */ FOREACH_TRANS_DATA_CONTAINER (t, tc) { - float pivot[3]; + float pivot_local[3]; if (apply_snap_align_rotation) { - copy_v3_v3(pivot, t->tsnap.snapTarget); + copy_v3_v3(pivot_local, t->tsnap.snapTarget); /* The pivot has to be in local-space (see T49494) */ if (tc->use_local_mat) { - mul_m4_v3(tc->imat, pivot); + mul_m4_v3(tc->imat, pivot_local); } } @@ -381,14 +381,14 @@ static void applyTranslationValue(TransInfo *t, const float vec[3]) continue; } transdata_elem_translate( - t, tc, td, pivot, vec, apply_snap_align_rotation, is_valid_snapping_normal); + t, tc, td, pivot_local, vec, apply_snap_align_rotation, is_valid_snapping_normal); } } else { struct TransDataArgs_Translate data = { .t = t, .tc = tc, - .tc_pivot = {UNPACK3(pivot)}, + .pivot_local = {UNPACK3(pivot_local)}, .vec = {UNPACK3(vec)}, .apply_snap_align_rotation = apply_snap_align_rotation, .is_valid_snapping_normal = is_valid_snapping_normal, |