From f470a02afaea0d56ffaef976fd149edfb68c2c34 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 20 Sep 2020 15:56:38 +1000 Subject: Fix T80982: Crash using custom orientations beside the first Regression in f7829787da5c64b3fa715a042c2a45ecd4314676 --- source/blender/editors/transform/transform.h | 2 +- source/blender/editors/transform/transform_orientations.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/transform') diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 0e141b542cf..ef206973e3b 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -693,7 +693,7 @@ void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot); /*********************** Transform Orientations ******************************/ short transform_orientation_matrix_get(struct bContext *C, TransInfo *t, - const short orientation, + short orientation, const float custom[3][3], float r_spacemtx[3][3]); const char *transform_orientations_spacename_get(TransInfo *t, const short orient_type); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 5a90b59b505..276d9381a0b 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -533,11 +533,8 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C, /* Sets the matrix of the specified space orientation. * If the matrix cannot be obtained, an orientation different from the one * informed is returned */ -short transform_orientation_matrix_get(bContext *C, - TransInfo *t, - const short orientation, - const float custom[3][3], - float r_spacemtx[3][3]) +short transform_orientation_matrix_get( + bContext *C, TransInfo *t, short orientation, const float custom[3][3], float r_spacemtx[3][3]) { Object *ob = NULL; Object *obedit = NULL; @@ -552,6 +549,7 @@ short transform_orientation_matrix_get(bContext *C, if (orientation >= V3D_ORIENT_CUSTOM) { orientation_index_custom = orientation - V3D_ORIENT_CUSTOM; + orientation = V3D_ORIENT_CUSTOM; } switch (orientation) { case V3D_ORIENT_GIMBAL: -- cgit v1.2.3