Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Winchester <CodyWinch>2020-05-26 21:53:38 +0300
committerBastien Montagne <bastien@blender.org>2020-05-26 21:56:27 +0300
commitde257b6366455ba6a3604c0830a92245df11f7bc (patch)
tree239c022c52cbb655ce2116fddb151c3f55549ed6 /source/blender/makesrna/intern/rna_modifier.c
parent00674c12cc0f08254e5643ad18120b2e9e710a94 (diff)
Modifiers: Add normalize weights option to vertex weight modifiers
Original patch by Cody Winchester (@CodyWinch), several fixes and cleanup by Bastien Montagne (@mont29). Differential revision: https://developer.blender.org/D7656
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 48e3c47208f..885d65e50ad 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -4888,6 +4888,14 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Falloff", "Invert the resulting falloff weight");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_WEIGHTS_NORMALIZE);
+ RNA_def_property_ui_text(
+ prop,
+ "Normalize Weights",
+ "Normalize the resulting weights (otherwise they are only clamped within [0.0, 1.0] range)");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
prop = RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve");
RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve");
@@ -5045,6 +5053,14 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WVG_MIX_INVERT_VGROUP_MASK);
RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WVG_MIX_WEIGHTS_NORMALIZE);
+ RNA_def_property_ui_text(
+ prop,
+ "Normalize Weights",
+ "Normalize the resulting weights (otherwise they are only clamped within [0.0, 1.0] range)");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
@@ -5151,6 +5167,15 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Falloff", "Invert the resulting falloff weight");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(
+ prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE);
+ RNA_def_property_ui_text(
+ prop,
+ "Normalize Weights",
+ "Normalize the resulting weights (otherwise they are only clamped within [0.0, 1.0] range)");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
/* Common masking properties. */
rna_def_modifier_weightvg_mask(brna,
srna,