diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-26 16:08:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-26 16:08:04 +0300 |
commit | 280de3df07919d62a3d9ada4989342c3fc7a251f (patch) | |
tree | 81ae470db66352caa4bab66095ac86c089c6ba25 | |
parent | e4284d06ada4f3eeac9c19f987e8b2d8eff47e62 (diff) |
Multires: Use proper subdivision level for reshape
Apparently, part of code got lost last minute prior to push.
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 3 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_multires.c | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 0c1da652d0d..cf6f2e5d842 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -385,9 +385,10 @@ static void object_update_from_subsurf_ccg(Object *object) if (!subdiv_ccg->dirty.coords && !subdiv_ccg->dirty.hidden) { return; } + const int tot_level = mesh_eval->runtime.subdiv_ccg_tot_level; Object *object_orig = DEG_get_original_object(object); Mesh *mesh_orig = (Mesh *)object_orig->data; - multiresModifier_reshapeFromCCG(6, mesh_orig, subdiv_ccg); + multiresModifier_reshapeFromCCG(tot_level, mesh_orig, subdiv_ccg); /* NOTE: we need to reshape into an original mesh from main database, * allowing: * diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index e8eb59cb5e0..656f9fa3034 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -84,8 +84,11 @@ struct MLoopTri_Store { typedef struct Mesh_Runtime { struct EditMeshData *edit_data; void *batch_cache; + struct SubdivCCG *subdiv_ccg; void *pad1; + int subdiv_ccg_tot_level; + int pad2; int64_t cd_dirty_vert; int64_t cd_dirty_edge; diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 8c055536834..18b6dc5d846 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -236,6 +236,7 @@ static Mesh *applyModifier_subdiv(ModifierData *md, if ((ctx->object->mode & OB_MODE_SCULPT) && !for_orco) { /* NOTE: CCG takes ownership over Subdiv. */ result = multires_as_ccg(mmd, ctx, mesh, subdiv); + result->runtime.subdiv_ccg_tot_level = mmd->totlvl; // BKE_subdiv_stats_print(&subdiv->stats); } else { |