Added 'clear active group' to object data properties -> Vertex Groups -> pulldown menu

This commit is contained in:
Gaia Clary 2013-06-04 22:30:41 +00:00
parent 2230794e73
commit 6d9fcdf983
2 changed files with 13 additions and 5 deletions

@ -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'

@ -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))