fix for a crash when running blender in debug mode (-d arg), was registering every...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 23 Dec 2009 15:06:47 +0000 (15:06 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 23 Dec 2009 15:06:47 +0000 (15:06 +0000)
added some more sculpt key shortcuts
* R toggles rake
* Shift+A toggles airbrush

note: last commit added Ctrl+0 to set zero subsurf and multires

source/blender/editors/sculpt_paint/paint_ops.c
source/blender/windowmanager/intern/wm_event_system.c

index b87d229545e26fbdfa5e8c0c0bf4002120f33b04..5cfda00951440f37086ff899aaecd965cb90e6d0 100644 (file)
@@ -214,6 +214,12 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_smooth_stroke");
 
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", RKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_rake");
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_airbrush");
+
        /* brush switching */
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", DKEY, KM_PRESS, 0, 0);
        RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
index 6b0368fbf8aa504d5cb4a7925c489f9a1d8f9045..825d8cbcf8cc038efa9b378d2de2da8d30a45f37 100644 (file)
@@ -316,7 +316,13 @@ static int wm_operator_exec(bContext *C, wmOperator *op, int repeat)
                        ED_undo_push_op(C, op);
                
                if(repeat==0) {
-                       if((op->type->flag & OPTYPE_REGISTER) || (G.f & G_DEBUG))
+                       if(G.f & G_DEBUG) {
+                               char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
+                               BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
+                               MEM_freeN(buf);
+                       }
+
+                       if((op->type->flag & OPTYPE_REGISTER))
                                wm_operator_register(C, op);
                        else
                                WM_operator_free(op);
@@ -450,7 +456,13 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
                        if(ot->flag & OPTYPE_UNDO)
                                ED_undo_push_op(C, op);
                        
-                       if((ot->flag & OPTYPE_REGISTER) || (G.f & G_DEBUG))
+                       if(G.f & G_DEBUG) {
+                               char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
+                               BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
+                               MEM_freeN(buf);
+                       }
+                       
+                       if((ot->flag & OPTYPE_REGISTER))
                                wm_operator_register(C, op);
                        else
                                WM_operator_free(op);
@@ -899,7 +911,13 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                                if(ot->flag & OPTYPE_UNDO)
                                        ED_undo_push_op(C, op);
                                
-                               if((ot->flag & OPTYPE_REGISTER) || (G.f & G_DEBUG))
+                               if(G.f & G_DEBUG) {
+                                       char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
+                                       BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
+                                       MEM_freeN(buf);
+                               }
+                               
+                               if((ot->flag & OPTYPE_REGISTER))
                                        wm_operator_register(C, op);
                                else
                                        WM_operator_free(op);