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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-05-27 14:08:37 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-05-27 14:08:37 +0400
commit654ef111a7d239501599faee62579c8c600fe67a (patch)
tree6591d4c47b4ef2dd1e401f4d6908a58171bf32cd /source/blender/editors/transform
parent9978f97b1229c6836c17e7c7ade8005aa042d429 (diff)
Fix #31606: pg up/down does not work for changing falloff for proportional editing
Initially issue was caused by non-proportional edge slide patch in rev46927 which had several wrong things: - It introduced new events TFM_WHEEL_DOWN_EVT/TFM_WHEEL_UP_EVT which were defined as per-bit OR between edge slide and proportional editing modal events, but the issue is that modal events are not bit masks and that meant that new events were defined as 20|24 and 21|25 which is a bit strange. - Another this was caused by the fact, that keymap wasn't creating for some specific transform modal keymap item -- it used to be tried to create single shortcut for two different modal events, which isn't supported by keymaps and resulted by artifacts in keymap editor interface (nodal event type was empty for wheel movements). That was caused by different events used by modal keymap and defining shortcuts. - Actual issue which prevented PgUP/PGDOWN to work was mixing using that new events for wheel scrolling in switch statements which doesn't do bitmask check. Solved by separating keymaps used for proportional editing and edge slide -- now it's mouse Wheel for proportional editing and Alt-Wheel for edge slide. If someone would want to have single shortcut for this two events it'll imply one of the follofing things: - Support poll function for shortcuts, so keymap would definitely know which modal event to send to operator. - Generalize TFM_MODAL_PROPSIZE_{UP, DOWN} and TFM_MODAL_EDGESLIDE_{UP, DOWN} so they can share the same shortcut with current design of keymaps.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 43fdb779470..341b4a9e9c6 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -539,9 +539,6 @@ static void view_editmove(unsigned short UNUSED(event))
#define TFM_MODAL_EDGESLIDE_UP 24
#define TFM_MODAL_EDGESLIDE_DOWN 25
-#define TFM_WHEEL_DOWN_EVT TFM_MODAL_PROPSIZE_DOWN|TFM_MODAL_EDGESLIDE_DOWN
-#define TFM_WHEEL_UP_EVT TFM_MODAL_PROPSIZE_UP|TFM_MODAL_EDGESLIDE_UP
-
/* called in transform_ops.c, on each regeneration of keymaps */
wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf)
{
@@ -603,8 +600,11 @@ wmKeyMap* transform_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, PAGEUPKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP);
WM_modalkeymap_add_item(keymap, PAGEDOWNKEY, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN);
- WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, TFM_WHEEL_UP_EVT);
- WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, 0, 0, TFM_WHEEL_DOWN_EVT);
+ WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_UP);
+ WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, 0, 0, TFM_MODAL_PROPSIZE_DOWN);
+
+ WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, KM_ALT, 0, TFM_MODAL_EDGESLIDE_UP);
+ WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, KM_ALT, 0, TFM_MODAL_EDGESLIDE_DOWN);
WM_modalkeymap_add_item(keymap, PAGEUPKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_AUTOIK_LEN_INC);
WM_modalkeymap_add_item(keymap, PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_AUTOIK_LEN_DEC);
@@ -869,7 +869,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
removeSnapPoint(t);
t->redraw |= TREDRAW_HARD;
break;
- case TFM_WHEEL_UP_EVT:
+ case TFM_MODAL_PROPSIZE_UP:
if (t->flag & T_PROP_EDIT) {
t->prop_size*= 1.1f;
if (t->spacetype==SPACE_VIEW3D && t->persp != RV3D_ORTHO)
@@ -878,13 +878,17 @@ int transformEvent(TransInfo *t, wmEvent *event)
}
t->redraw |= TREDRAW_HARD;
break;
- case TFM_WHEEL_DOWN_EVT:
+ case TFM_MODAL_PROPSIZE_DOWN:
if (t->flag & T_PROP_EDIT) {
t->prop_size*= 0.90909090f;
calculatePropRatio(t);
}
t->redraw |= TREDRAW_HARD;
break;
+ case TFM_MODAL_EDGESLIDE_UP:
+ case TFM_MODAL_EDGESLIDE_DOWN:
+ t->redraw |= TREDRAW_HARD;
+ break;
case TFM_MODAL_AUTOIK_LEN_INC:
if (t->flag & T_AUTOIK)
transform_autoik_update(t, 1);
@@ -5090,11 +5094,11 @@ int handleEventEdgeSlide(struct TransInfo *t, struct wmEvent *event)
}
case EVT_MODAL_MAP: {
switch (event->val) {
- case TFM_WHEEL_DOWN_EVT: {
+ case TFM_MODAL_EDGESLIDE_DOWN: {
sld->curr_sv_index = ((sld->curr_sv_index - 1) + sld->totsv) % sld->totsv;
break;
}
- case TFM_WHEEL_UP_EVT: {
+ case TFM_MODAL_EDGESLIDE_UP: {
sld->curr_sv_index = (sld->curr_sv_index + 1) % sld->totsv;
break;
}