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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-06-10 21:06:26 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-06-10 21:06:26 +0400
commitb38e4506a6bdd7d9b842f5afd264b9d850703ede (patch)
treed0f99927f577c2ffc6164e1ec1c84163a05a1a78
parentfa1d458b19a077eff5a258d6933d5f1eb801e019 (diff)
Force multires update when changing subdivision type.
Fixes bug [#31050] Changing multires subdivision algorithm can ruin mesh
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 21a01cf43a8..eb31d83fce8 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -477,6 +477,15 @@ static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *v
}
}
+static void rna_MultiresModifier_type_set(PointerRNA *ptr, int value)
+{
+ Object *ob = (Object *)ptr->id.data;
+ MultiresModifierData *mmd = (MultiresModifierData *)ptr->data;
+
+ multires_force_update(ob);
+ mmd->simple = value;
+}
+
static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
{
MultiresModifierData *mmd = (MultiresModifierData *)ptr->data;
@@ -739,7 +748,7 @@ static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value)
#else
-static void rna_def_property_subdivision_common(StructRNA *srna, const char type[])
+static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const char type[])
{
static EnumPropertyItem prop_subdivision_type_items[] = {
{0, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
@@ -752,6 +761,8 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type
RNA_def_property_enum_items(prop, prop_subdivision_type_items);
RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ return prop;
}
static void rna_def_modifier_subsurf(BlenderRNA *brna)
@@ -901,7 +912,8 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "MultiresModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES);
- rna_def_property_subdivision_common(srna, "simple");
+ prop = rna_def_property_subdivision_common(srna, "simple");
+ RNA_def_property_enum_funcs(prop, NULL, "rna_MultiresModifier_type_set", NULL);
prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "lvl");