diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-29 05:04:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-29 05:04:47 +0300 |
commit | a0453dadf0685782ffb8ac6b3c6470a3d44c8a01 (patch) | |
tree | e93f313f3dfaa12108a0c3e4a7e65d1738a95708 /source | |
parent | d58cf8292c039a943efbecb5c5ac07ea160f3d0f (diff) | |
parent | 6c892efdbc4d5882da9a2655b21e4f4c2559106b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 7 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_mask.c | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 9f7b09b4a18..6f8793bf0f7 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -219,8 +219,9 @@ typedef struct MaskModifierData { struct Object *ob_arm; /* armature to use to in place of hardcoded vgroup */ char vgroup[64]; /* name of vertex group to use to mask, MAX_VGROUP_NAME */ - int mode; /* using armature or hardcoded vgroup */ - int flag; /* flags for various things */ + short mode; /* using armature or hardcoded vgroup */ + short flag; /* flags for various things */ + float threshold; } MaskModifierData; /* Mask Modifier -> mode */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index fe36880657c..dda2ee1e415 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -3336,6 +3336,13 @@ static void rna_def_modifier_mask(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV); RNA_def_property_ui_text(prop, "Invert", "Use vertices that are not part of region defined"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "threshold"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_range(prop, 0, 1, 0.1, 3); + RNA_def_property_ui_text(prop, "Threshold", "Weights over this threshold remain"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_simpledeform(BlenderRNA *brna) diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 6f431911741..78058277033 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -183,7 +183,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes for (j = 0; j < dv->totweight; j++, dw++) { if (dw->def_nr < defbase_tot) { if (bone_select_array[dw->def_nr]) { - if (dw->weight != 0.0f) { + if (dw->weight > mmd->threshold) { found = true; break; } @@ -216,7 +216,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes /* add vertices which exist in vertexgroup into ghash for filtering */ for (i = 0, dv = dvert; i < maxVerts; i++, dv++) { - const bool found = defvert_find_weight(dv, defgrp_index) != 0.0f; + const bool found = defvert_find_weight(dv, defgrp_index) > mmd->threshold; if (found_test != found) { continue; } |