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:
authorSergey Sharybin <sergey@blender.org>2020-10-26 14:32:22 +0300
committerSergey Sharybin <sergey@blender.org>2020-10-27 12:31:48 +0300
commit17381c7b90eb3acde53eca013ae5a5a55699f17d (patch)
tree403a988cb4a5698c4ebcfdb0e34e45e0c799987e /source/blender/makesrna/intern/rna_modifier.c
parent09139e41ed4eaf4d9b8943e92b8604d979dbbc92 (diff)
Multires: Remove simple subdivision type
The simple subdivision as a type only causes issues like no-continuous normals across edges, inability to reliably switch the type and things like this. The new subdivision operators supports wider variety of how to add details to the model, which are more powerful than a single one-time decision on the subdivision type. The versioning code is adjusting topology converter to specify all edges as infinitely sharp. The reason for this (instead of using settings.is_simple) is because in a longer term the simple subdivision will be removed from Subsurf modifier as well, and will be replaced with more efficient bmesh-based modifier. This is finished up version of D8436. Differential Revision: https://developer.blender.org/D9350
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 7885e182787..8a66c95beef 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -969,15 +969,6 @@ static void rna_fluid_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
rna_Modifier_dependency_update(bmain, scene, ptr);
}
-static void rna_MultiresModifier_type_set(PointerRNA *ptr, int value)
-{
- Object *ob = (Object *)ptr->owner_id;
- MultiresModifierData *mmd = (MultiresModifierData *)ptr->data;
-
- multires_force_sculpt_rebuild(ob);
- mmd->simple = value;
-}
-
static void rna_MultiresModifier_level_range(
PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
{
@@ -1604,15 +1595,8 @@ static int rna_MeshSequenceCacheModifier_read_velocity_get(PointerRNA *ptr)
#else
-/* NOTE: *MUST* return subdivision_type property. */
-static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const char type[])
+static void rna_def_property_subdivision_common(StructRNA *srna)
{
- static const EnumPropertyItem prop_subdivision_type_items[] = {
- {SUBSURF_TYPE_CATMULL_CLARK, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
- {SUBSURF_TYPE_SIMPLE, "SIMPLE", 0, "Simple", ""},
- {0, NULL, 0, NULL, NULL},
- };
-
static const EnumPropertyItem prop_uv_smooth_items[] = {
{SUBSURF_UV_SMOOTH_NONE, "NONE", 0, "None", "UVs are not smoothed, boundaries are kept sharp"},
{SUBSURF_UV_SMOOTH_PRESERVE_CORNERS,
@@ -1677,19 +1661,17 @@ static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const c
RNA_def_property_ui_text(prop, "Boundary Smooth", "Controls how open boundaries are smoothed");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop = RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, 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");
-
RNA_define_lib_overridable(false);
-
- return prop;
}
static void rna_def_modifier_subsurf(BlenderRNA *brna)
{
+ static const EnumPropertyItem prop_subdivision_type_items[] = {
+ {SUBSURF_TYPE_CATMULL_CLARK, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
+ {SUBSURF_TYPE_SIMPLE, "SIMPLE", 0, "Simple", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
StructRNA *srna;
PropertyRNA *prop;
@@ -1698,10 +1680,16 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SubsurfModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
- rna_def_property_subdivision_common(srna, "subdivType");
+ rna_def_property_subdivision_common(srna);
RNA_define_lib_overridable(true);
+ prop = RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "subdivType");
+ 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");
+
/* see CCGSUBSURF_LEVEL_MAX for max limit */
prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "levels");
@@ -1893,8 +1881,7 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
RNA_define_lib_overridable(true);
- prop = rna_def_property_subdivision_common(srna, "simple");
- RNA_def_property_enum_funcs(prop, NULL, "rna_MultiresModifier_type_set", NULL);
+ rna_def_property_subdivision_common(srna);
prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "lvl");