From d220a87b47e317996e58cf5c597c872bc8970925 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 5 Apr 2019 14:13:05 +0200 Subject: Fix T63283: Second subdivision modifier does not ignore crease This is something where there is no single correct behavior, sometimes it's needed to ignore the crease to make mesh more smooth. But sometimes crease is to be considered after first subdivision surface: for example, when adding extra subdivisions for render-time displacement. Made it an option whether modifier needs to take crease into account or not. Existing files should be openable in the 2.7 compatible way, to re-create an old behavior the options is to be manually disabled in the modifier settings. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4652 --- source/blender/modifiers/intern/MOD_multires.c | 1 + source/blender/modifiers/intern/MOD_subsurf.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index af17bd7d53c..a8760d05834 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -61,6 +61,7 @@ static void initData(ModifierData *md) mmd->totlvl = 0; mmd->uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_CORNERS; mmd->quality = 3; + mmd->flags |= eMultiresModifierFlag_UseCrease; } static void copyData(const ModifierData *md_src, ModifierData *md_dst, const int flag) diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 40c9e5c3b1b..74bf6b7e976 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -59,6 +59,7 @@ static void initData(ModifierData *md) smd->renderLevels = 2; smd->uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_CORNERS; smd->quality = 3; + smd->flags |= eSubsurfModifierFlag_UseCrease; } static void copyData(const ModifierData *md, ModifierData *target, const int flag) @@ -126,6 +127,7 @@ static void subdiv_settings_init(SubdivSettings *settings, settings->is_simple = (smd->subdivType == SUBSURF_TYPE_SIMPLE); settings->is_adaptive = true; settings->level = settings->is_simple ? 1 : smd->quality; + settings->use_creases = (smd->flags & eSubsurfModifierFlag_UseCrease); settings->vtx_boundary_interpolation = SUBDIV_VTX_BOUNDARY_EDGE_ONLY; settings->fvar_linear_interpolation = BKE_subdiv_fvar_interpolation_from_uv_smooth(smd->uv_smooth); -- cgit v1.2.3