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 :) )
This commit is contained in:
@@ -137,8 +137,8 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
|
||||
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 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
|
||||
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()
|
||||
|
||||
@@ -2118,6 +2118,12 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
|
||||
//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... */
|
||||
|
||||
|
||||
@@ -1778,10 +1778,6 @@ static int vertex_group_invert_locks_exec(bContext *C, wmOperator *op)
|
||||
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 @@ static int vertex_group_lock_all_exec(bContext *C, wmOperator *op)
|
||||
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 @@ static int vertex_group_unlock_all_exec(bContext *C, wmOperator *op)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1280,7 +1280,6 @@ static void check_locks_and_normalize(Mesh *me, int index, int vgroup, MDeformWe
|
||||
} 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);
|
||||
|
||||
Reference in New Issue
Block a user