Support multi-paint & show zero-weights as black

Specifically, when only one bone is selected and it's not really active.
(With multiple bones on the other hand that behavior is forced on,
since multi-paint can't modify purely zero weight verts and that's important.)
This commit is contained in:
Alexander Gavrilov 2016-01-18 22:00:56 +03:00 committed by Campbell Barton
parent 5feb3688fb
commit bda0820d57
3 changed files with 4 additions and 5 deletions

@ -1654,7 +1654,6 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
col.label("Show Zero Weights:")
sub = col.row()
sub.active = (not tool_settings.use_multipaint)
sub.prop(tool_settings, "vertex_group_user", expand=True)
self.unified_paint_settings(col, context)

@ -1333,9 +1333,9 @@ typedef struct DMWeightColorInfo {
static int dm_drawflag_calc(const ToolSettings *ts)
{
return ((ts->multipaint ? CALC_WP_MULTIPAINT :
/* CALC_WP_GROUP_USER_ACTIVE or CALC_WP_GROUP_USER_ALL*/
(1 << ts->weightuser)) |
return ((ts->multipaint ? CALC_WP_MULTIPAINT : 0) |
/* CALC_WP_GROUP_USER_ACTIVE or CALC_WP_GROUP_USER_ALL*/
(1 << ts->weightuser) |
(ts->auto_normalize ? CALC_WP_AUTO_NORMALIZE : 0));
}

@ -2109,7 +2109,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "vertex_group_user", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "weightuser");
RNA_def_property_enum_items(prop, draw_groupuser_items);
RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted vertices (multi-paint overrides)");
RNA_def_property_ui_text(prop, "Mask Non-Group Vertices", "Display unweighted verticess");
RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
prop = RNA_def_property(srna, "vertex_group_subset", PROP_ENUM, PROP_NONE);