disable normalize when active vertex contains locked weights

This commit is contained in:
2013-06-25 22:19:48 +00:00
parent eacd013cb4
commit 06b82088fa

View File

@@ -839,6 +839,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
const bool *vgroup_validmap;
eVGroupSelect subset_type = ts->vgroupsubset;
int yco = 0;
int locked = 0;
uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL);
@@ -879,6 +880,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
uiButSetFlag(but, UI_TEXT_LEFT);
if (dg->flag & DG_LOCK_WEIGHT) {
uiButSetFlag(but, UI_BUT_DISABLED);
locked++;
}
xco += x;
@@ -911,7 +913,10 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
ot = WM_operatortype_find("OBJECT_OT_vertex_weight_normalize_active", 1);
but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Normalize",
0, yco, UI_UNIT_X * 5, UI_UNIT_Y,
TIP_("Normalize active vertex weights"));
TIP_("Normalize weights of active vertex (if affected groups are unlocked"));
if(locked) {
uiButSetFlag(but, UI_BUT_DISABLED);
}
ot = WM_operatortype_find("OBJECT_OT_vertex_weight_copy", 1);
but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Copy",