Added 'clear active group' to object data properties -> Vertex Groups -> pulldown...
authorGaia Clary <gaia.clary@machinimatrix.org>
Tue, 4 Jun 2013 22:30:41 +0000 (22:30 +0000)
committerGaia Clary <gaia.clary@machinimatrix.org>
Tue, 4 Jun 2013 22:30:41 +0000 (22:30 +0000)
release/scripts/startup/bl_ui/properties_data_mesh.py
source/blender/editors/object/object_vgroup.c

index 86a48999663677c7597afdf5ae17c385cc0fdd7f..f85e7697df6dc246126420d0b5797d5d1b5fd456 100644 (file)
@@ -34,8 +34,9 @@ class MESH_MT_vertex_group_specials(Menu):
         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'
index 9a6cc7e43406c51b19bdf3698eeb5889bd72d897..b3c8b1f720b4e8ebb35ecf1e4c57276e51558cda 100644 (file)
@@ -2850,9 +2850,12 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
 
 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 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
        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 @@ static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
 
 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 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
        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))