From bb26c1359e4f4bb21ec4ec4ab37e28d1fada20b8 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 24 Mar 2020 18:28:09 +0100 Subject: Add invert mapping option to proximity weight edit modifier, and some cleanup. --- source/blender/makesrna/intern/rna_modifier.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index a42c3e6a171..c50e68b9465 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -4802,6 +4802,16 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */ RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "invert_falloff", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_INVERT_FALLOFF); + 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, "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"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG); RNA_def_property_ui_text(prop, @@ -4827,11 +4837,6 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) "it is not in the vgroup"); 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"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "add_threshold"); RNA_def_property_range(prop, 0.0, 1.0); @@ -4862,11 +4867,6 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_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, "invert_falloff", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_INVERT_FALLOFF); - RNA_def_property_ui_text(prop, "Invert Falloff", "Invert the resulting falloff weight"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_weightvgmix(BlenderRNA *brna) @@ -5065,6 +5065,11 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */ RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "invert_falloff", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_INVERT_FALLOFF); + RNA_def_property_ui_text(prop, "Invert Falloff", "Invert the resulting falloff weight"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + /* Common masking properties. */ rna_def_modifier_weightvg_mask(brna, srna, -- cgit v1.2.3