diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 16:39:01 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 17:04:06 +0300 |
commit | 5c61be777f10f65fce0184d43804c2d01cb284ad (patch) | |
tree | d69200bc4367b55dea18b9ee4a0b0b774c265933 /source/blender/makesrna/intern | |
parent | aac5458fa5800cc6c0a7243c1baa13d8190fa4b0 (diff) |
Subsurf: Introduce quality option
For users it defines how accurate vertex positions are in terms
of limit surface (as in, how close the vertices locations to the
condition when they are calculated for an infinitely subdivided
mesh).
This affects things like:
- Irregular vertices (joint of 3 or more edges)
- Crease
Keep quality value low for performance.
NOTE: Going higher does not necessarily mean real improvement
in quality, ideal case might be reached well before maximum
quality of 10. Quality of 3 is a good starting point.
Internally quality is translated directly to adaptive subdivision
level.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D3599
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index ec240c222a1..b98eb84eaae 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -305,6 +305,10 @@ if(WITH_OPENSUBDIV) add_definitions(-DWITH_OPENSUBDIV) endif() +if(WITH_OPENSUBDIV_MODIFIER) + add_definitions(-DWITH_OPENSUBDIV_MODIFIER) +endif() + if(WITH_OPENVDB) add_definitions(-DWITH_OPENVDB) diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index eeeee5d4c9a..50907503aca 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1249,6 +1249,15 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_uv_smooth_items); RNA_def_property_ui_text(prop, "UV Smooth", "Controls how smoothing is applied to UVs"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + +#ifdef WITH_OPENSUBDIV_MODIFIER + prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "quality"); + RNA_def_property_range(prop, 1, 10); + RNA_def_property_ui_range(prop, 1, 6, 1, -1); + RNA_def_property_ui_text(prop, "Quality", "Accuracy of vertex positions, lower value is faster but less precise"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); +#endif } static void rna_def_modifier_generic_map_info(StructRNA *srna) |