[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57243] trunk/blender: Added ' clear active group' to object data properties -> Vertex Groups -> pulldown menu

Gaia Clary gaia.clary at machinimatrix.org
Wed Jun 5 00:30:41 CEST 2013


Revision: 57243
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57243
Author:   gaiaclary
Date:     2013-06-04 22:30:41 +0000 (Tue, 04 Jun 2013)
Log Message:
-----------
Added 'clear active group' to object data properties -> Vertex Groups -> pulldown menu

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py
    trunk/blender/source/blender/editors/object/object_vgroup.c

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py	2013-06-04 21:54:16 UTC (rev 57242)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_data_mesh.py	2013-06-04 22:30:41 UTC (rev 57243)
@@ -34,8 +34,9 @@
         layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
         layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
         layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT')
-        layout.operator("object.vertex_group_remove", icon='X', text="Delete All Vertex Groups").all = True
-        layout.operator("object.vertex_group_remove_from", icon='X', text="Remove Selected from All Vertex Groups").all = True
+        layout.operator("object.vertex_group_remove_from", icon='X', text="Remove from All Groups").use_all_groups = True
+        layout.operator("object.vertex_group_remove_from", icon='X', text="Clear Active Group").use_all_verts = True
+        layout.operator("object.vertex_group_remove", icon='X', text="Delete All Groups").all = True
         layout.separator()
         layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'LOCK'
         layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'UNLOCK'

Modified: trunk/blender/source/blender/editors/object/object_vgroup.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_vgroup.c	2013-06-04 21:54:16 UTC (rev 57242)
+++ trunk/blender/source/blender/editors/object/object_vgroup.c	2013-06-04 22:30:41 UTC (rev 57243)
@@ -2850,9 +2850,12 @@
 
 static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
 {
+	const bool use_all_groups = RNA_boolean_get(op->ptr, "use_all_groups");
+	const bool use_all_verts = RNA_boolean_get(op->ptr, "use_all_verts");
+
 	Object *ob = ED_object_context(C);
 
-	if (RNA_boolean_get(op->ptr, "all")) {
+	if (use_all_groups) {
 		if (vgroup_remove_verts(ob, 0) == false) {
 			return OPERATOR_CANCELLED;
 		}
@@ -2860,7 +2863,7 @@
 	else {
 		bDeformGroup *dg = BLI_findlink(&ob->defbase, ob->actdef - 1);
 
-		if ((dg == NULL) || (vgroup_active_remove_verts(ob, false, dg) == false)) {
+		if ((dg == NULL) || (vgroup_active_remove_verts(ob, use_all_verts, dg) == false)) {
 			return OPERATOR_CANCELLED;
 		}
 	}
@@ -2873,6 +2876,7 @@
 
 void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
 {
+	PropertyRNA *prop;
 	/* identifiers */
 	ot->name = "Remove from Vertex Group";
 	ot->idname = "OBJECT_OT_vertex_group_remove_from";
@@ -2889,7 +2893,10 @@
 	ot->flag = /*OPTYPE_REGISTER|*/ OPTYPE_UNDO;
 
 	/* properties */
-	RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups");
+	prop = RNA_def_boolean(ot->srna, "use_all_groups", 0, "All Groups", "Remove from all Groups");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_boolean(ot->srna, "use_all_verts", 0, "All verts", "Clear Active Group");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op))




More information about the Bf-blender-cvs mailing list