From 273bf53e8013085eb61738fae73d026e3fb67be9 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Mon, 14 Sep 2020 15:42:17 -0300 Subject: Cleanup: Use 'r_' prefix for return value Make it obvious which values are written to. --- source/blender/editors/include/ED_transform.h | 4 ++-- source/blender/editors/space_view3d/view3d_edit.c | 2 +- .../blender/editors/transform/transform_orientations.c | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index b53740a531f..d6af119dae0 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -130,8 +130,8 @@ bool BIF_createTransformOrientation(struct bContext *C, void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *target); void ED_getTransformOrientationMatrix(const struct bContext *C, - float orientation_mat[3][3], - const short around); + const short around, + float r_orientation_mat[3][3]); int BIF_countTransformOrientation(const struct bContext *C); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8b9f0fdb972..b643885ca62 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3950,7 +3950,7 @@ static int view_axis_exec(bContext *C, wmOperator *op) if (obact != NULL) { float twmat[3][3]; /* same as transform gizmo when normal is set */ - ED_getTransformOrientationMatrix(C, twmat, V3D_AROUND_ACTIVE); + ED_getTransformOrientationMatrix(C, V3D_AROUND_ACTIVE, twmat); align_quat = align_quat_buf; mat3_to_quat(align_quat, twmat); invert_qt_normalized(align_quat); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index e805743e6bb..f7462464683 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -475,7 +475,7 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C, } case V3D_ORIENT_NORMAL: { if (obedit || (ob && ob->mode & OB_MODE_POSE)) { - ED_getTransformOrientationMatrix(C, r_mat, pivot_point); + ED_getTransformOrientationMatrix(C, pivot_point, r_mat); return V3D_ORIENT_NORMAL; } /* no break we define 'normal' as 'local' in Object mode */ @@ -488,7 +488,7 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C, * use the active pones axis for display [#33575], this works as expected on a single * bone and users who select many bones will understand what's going on and what local * means when they start transforming */ - ED_getTransformOrientationMatrix(C, r_mat, pivot_point); + ED_getTransformOrientationMatrix(C, pivot_point, r_mat); } else { copy_m3_m4(r_mat, ob->obmat); @@ -1225,8 +1225,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3]) } void ED_getTransformOrientationMatrix(const bContext *C, - float orientation_mat[3][3], - const short around) + const short around, + float r_orientation_mat[3][3]) { float normal[3] = {0.0, 0.0, 0.0}; float plane[3] = {0.0, 0.0, 0.0}; @@ -1242,22 +1242,22 @@ void ED_getTransformOrientationMatrix(const bContext *C, switch (type) { case ORIENTATION_NORMAL: - if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { + if (createSpaceNormalTangent(r_orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_VERT: - if (createSpaceNormal(orientation_mat, normal) == 0) { + if (createSpaceNormal(r_orientation_mat, normal) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_EDGE: - if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { + if (createSpaceNormalTangent(r_orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; case ORIENTATION_FACE: - if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) { + if (createSpaceNormalTangent(r_orientation_mat, normal, plane) == 0) { type = ORIENTATION_NONE; } break; @@ -1267,6 +1267,6 @@ void ED_getTransformOrientationMatrix(const bContext *C, } if (type == ORIENTATION_NONE) { - unit_m3(orientation_mat); + unit_m3(r_orientation_mat); } } -- cgit v1.2.3