- weight paint poll would crash if no area was found.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 22 Mar 2011 14:04:47 +0000 (14:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 22 Mar 2011 14:04:47 +0000 (14:04 +0000)
- don't print a line for each operator run when in background mode.
- extrude was using an invalid type for RNA access.

source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/windowmanager/intern/wm_event_system.c

index 0dc4314d5890a3ff1e1fccb30f81825a724f999b..5525a486438d07722b7960cd663051464d40c74c 100644 (file)
@@ -728,7 +728,7 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
        
-       extrude_mesh(obedit, em, op, RNA_int_get(op->ptr, "type"));
+       extrude_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type"));
 
        BKE_mesh_end_editmesh(obedit->data, em);
 
index b0979817c886199979d8145c6510ffa9425b8219..6859fd333bcac951ae018edff75fba86858907cb 100644 (file)
@@ -127,15 +127,18 @@ int weight_paint_mode_poll(bContext *C)
 
 int weight_paint_poll(bContext *C)
 {
-       Object *ob = CTX_data_active_object(C);
-
-       if(ob && ob->mode & OB_MODE_WEIGHT_PAINT &&
-          paint_brush(&CTX_data_tool_settings(C)->wpaint->paint)) {
-               ScrArea *sa= CTX_wm_area(C);
-               if(sa->spacetype==SPACE_VIEW3D) {
-                       ARegion *ar= CTX_wm_region(C);
-                       if(ar->regiontype==RGN_TYPE_WINDOW)
-                               return 1;
+       Object *ob= CTX_data_active_object(C);
+       ScrArea *sa;
+
+       if(     (ob != NULL) &&
+               (ob->mode & OB_MODE_WEIGHT_PAINT) &&
+               (paint_brush(&CTX_data_tool_settings(C)->wpaint->paint) != NULL) &&
+               (sa= CTX_wm_area(C)) &&
+               (sa->spacetype == SPACE_VIEW3D)
+       ) {
+               ARegion *ar= CTX_wm_region(C);
+               if(ar->regiontype==RGN_TYPE_WINDOW) {
+                       return 1;
                }
        }
        return 0;
index 15964b8c1e56bc51022f71a7acbb48d47f6f604f..8dcd3fa34d17326cf4cfe8edfc5b8aa1e31d5867 100644 (file)
@@ -446,10 +446,12 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int pop
                        wm_operator_print(C, op); /* todo - this print may double up, might want to check more flags then the FINISHED */
                
                if (op->type->flag & OPTYPE_REGISTER) {
-                       /* Report the python string representation of the operator */
-                       char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
-                       BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
-                       MEM_freeN(buf);
+                       if(G.background == 0) { /* ends up printing these in the terminal, gets annoying */
+                               /* Report the python string representation of the operator */
+                               char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
+                               BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
+                               MEM_freeN(buf);
+                       }
                }
        }