Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2016-12-16 04:35:36 +0300
committerJulian Eisel <eiseljulian@gmail.com>2016-12-16 04:49:53 +0300
commit4df75e536a0847cf5e5f567f92f1391f1f72c211 (patch)
tree675d07ca71955c9bb9f9bd0e8da965d3a91eb6bf /source/blender/editors/transform/transform_manipulator.c
parent524ab96245211bb722b82e197ac75bba6bd10e69 (diff)
Make Shift+LMB on transform manipulator configurable
It's now possible to change the shortcut that enables planar transformation with the transform manipulators (shift+LMB on axis). This actually fixes the workaround added in rB20681f49801fd. Thing is that we needed to allow using the manipulators, even if a modifier key is held so things like snapping work right away. That's why normal LMB behavior uses KM_ANY. However, event handling would always execute the KM_ANY keymap handler because it's iterated over first. Simply solved this by registering the KM_SHIFT keymap item first, so it has priority over the KM_ANY one.
Diffstat (limited to 'source/blender/editors/transform/transform_manipulator.c')
-rw-r--r--source/blender/editors/transform/transform_manipulator.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 075f311db72..e141724f2df 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1835,7 +1835,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
ARegion *ar = CTX_wm_region(C);
int constraint_axis[3] = {0, 0, 0};
int val;
- int shift = event->shift;
+ const bool use_planar = RNA_boolean_get(op->ptr, "use_planar_constraint");
if (!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0;
if (!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0;
@@ -1856,7 +1856,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
case MAN_TRANS_C:
break;
case MAN_TRANS_X:
- if (shift) {
+ if (use_planar) {
constraint_axis[1] = 1;
constraint_axis[2] = 1;
}
@@ -1864,7 +1864,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
constraint_axis[0] = 1;
break;
case MAN_TRANS_Y:
- if (shift) {
+ if (use_planar) {
constraint_axis[0] = 1;
constraint_axis[2] = 1;
}
@@ -1872,7 +1872,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
constraint_axis[1] = 1;
break;
case MAN_TRANS_Z:
- if (shift) {
+ if (use_planar) {
constraint_axis[0] = 1;
constraint_axis[1] = 1;
}
@@ -1886,7 +1886,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
else if (drawflags & MAN_SCALE_C) {
switch (drawflags) {
case MAN_SCALE_X:
- if (shift) {
+ if (use_planar) {
constraint_axis[1] = 1;
constraint_axis[2] = 1;
}
@@ -1894,7 +1894,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
constraint_axis[0] = 1;
break;
case MAN_SCALE_Y:
- if (shift) {
+ if (use_planar) {
constraint_axis[0] = 1;
constraint_axis[2] = 1;
}
@@ -1902,7 +1902,7 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op)
constraint_axis[1] = 1;
break;
case MAN_SCALE_Z:
- if (shift) {
+ if (use_planar) {
constraint_axis[0] = 1;
constraint_axis[1] = 1;
}