[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35700] trunk/blender/source/blender: - weight paint poll would crash if no area was found.

Campbell Barton ideasman42 at gmail.com
Tue Mar 22 15:04:47 CET 2011


Revision: 35700
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35700
Author:   campbellbarton
Date:     2011-03-22 14:04:47 +0000 (Tue, 22 Mar 2011)
Log Message:
-----------
- weight paint poll would crash if no area was found.
- don't print a line for each operator run when in background mode.
- extrude was using an invalid type for RNA access.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2011-03-22 13:30:50 UTC (rev 35699)
+++ trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2011-03-22 14:04:47 UTC (rev 35700)
@@ -728,7 +728,7 @@
 	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);
 

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c	2011-03-22 13:30:50 UTC (rev 35699)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_vertex.c	2011-03-22 14:04:47 UTC (rev 35700)
@@ -127,15 +127,18 @@
 
 int weight_paint_poll(bContext *C)
 {
-	Object *ob = CTX_data_active_object(C);
+	Object *ob= CTX_data_active_object(C);
+	ScrArea *sa;
 
-	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;
+	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;

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2011-03-22 13:30:50 UTC (rev 35699)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2011-03-22 14:04:47 UTC (rev 35700)
@@ -446,10 +446,12 @@
 			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);
+			}
 		}
 	}
 




More information about the Bf-blender-cvs mailing list