Fix T67888: Incorrect Wireframe After Applying SubSurf/MultiRes

Show control edges stores the control edges in the mesh which is
picked up by the draw manager. When applyng a subsurf (or multires) we
don't want that data present in the base mesh. Any rebuilding of the mesh
would overwrite the data anyway.

This patch introduces a new flag for applying modifiers
that can be checked to ignore storing display specific data in
the base mesh.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7163
This commit is contained in:
Jeroen Bakker
2020-03-26 14:36:39 +01:00
committed by Jeroen Bakker
parent 2e8fb95e7c
commit 7ed3ebbc6e
6 changed files with 22 additions and 7 deletions

View File

@@ -119,11 +119,17 @@ static Mesh *multires_as_mesh(MultiresModifierData *mmd,
Mesh *result = mesh;
const bool use_render_params = (ctx->flag & MOD_APPLY_RENDER);
const bool ignore_simplify = (ctx->flag & MOD_APPLY_IGNORE_SIMPLIFY);
const bool ignore_control_edges = (ctx->flag & MOD_APPLY_TO_BASE_MESH);
const Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
Object *object = ctx->object;
SubdivToMeshSettings mesh_settings;
BKE_multires_subdiv_mesh_settings_init(
&mesh_settings, scene, object, mmd, use_render_params, ignore_simplify);
BKE_multires_subdiv_mesh_settings_init(&mesh_settings,
scene,
object,
mmd,
use_render_params,
ignore_simplify,
ignore_control_edges);
if (mesh_settings.resolution < 3) {
return result;
}