[Bf-blender-cvs] [f470a02afae] master: Fix T80982: Crash using custom orientations beside the first

Campbell Barton noreply at git.blender.org
Sun Sep 20 07:59:39 CEST 2020


Commit: f470a02afaea0d56ffaef976fd149edfb68c2c34
Author: Campbell Barton
Date:   Sun Sep 20 15:56:38 2020 +1000
Branches: master
https://developer.blender.org/rBf470a02afaea0d56ffaef976fd149edfb68c2c34

Fix T80982: Crash using custom orientations beside the first

Regression in f7829787da5c64b3fa715a042c2a45ecd4314676

===================================================================

M	source/blender/editors/transform/transform.h
M	source/blender/editors/transform/transform_orientations.c

===================================================================

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:



More information about the Bf-blender-cvs mailing list