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:
authorBastien Montagne <bastien@blender.org>2020-06-02 18:15:36 +0300
committerBastien Montagne <bastien@blender.org>2020-06-02 18:30:02 +0300
commit9d9f35d9467a078324b8e9bf6224e2f699667d6b (patch)
tree16998c8e980d301037f34986716650c0ae4a3195 /source/blender/makesrna/intern/rna_modifier.c
parent5ef44dd83f5864d6b5df09e07ed4d1b9357a1214 (diff)
Cleanup: factorize duplicated code in WVG modifiers' RNA.
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index f5a437b7892..a930f122b72 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -4760,6 +4760,7 @@ static void rna_def_modifier_uvwarp(BlenderRNA *brna)
static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna),
StructRNA *srna,
+ const char *mask_flags,
const char *mask_vgroup_setter,
const char *mask_uvlayer_setter)
{
@@ -4802,6 +4803,11 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna),
RNA_def_property_string_funcs(prop, NULL, NULL, mask_vgroup_setter);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, mask_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, "mask_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ -4949,13 +4955,9 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
/* Common masking properties. */
rna_def_modifier_weightvg_mask(brna,
srna,
+ "edit_flags",
"rna_WeightVGEditModifier_mask_defgrp_name_set",
"rna_WeightVGEditModifier_mask_tex_uvlayer_name_set");
-
- prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE);
- 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");
}
static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
@@ -5053,17 +5055,6 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- /* Common masking properties. */
- rna_def_modifier_weightvg_mask(brna,
- srna,
- "rna_WeightVGMixModifier_mask_defgrp_name_set",
- "rna_WeightVGMixModifier_mask_tex_uvlayer_name_set");
-
- prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE);
- 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(
@@ -5071,6 +5062,13 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
"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,
+ "flag",
+ "rna_WeightVGMixModifier_mask_defgrp_name_set",
+ "rna_WeightVGMixModifier_mask_tex_uvlayer_name_set");
}
static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
@@ -5189,14 +5187,9 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
/* Common masking properties. */
rna_def_modifier_weightvg_mask(brna,
srna,
+ "proximity_flags",
"rna_WeightVGProximityModifier_mask_defgrp_name_set",
"rna_WeightVGProximityModifier_mask_tex_uvlayer_name_set");
-
- prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(
- prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_INVERT_VGROUP_MASK);
- RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_remesh(BlenderRNA *brna)