diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-16 15:50:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-16 15:50:17 +0400 |
commit | 944dfa23c451464c72ffd82f6987490a47ff3b02 (patch) | |
tree | 9ca3b7df7f3df21c5b403589262b8f73965f99e3 /source/blender/editors | |
parent | 03b43a0db02028a0a41f0c141cd5ef1b661e5766 (diff) | |
parent | 3123ad12a395031a1bf5a964582762a3831e9b1c (diff) |
svn merge ^/trunk/blender -r43392:43420
Diffstat (limited to 'source/blender/editors')
29 files changed, 300 insertions, 242 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index cc1fae170d0..e17aea3f8f3 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1494,11 +1494,12 @@ void ED_marker_keymap(wmKeyConfig *keyconf) #ifdef DURIAN_CAMERA_SWITCH kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "camera", 1); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + RNA_boolean_set(kmi->ptr, "camera", TRUE); kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "camera", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "camera", TRUE); #else (void)kmi; #endif diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 81482466a30..29cdf6a61f7 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -220,16 +220,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SKETCH_OT_gesture", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "snap", 1); + RNA_boolean_set(kmi->ptr, "snap", TRUE); WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0); kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "snap", 1); + RNA_boolean_set(kmi->ptr, "snap", TRUE); /* only set in editmode armature, by space_view3d listener */ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0); - RNA_boolean_set(kmi->ptr, "unselected", FALSE); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "unselected", TRUE); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); + WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0); @@ -304,9 +305,11 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "unselected", 1); + kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); + kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); + WM_keymap_add_item(keymap, "POSE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0); @@ -321,9 +324,11 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "POSE_OT_rotation_mode_set", RKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); + RNA_boolean_set(kmi->ptr, "flipped", FALSE); + kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "flipped", 1); + RNA_boolean_set(kmi->ptr, "flipped", TRUE); kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 150e0ba90e4..954c79bb17d 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -55,7 +55,8 @@ void ED_keymap_gpencil(wmKeyConfig *keyconf) /* Draw */ /* draw */ - WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY); + kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY); + RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW); /* draw - straight lines */ kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, DKEY); RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_STRAIGHT); diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index b50df29918d..40cf0213203 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -494,7 +494,7 @@ struct uiEditSourceStore { } uiEditSourceStore; struct uiEditSourceButStore { - char py_dbg_fn[240]; + char py_dbg_fn[FILE_MAX]; int py_dbg_ln; } uiEditSourceButStore; @@ -584,7 +584,7 @@ void UI_editsource_active_but_test(uiBut *but) /* editsource operator component */ static int editsource_text_edit(bContext *C, wmOperator *op, - char filepath[240], int line) + char filepath[FILE_MAX], int line) { struct Main *bmain= CTX_data_main(C); Text *text; diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index a993e651b5f..2959d525cfb 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1207,6 +1207,7 @@ typedef struct v2dScrollerMove { float delta; /* amount moved by mouse on axis of interest */ float scrollbarwidth; /* width of the scrollbar itself, used for page up/down clicks */ + int scrollbar_orig; /* initial location of scrollbar x/y, mouse relative */ int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */ } v2dScrollerMove; @@ -1302,15 +1303,16 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, vsm->v2d= v2d; vsm->ar= ar; vsm->scroller= in_scroller; - + /* store mouse-coordinates, and convert mouse/screen coordinates to region coordinates */ vsm->lastx = event->x; vsm->lasty = event->y; - /* 'zone' depends on where mouse is relative to bubble * - zooming must be allowed on this axis, otherwise, default to pan */ scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + + if (in_scroller == 'h') { /* horizontal scroller - calculate adjustment factor first */ mask_size= (float)(v2d->hor.xmax - v2d->hor.xmin); @@ -1325,6 +1327,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, } vsm->scrollbarwidth = scrollers->hor_max - scrollers->hor_min; + vsm->scrollbar_orig = ((scrollers->hor_max + scrollers->hor_min) / 2) + ar->winrct.xmin; } else { /* vertical scroller - calculate adjustment factor first */ @@ -1340,6 +1343,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, } vsm->scrollbarwidth = scrollers->vert_max - scrollers->vert_min; + vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) + + ar->winrct.ymin; } UI_view2d_scrollers_free(scrollers); @@ -1464,6 +1468,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event) break; case LEFTMOUSE: + case MIDDLEMOUSE: if (event->val==KM_RELEASE) { /* single-click was in empty space outside bubble, so scroll by 1 'page' */ if (ELEM(vsm->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) { @@ -1484,6 +1489,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event) } } break; + } return OPERATOR_RUNNING_MODAL; @@ -1508,6 +1514,21 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) scroller_activate_init(C, op, event, in_scroller); vsm= (v2dScrollerMove *)op->customdata; + /* support for quick jump to location - gtk and qt do this on linux */ + if (event->type == MIDDLEMOUSE) { + switch (vsm->scroller) { + case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */ + vsm->delta= (float)(event->x - vsm->scrollbar_orig); + break; + case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */ + vsm->delta= (float)(event->y - vsm->scrollbar_orig); + break; + } + scroller_activate_apply(C, op); + + vsm->zone= SCROLLHANDLE_BAR; + } + /* check if zoom zones are inappropriate (i.e. zoom widgets not shown), so cannot continue * NOTE: see view2d.c for latest conditions, and keep this in sync with that */ @@ -1669,6 +1690,10 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0); + /* scrollers */ + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0); + /* pan/scroll */ WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); @@ -1713,12 +1738,13 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) /* borderzoom - drag */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); - - /* scrollers */ - WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); /* Alternative keymap for buttons listview */ keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); + + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MOUSEPAN, 0, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0); @@ -1732,6 +1758,5 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); } diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 68d11837d0d..eba4dd1878a 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -269,20 +269,20 @@ void ED_keymap_object(wmKeyConfig *keyconf) /* Note: this keymap works disregarding mode */ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); - RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0); - RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0); @@ -297,27 +297,29 @@ void ED_keymap_object(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, KM_PRESS, 0, 0); - RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); + RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "action", SEL_INVERT); + RNA_enum_set(kmi->ptr, "action", SEL_INVERT); WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); - RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); - RNA_boolean_set(kmi->ptr, "extend", TRUE); - - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); - RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); - RNA_boolean_set(kmi->ptr, "extend", TRUE); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); + RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); + RNA_boolean_set(kmi->ptr, "extend", FALSE); + + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); + RNA_boolean_set(kmi->ptr, "extend", TRUE); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_no_inverse_set", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); @@ -334,20 +336,34 @@ void ED_keymap_object(wmKeyConfig *keyconf) WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_clear", HKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); + + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); /* same as above but for rendering */ WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_clear", HKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_CTRL, 0); -// RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "unselected", 1); // conflicts, removing + + /* conflicts, removing */ +#if 0 + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0) + RNA_boolean_set(kmi->ptr, "unselected", TRUE); +#endif WM_keymap_add_item(keymap, "OBJECT_OT_move_to_layer", MKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "use_global", TRUE); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "use_global", FALSE); + + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "use_global", TRUE); + WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "use_global", TRUE); + RNA_boolean_set(kmi->ptr, "use_global", FALSE); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "use_global", TRUE); WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0); @@ -393,7 +409,7 @@ void ED_keymap_object(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); - /* menus */ + /* menus */ WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0); ED_object_generic_keymap(keyconf, keymap, 2); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 09f99a58dd7..ebd3dc6617d 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -39,8 +39,11 @@ #include "ED_physics.h" #include "ED_object.h" +#include "BLI_utildefines.h" + #include "physics_intern.h" // own include + /***************************** particles ***********************************/ static void operatortypes_particle(void) @@ -109,7 +112,7 @@ static void keymap_particle(wmKeyConfig *keyconf) RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0); - RNA_boolean_set(kmi->ptr, "release_confirm", 1); + RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 06e15f4a5f6..6bb3b2ca7f8 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -240,7 +240,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender) } BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, FALSE); - ok= BKE_write_ibuf(ibuf, name, &scene->r.im_format); /* no need to stamp here */ + ok= BKE_write_ibuf_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */ if(ok) printf("OpenGL Render written to '%s'\n", name); else printf("OpenGL Render failed to write '%s'\n", name); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index eaca87f2d6f..a3874c9f28a 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3604,11 +3604,11 @@ void ED_keymap_screen(wmKeyConfig *keyconf) #if 0 // XXX: disabled for restoring later... bad implementation keymap= WM_keymap_find(keyconf, "Frames", 0, 0); kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "cycle_speed", 1); + RNA_boolean_set(kmi->ptr, "cycle_speed", TRUE); kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", LEFTARROWKEY, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "reverse", 1); - RNA_boolean_set(kmi->ptr, "cycle_speed", 1); + RNA_boolean_set(kmi->ptr, "reverse", TRUE); + RNA_boolean_set(kmi->ptr, "cycle_speed", TRUE); WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", DOWNARROWKEY, KM_PRESS, KM_ALT, 0); #endif diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index a5e68f9a244..2fc7d569d63 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -126,7 +126,7 @@ void paint_calc_redraw_planes(float planes[4][4], const struct rcti *screen_rect); void projectf(struct bglMats *mats, const float v[3], float p[2]); -float paint_calc_object_space_radius(struct ViewContext *vc, float center[3], float pixel_radius); +float paint_calc_object_space_radius(struct ViewContext *vc, const float center[3], float pixel_radius); float paint_get_tex_pixel(struct Brush* br, float u, float v); int imapaint_pick_face(struct ViewContext *vc, struct Mesh *me, const int mval[2], unsigned int *index); void imapaint_pick_uv(struct Scene *scene, struct Object *ob, unsigned int faceindex, const int xy[2], float uv[2]); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index e81e1f6dc77..2a0ebb8316d 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -395,67 +395,14 @@ void ED_operatortypes_paint(void) static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *mode) { wmKeyMapItem *kmi; - - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ONEKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 0); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", TWOKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 1); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", THREEKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 2); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FOURKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 3); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FIVEKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 4); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SIXKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 5); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SEVENKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 6); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", EIGHTKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 7); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", NINEKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 8); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ZEROKEY, KM_PRESS, 0, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 9); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ONEKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 10); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", TWOKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 11); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", THREEKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 12); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FOURKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 13); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", FIVEKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 14); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SIXKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 15); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", SEVENKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 16); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", EIGHTKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 17); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", NINEKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 18); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ZEROKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(kmi->ptr, "mode", mode); - RNA_int_set(kmi->ptr, "index", 19); + int i; + /* index 0-9 (zero key is tenth), shift key for index 10-19 */ + for (i = 0; i < 20; i++) { + kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", + ZEROKEY + ((i + 1) % 10), KM_PRESS, i < 10 ? 0 : KM_SHIFT, 0); + RNA_string_set(kmi->ptr, "mode", mode); + RNA_int_set(kmi->ptr, "index", i); + } } static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *UNUSED(path)) @@ -556,11 +503,11 @@ void ED_keymap_paint(wmKeyConfig *keyconf) /* multires switch */ kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", 1); - RNA_boolean_set(kmi->ptr, "relative", 1); + RNA_boolean_set(kmi->ptr, "relative", TRUE); kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", -1); - RNA_boolean_set(kmi->ptr, "relative", 1); + RNA_boolean_set(kmi->ptr, "relative", TRUE); ed_keymap_paint_brush_switch(keymap, "sculpt"); ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size"); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index c3e0c35f524..67bd6ca9255 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -510,31 +510,33 @@ static void paint_draw_alpha_overlay(Sculpt *sd, Brush *brush, /* Special actions taken when paint cursor goes over mesh */ /* TODO: sculpt only for now */ static void paint_cursor_on_hit(Sculpt *sd, Brush *brush, ViewContext *vc, - float location[3], float *visual_strength) + const float location[3]) { float unprojected_radius, projected_radius; - /* TODO: check whether this should really only be done when - brush is over mesh? */ - if(sd->draw_pressure && brush_use_alpha_pressure(vc->scene, brush)) - (*visual_strength) *= sd->pressure_value; - - if(sd->draw_anchored) - projected_radius = sd->anchored_size; - else { - if(brush->flag & BRUSH_ANCHORED) - projected_radius = 8; - else - projected_radius = brush_size(vc->scene, brush); - } - unprojected_radius = paint_calc_object_space_radius(vc, location, - projected_radius); + /* update the brush's cached 3D radius */ + if(!brush_use_locked_size(vc->scene, brush)) { + /* get 2D brush radius */ + if(sd->draw_anchored) + projected_radius = sd->anchored_size; + else { + if(brush->flag & BRUSH_ANCHORED) + projected_radius = 8; + else + projected_radius = brush_size(vc->scene, brush); + } + + /* convert brush radius from 2D to 3D */ + unprojected_radius = paint_calc_object_space_radius(vc, location, + projected_radius); - if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) - unprojected_radius *= sd->pressure_value; + /* scale 3D brush radius by pressure */ + if(sd->draw_pressure && brush_use_size_pressure(vc->scene, brush)) + unprojected_radius *= sd->pressure_value; - if(!brush_use_locked_size(vc->scene, brush)) + /* set cached value in either Brush or UnifiedPaintSettings */ brush_set_unprojected_radius(vc->scene, brush, unprojected_radius); + } } static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) @@ -613,8 +615,13 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) outline_col = brush->sub_col; /* only do if brush is over the mesh */ - if(hit) - paint_cursor_on_hit(sd, brush, &vc, location, &visual_strength); + if(hit) { + /* scale the alpha by pen pressure */ + if(sd->draw_pressure && brush_use_alpha_pressure(vc.scene, brush)) + visual_strength *= sd->pressure_value; + + paint_cursor_on_hit(sd, brush, &vc, location); + } /* don't show effect of strength past the soft limit */ if(visual_strength > 1) diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 6b863757932..70293765813 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -152,7 +152,7 @@ void projectf(bglMats *mats, const float v[3], float p[2]) p[1]= uy; } -float paint_calc_object_space_radius(ViewContext *vc, float center[3], +float paint_calc_object_space_radius(ViewContext *vc, const float center[3], float pixel_radius) { Object *ob = vc->obact; diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 0c326af406f..e6928e31dc7 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -96,11 +96,6 @@ static SpaceLink *buttons_new(const bContext *UNUSED(C)) static void buttons_free(SpaceLink *sl) { SpaceButs *sbuts= (SpaceButs*) sl; - - if(sbuts->ri) { - if (sbuts->ri->rect) MEM_freeN(sbuts->ri->rect); - MEM_freeN(sbuts->ri); - } if(sbuts->path) MEM_freeN(sbuts->path); @@ -131,7 +126,6 @@ static SpaceLink *buttons_duplicate(SpaceLink *sl) SpaceButs *sbutsn= MEM_dupallocN(sl); /* clear or remove stuff from old */ - sbutsn->ri= NULL; sbutsn->path= NULL; sbutsn->texuser= NULL; diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 0d1c312792a..eb8f30b6739 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -250,9 +250,9 @@ static void draw_movieclip_buffer(SpaceClip *sc, ARegion *ar, ImBuf *ibuf, glBegin(GL_LINE_LOOP); glVertex2f(0.0f, 0.0f); - glVertex2f(ibuf->x, 0.0f); - glVertex2f(ibuf->x, ibuf->y); - glVertex2f(0.0f, ibuf->y); + glVertex2f(width, 0.0f); + glVertex2f(width, height); + glVertex2f(0.0f, height); glEnd(); glPopMatrix(); @@ -1259,14 +1259,24 @@ void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) float smat[4][4], ismat[4][4]; ibuf= ED_space_clip_get_stable_buffer(sc, sc->loc, &sc->scale, &sc->angle); - BKE_tracking_stabdata_to_mat4(width, height, sc->loc, sc->scale, sc->angle, sc->stabmat); - unit_m4(smat); - smat[0][0]= 1.0f/width; - smat[1][1]= 1.0f/height; - invert_m4_m4(ismat, smat); + if(ibuf) { + float loc[2]; - mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL); + if(width != ibuf->x) + mul_v2_v2fl(loc, sc->loc, (float)width / ibuf->x); + else + copy_v2_v2(loc, sc->loc); + + BKE_tracking_stabdata_to_mat4(width, height, loc, sc->scale, sc->angle, sc->stabmat); + + unit_m4(smat); + smat[0][0]= 1.0f/width; + smat[1][1]= 1.0f/height; + invert_m4_m4(ismat, smat); + + mul_serie_m4(sc->unistabmat, smat, sc->stabmat, ismat, NULL, NULL, NULL, NULL, NULL); + } } else { ibuf= ED_space_clip_get_buffer(sc); diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index d75df0ab51e..35d870022a4 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -86,7 +86,7 @@ ImBuf *ED_space_clip_get_buffer(SpaceClip *sc) if(sc->clip) { ImBuf *ibuf; - ibuf= BKE_movieclip_get_ibuf(sc->clip, &sc->user); + ibuf= BKE_movieclip_get_postprocessed_ibuf(sc->clip, &sc->user, sc->postproc_flag); if(ibuf && (ibuf->rect || ibuf->rect_float)) return ibuf; @@ -103,7 +103,7 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale if(sc->clip) { ImBuf *ibuf; - ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle); + ibuf= BKE_movieclip_get_stable_ibuf(sc->clip, &sc->user, loc, scale, angle, sc->postproc_flag); if(ibuf && (ibuf->rect || ibuf->rect_float)) return ibuf; diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 82da9b3b956..b2527fbe4e0 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -399,22 +399,24 @@ static void clip_keymap(struct wmKeyConfig *keyconf) /* 2d tracking */ kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "backwards", 1); + RNA_boolean_set(kmi->ptr, "backwards", TRUE); + RNA_boolean_set(kmi->ptr, "sequence", FALSE); WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0); kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "sequence", 1); + RNA_boolean_set(kmi->ptr, "backwards", FALSE); + RNA_boolean_set(kmi->ptr, "sequence", TRUE); kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "backwards", 1); - RNA_boolean_set(kmi->ptr, "sequence", 1); + RNA_boolean_set(kmi->ptr, "backwards", TRUE); + RNA_boolean_set(kmi->ptr, "sequence", TRUE); /* mode */ kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", SC_MODE_RECONSTRUCTION); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); /* ******** Hotkeys avalaible for main region only ******** */ @@ -490,10 +492,11 @@ static void clip_keymap(struct wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0); RNA_enum_set(kmi->ptr, "action", 1); /* unlock */ - WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(kmi->ptr, "unselected", FALSE); kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "unselected", 1); + RNA_boolean_set(kmi->ptr, "unselected", TRUE); WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks_clear", HKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index c91c8e1bd14..9640701965c 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -655,7 +655,11 @@ static int console_history_append_exec(bContext *C, wmOperator *op) ED_area_tag_redraw(sa); - console_scroll_bottom(ar); + /* when calling render modally this can be NULL when calling: + * bpy.ops.render.render('INVOKE_DEFAULT') */ + if (ar) { + console_scroll_bottom(ar); + } return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index c713317aa7e..1a2541cbc90 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -276,19 +276,19 @@ static void console_keymap(struct wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 0); + RNA_boolean_set(kmi->ptr, "reverse", FALSE); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 1); + RNA_boolean_set(kmi->ptr, "reverse", TRUE); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 0); + RNA_boolean_set(kmi->ptr, "reverse", FALSE); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 1); + RNA_boolean_set(kmi->ptr, "reverse", TRUE); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_CHAR); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 7bc71e333ea..02c9728348e 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -410,13 +410,13 @@ static void file_keymap(struct wmKeyConfig *keyconf) /* keys for main area */ keymap= WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0); kmi= WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0); - RNA_boolean_set(kmi->ptr, "need_active", 1); + RNA_boolean_set(kmi->ptr, "need_active", TRUE); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0); kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "fill", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "fill", TRUE); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_refresh", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 5c39da94ecd..aa245585d11 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -295,7 +295,7 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) RNA_boolean_set(kmi->ptr, "column", FALSE); /* select left/right */ - WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST); kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 06674513868..e7a139fe465 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -858,7 +858,9 @@ static int image_replace_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; RNA_string_get(op->ptr, "filepath", str); - BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); /* we cant do much if the str is longer then 240 :/ */ + + /* we cant do much if the str is longer then FILE_MAX :/ */ + BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); /* XXX unpackImage frees image buffers */ ED_preview_kill_jobs(C); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index c9cb5bd406d..6fce836af98 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -542,7 +542,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) /* toggle editmode is handy to have while UV unwrapping */ kmi= WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); - RNA_boolean_set(kmi->ptr, "toggle", 1); + RNA_boolean_set(kmi->ptr, "toggle", TRUE); } /* dropboxes */ diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index a6d8b6c2612..986aab8fa61 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -216,21 +216,21 @@ void sequencer_keymap(wmKeyConfig *keyconf) RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "linked_right", 1); kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "linked_left", 1); - RNA_boolean_set(kmi->ptr, "linked_right", 1); + RNA_boolean_set(kmi->ptr, "linked_left", TRUE); + RNA_boolean_set(kmi->ptr, "linked_right", TRUE); kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "linked_left", 1); - RNA_boolean_set(kmi->ptr, "linked_right", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "linked_left", TRUE); + RNA_boolean_set(kmi->ptr, "linked_right", TRUE); kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "linked_left", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "linked_left", TRUE); kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); - RNA_boolean_set(kmi->ptr, "extend", 1); - RNA_boolean_set(kmi->ptr, "linked_right", 1); + RNA_boolean_set(kmi->ptr, "extend", TRUE); + RNA_boolean_set(kmi->ptr, "linked_right", TRUE); */ /* 2.5 method, Alt and use selected handle */ diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 7e6af8ea789..441a5eab976 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -268,19 +268,19 @@ static void text_keymap(struct wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 0); + RNA_boolean_set(kmi->ptr, "reverse", FALSE); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 1); + RNA_boolean_set(kmi->ptr, "reverse", TRUE); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 0); + RNA_boolean_set(kmi->ptr, "reverse", FALSE); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size"); - RNA_boolean_set(kmi->ptr, "reverse", 1); + RNA_boolean_set(kmi->ptr, "reverse", TRUE); WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0); @@ -357,9 +357,11 @@ static void text_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "TEXT_OT_overwrite_toggle", INSERTKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "TEXT_OT_scroll", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_scroll", MOUSEPAN, 0, 0, 0); - WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_selection_set", EVT_TWEAK_L, KM_ANY, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_selection_set", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select", 1); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index e8ad6e19fd4..19f0c9bba61 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2232,8 +2232,8 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event) text_scroll_apply(C, op, event); scroll_exit(C, op); return OPERATOR_FINISHED; - } - + } + WM_event_add_modal_handler(C, op); return OPERATOR_RUNNING_MODAL; @@ -2314,9 +2314,20 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event) tsc->scrollbar= 1; tsc->zone= zone; op->customdata= tsc; - st->flags|= ST_SCROLL_SELECT; + /* jump scroll, works in v2d but needs to be added here too :S */ + if (event->type == MIDDLEMOUSE) { + tsc->old[0] = ar->winrct.xmin + (st->txtbar.xmax + st->txtbar.xmin) / 2; + tsc->old[1] = ar->winrct.ymin + (st->txtbar.ymax + st->txtbar.ymin) / 2; + + tsc->delta[0] = 0; + tsc->delta[1] = 0; + tsc->first = 0; + tsc->zone= SCROLLHANDLE_BAR; + text_scroll_apply(C, op, event); + } + WM_event_add_modal_handler(C, op); return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 224df5b9f80..b07e0ccdc74 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -921,6 +921,22 @@ static int view3d_camera_active_poll(bContext *C) return 0; } +/* test for unlocked camera view in quad view */ +static int view3d_camera_user_poll(bContext *C) +{ + View3D *v3d; + ARegion *ar; + + if (ED_view3d_context_user_region(C, &v3d, &ar)) { + RegionView3D *rv3d = ar->regiondata; + if(rv3d->persp==RV3D_CAMOB) { + return 1; + } + } + + return 0; +} + static int viewrotate_cancel(bContext *C, wmOperator *op) { viewops_data_free(C, op); @@ -2257,13 +2273,18 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot) static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */ { - ARegion *ar= CTX_wm_region(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); - View3D *v3d= CTX_wm_view3d(C); Scene *scene= CTX_data_scene(C); float xfac, yfac; float size[2]; + View3D *v3d; + ARegion *ar; + RegionView3D *rv3d; + + /* no NULL check is needed, poll checks */ + ED_view3d_context_user_region(C, &v3d, &ar); + rv3d = ar->regiondata; + rv3d->camdx= rv3d->camdy= 0.0f; ED_view3d_calc_camera_border_size(scene, ar, v3d, rv3d, size); @@ -2289,7 +2310,7 @@ void VIEW3D_OT_view_center_camera(wmOperatorType *ot) /* api callbacks */ ot->exec= view3d_center_camera_exec; - ot->poll= view3d_camera_active_poll; + ot->poll= view3d_camera_user_poll; /* flags */ ot->flag= 0; @@ -2543,11 +2564,16 @@ static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar, View3D *v3d) static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); - ARegion *ar= CTX_wm_region(C); - view3d_set_1_to_1_viewborder(scene, ar, CTX_wm_view3d(C)); + View3D *v3d; + ARegion *ar; - WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C)); + /* no NULL check is needed, poll checks */ + ED_view3d_context_user_region(C, &v3d, &ar); + + view3d_set_1_to_1_viewborder(scene, ar, v3d); + + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, v3d); return OPERATOR_FINISHED; } @@ -2561,7 +2587,7 @@ void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot) /* api callbacks */ ot->exec= view3d_zoom_1_to_1_camera_exec; - ot->poll= view3d_camera_active_poll; + ot->poll= view3d_camera_user_poll; /* flags */ ot->flag= 0; @@ -2660,6 +2686,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op) static int perspo = RV3D_PERSP; int viewnum, align_active, nextperspo; + /* no NULL check is needed, poll checks */ ED_view3d_context_user_region(C, &v3d, &ar); rv3d = ar->regiondata; diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 4594544b4f8..22470fe930d 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -121,7 +121,7 @@ void view3d_keymap(wmKeyConfig *keyconf) keymap= WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0); kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0); - RNA_boolean_set(kmi->ptr, "release_confirm", 1); + RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); /* * Doesn't work with KM_SHIFT, have to use KM_ANY and filter in invoke * */ diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index b7aba109cdd..1843768bcd7 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -843,7 +843,7 @@ void transform_operatortypes(void) void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spaceid) { - wmKeyMapItem *km; + wmKeyMapItem *kmi; wmKeyMap *modalmap; /* transform.c, only adds modal map once, checks if it's there */ @@ -879,71 +879,71 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac WM_keymap_add_item(keymap, "TRANSFORM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0); - km = WM_keymap_add_item(keymap, "TRANSFORM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); - RNA_boolean_set(km->ptr, "use", 1); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_create_orientation", SPACEKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "use", TRUE); WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0); - km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap"); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap"); WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - km = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(km->ptr, "texture_space", 1); + kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, TKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "texture_space", TRUE); - km = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); - RNA_boolean_set(km->ptr, "texture_space", 1); + kmi = WM_keymap_add_item(keymap, OP_RESIZE, TKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); + RNA_boolean_set(kmi->ptr, "texture_space", TRUE); break; case SPACE_ACTION: - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_TRANSLATE); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_TRANSLATE); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_SCALE); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_SLIDE); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SLIDE); break; case SPACE_IPO: WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0); break; case SPACE_NLA: - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TRANSLATION); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TRANSLATION); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_SCALE); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE); break; case SPACE_NODE: WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0); - km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0); - RNA_boolean_set(km->ptr, "release_confirm", 1); - km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); - RNA_boolean_set(km->ptr, "release_confirm", 1); + kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0); + RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); + kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); + RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0); @@ -954,8 +954,8 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0); - km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND); + kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); break; case SPACE_IMAGE: WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0); @@ -970,8 +970,8 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0); - km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap"); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap"); break; case SPACE_CLIP: WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0); |