diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv_mesh.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires_subdiv.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_mesh.c | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_subsurf.c | 2 |
4 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_mesh.h b/source/blender/blenkernel/BKE_subdiv_mesh.h index f719527eed8..6f1ffb2555b 100644 --- a/source/blender/blenkernel/BKE_subdiv_mesh.h +++ b/source/blender/blenkernel/BKE_subdiv_mesh.h @@ -45,6 +45,8 @@ typedef struct SubdivToMeshSettings { * `resolution - 1`. */ int resolution; + /* When true, only edges emitted from coarse ones will be displayed. */ + bool use_optimal_display; } SubdivToMeshSettings; /* Create real hi-res mesh from subdivision, all geometry is "real". */ diff --git a/source/blender/blenkernel/intern/multires_subdiv.c b/source/blender/blenkernel/intern/multires_subdiv.c index e0b316d49de..3de007dec75 100644 --- a/source/blender/blenkernel/intern/multires_subdiv.c +++ b/source/blender/blenkernel/intern/multires_subdiv.c @@ -64,4 +64,6 @@ void BKE_multires_subdiv_mesh_settings_init( const int level = multires_get_level( scene, object, mmd, use_render_params, ignore_simplify); mesh_settings->resolution = (1 << level) + 1; + mesh_settings->use_optimal_display = + (mmd->flags & eMultiresModifierFlag_ControlEdges); } diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c index d9fcdf52969..4d9e8998cf0 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_mesh.c @@ -53,6 +53,7 @@ */ typedef struct SubdivMeshContext { + const SubdivToMeshSettings *settings; const Mesh *coarse_mesh; Subdiv *subdiv; Mesh *subdiv_mesh; @@ -766,6 +767,9 @@ static void subdiv_copy_edge_data( subdiv_edge->crease = 0; subdiv_edge->bweight = 0; subdiv_edge->flag = 0; + if (!ctx->settings->use_optimal_display) { + subdiv_edge->flag |= ME_EDGERENDER; + } if (ctx->edge_origindex != NULL) { ctx->edge_origindex[subdiv_edge_index] = ORIGINDEX_NONE; } @@ -777,6 +781,7 @@ static void subdiv_copy_edge_data( coarse_edge_index, subdiv_edge_index, 1); + subdiv_edge->flag |= ME_EDGERENDER; } static void subdiv_mesh_edge( @@ -1123,6 +1128,7 @@ Mesh *BKE_subdiv_to_mesh( } /* Initialize subdivion mesh creation context/ */ SubdivMeshContext subdiv_context = {0}; + subdiv_context.settings = settings; subdiv_context.coarse_mesh = coarse_mesh; subdiv_context.subdiv = subdiv; /* Multi-threaded traversal/evaluation. */ diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 9c6bff6b291..3b81ec116be 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -130,6 +130,8 @@ static void subdiv_mesh_settings_init(SubdivToMeshSettings *settings, { const int level = subdiv_levels_for_modifier_get(smd, ctx); settings->resolution = (1 << level) + 1; + settings->use_optimal_display = + (smd->flags & eSubsurfModifierFlag_ControlEdges); } static Mesh *subdiv_as_mesh(SubsurfModifierData *smd, |