[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37136] branches/soc-2011-radish: Added a hard coded check box to the vertex group list items in interface/ interface_templates.c list_item_row()

Jason Hays jason_hays22 at mymail.eku.edu
Fri Jun 3 18:08:04 CEST 2011


Revision: 37136
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37136
Author:   jason_hays22
Date:     2011-06-03 16:08:03 +0000 (Fri, 03 Jun 2011)
Log Message:
-----------
Added a hard coded check box to the vertex group list items in interface/interface_templates.c list_item_row()

Made my 3 new buttons only appear in weight paint mode when there are vertex groups present
in properties_data_mesh.py

I took the now redundant check box out of properties_data_mesh.py

I took out unnecessary code (resulting from copy/paste) from my lock all, unlock all, and invert all functions of object/object_vgroup.c

(and I got rid of a new line in paint_vertex.c :) )

Modified Paths:
--------------
    branches/soc-2011-radish/release/scripts/startup/bl_ui/properties_data_mesh.py
    branches/soc-2011-radish/source/blender/editors/interface/interface_templates.c
    branches/soc-2011-radish/source/blender/editors/object/object_vgroup.c
    branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c

Modified: branches/soc-2011-radish/release/scripts/startup/bl_ui/properties_data_mesh.py
===================================================================
--- branches/soc-2011-radish/release/scripts/startup/bl_ui/properties_data_mesh.py	2011-06-03 15:39:53 UTC (rev 37135)
+++ branches/soc-2011-radish/release/scripts/startup/bl_ui/properties_data_mesh.py	2011-06-03 16:08:03 UTC (rev 37136)
@@ -137,8 +137,8 @@
         row.template_list(ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
 
         col = row.column(align=True)
-        # Jason was here #
-        col.prop(group, "flag")
+        # Jason was here, this was replaced by hardcoded list view checkboxes. #
+        #col.prop(group, "flag")
         
         col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
         col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="")
@@ -151,11 +151,12 @@
             row = layout.row()
             row.prop(group, "name")
         #Jason was here
-        row = layout.row()
-        sub = row.row(align=True)
-        sub.operator("object.vertex_group_lock_all", text="Lock All")
-        sub.operator("object.vertex_group_invert_locks", text="Invert Locks")
-        sub.operator("object.vertex_group_unlock_all", text="Unlock All")
+        if ob.mode == 'WEIGHT_PAINT' and len(ob.vertex_groups) > 0:
+            row = layout.row()
+            sub = row.row(align=True)
+            sub.operator("object.vertex_group_lock_all", text="Lock All")
+            sub.operator("object.vertex_group_invert_locks", text="Invert Locks")
+            sub.operator("object.vertex_group_unlock_all", text="Unlock All")
 
         if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
             row = layout.row()

Modified: branches/soc-2011-radish/source/blender/editors/interface/interface_templates.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/interface/interface_templates.c	2011-06-03 15:39:53 UTC (rev 37135)
+++ branches/soc-2011-radish/source/blender/editors/interface/interface_templates.c	2011-06-03 16:08:03 UTC (rev 37136)
@@ -2118,6 +2118,12 @@
 		//uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
 		uiBlockSetEmboss(block, UI_EMBOSS);
 	}
+	/* Jason was here: I need the RNA struct for vertex groups */
+	else if(RNA_struct_is_a(itemptr->type, &RNA_VertexGroup)) {
+		uiItemL(sub, name, icon);
+		uiBlockSetEmboss(block, UI_EMBOSS);
+		uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "flag", 0, 0, 0, 0, 0,  NULL);
+	}
 	else
 		uiItemL(sub, name, icon); /* fails, backdrop LISTROW... */
 

Modified: branches/soc-2011-radish/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/object/object_vgroup.c	2011-06-03 15:39:53 UTC (rev 37135)
+++ branches/soc-2011-radish/source/blender/editors/object/object_vgroup.c	2011-06-03 16:08:03 UTC (rev 37136)
@@ -1778,10 +1778,6 @@
 	Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 
 	vgroup_invert_locks(ob);
-	// not sure what these 3 do yet!
-	DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-	WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-	WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 
 	return OPERATOR_FINISHED;
 }
@@ -1805,10 +1801,6 @@
 	Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 
 	vgroup_lock_all(ob);
-	// not sure what these 3 do yet!
-	DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-	WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-	WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 
 	return OPERATOR_FINISHED;
 }
@@ -1832,10 +1824,6 @@
 	Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
 
 	vgroup_unlock_all(ob);
-	// not sure what these 3 do yet!
-	DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-	WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
-	WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 
 	return OPERATOR_FINISHED;
 }

Modified: branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c	2011-06-03 15:39:53 UTC (rev 37135)
+++ branches/soc-2011-radish/source/blender/editors/sculpt_paint/paint_vertex.c	2011-06-03 16:08:03 UTC (rev 37136)
@@ -1280,7 +1280,6 @@
 	} else if(bone_groups[dw->def_nr]) {// disable auto normalize if the active group is not a bone group
 		do_weight_paint_auto_normalize(me->dvert+index, vgroup, validmap);
 	}
-	
 }
 // Jason
 static char *wpaint_make_validmap(Object *ob);




More information about the Bf-blender-cvs mailing list