Transform Mirror:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 7 Oct 2009 16:10:06 +0000 (16:10 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 7 Oct 2009 16:10:06 +0000 (16:10 +0000)
* Make Ctrl+M key work for mirror in 3D view.
* Fix mirror along global axis, was mirroring around all axes when
  the object was rotated, due to wrong matrix order, was also not
  working in 2.4.
* Pressing e.g. X twice still doesn't go to local mode, would fix
  but don't know how the code is intended to work.

source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c

index b109157d85907790814871505df35767458b5d13..07aedf5e78ea49db624749b92be170563443e0e4 100644 (file)
@@ -2334,7 +2334,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
                if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) {
                        float obsizemat[3][3];
                        // Reorient the size mat to fit the oriented object.
                if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) {
                        float obsizemat[3][3];
                        // Reorient the size mat to fit the oriented object.
-                       Mat3MulMat3(obsizemat, tmat, td->axismtx);
+                       Mat3MulMat3(obsizemat, td->axismtx, tmat);
                        //printmatrix3("obsizemat", obsizemat);
                        TransMat3ToSize(obsizemat, td->axismtx, fsize);
                        //printvecf("fsize", fsize);
                        //printmatrix3("obsizemat", obsizemat);
                        TransMat3ToSize(obsizemat, td->axismtx, fsize);
                        //printvecf("fsize", fsize);
index 0440a957539dfd4280655eb1d346bbe1c7ad0b08..7ef8ad17a69bf30960b0dbf82edafdc6bf991e96 100644 (file)
@@ -767,6 +767,8 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct wmKeyMap *key
                        km = WM_keymap_add_item(keymap, "TFM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
                        RNA_boolean_set(km->ptr, "use", 1);
 
                        km = WM_keymap_add_item(keymap, "TFM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
                        RNA_boolean_set(km->ptr, "use", 1);
 
+                       km = WM_keymap_add_item(keymap, "TFM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
+
                        break;
                case SPACE_ACTION:
                        km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
                        break;
                case SPACE_ACTION:
                        km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
@@ -837,7 +839,7 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct wmKeyMap *key
 
                        km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0);
 
 
                        km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0);
 
-                       km = WM_keymap_add_item(keymap, "TFM_OT_mirror", MKEY, KM_PRESS, 0, 0);
+                       km = WM_keymap_add_item(keymap, "TFM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
                        break;
                default:
                        break;
                        break;
                default:
                        break;