diff options
author | Piotr Ostrowski <postrowski> | 2020-09-30 16:56:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-09-30 18:20:29 +0300 |
commit | 6070f92ab94be7bd1d6729f178d71c71c4245fbb (patch) | |
tree | bacd1100dffa84ddf51fbd4d53b58eb3d29c0916 /source/blender/makesrna | |
parent | 53f20b940a1e520e131b8bb31cf0529ed4d30f9e (diff) |
Subdivision Surfaces: add boundary smooth option to modifiers
This adds the option to either smooth the entire boundary, or to keep
corners sharp, for the Subdivision Surface and Multiresolution modifiers.
This mainly helps with compatibility with other software. The default
behavior remains to smooth the entire boundary.
Differential Revision: https://developer.blender.org/D8485
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 134ce15e3f2..a0a8d37fd56 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1686,6 +1686,16 @@ static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const c {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem prop_boundary_smooth_items[] = { + {SUBSURF_BOUNDARY_SMOOTH_PRESERVE_CORNERS, + "PRESERVE_CORNERS", + 0, + "Keep Corners", + "Smooth boundaries, but corners are kept sharp"}, + {SUBSURF_BOUNDARY_SMOOTH_ALL, "ALL", 0, "All", "Smooth boundaries, including corners"}, + {0, NULL, 0, NULL, NULL}, + }; + PropertyRNA *prop; RNA_define_lib_overridable(true); @@ -1704,6 +1714,12 @@ static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const c prop, "Quality", "Accuracy of vertex positions, lower value is faster but less precise"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "boundary_smooth", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "boundary_smooth"); + RNA_def_property_enum_items(prop, prop_boundary_smooth_items); + 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); |