From 23fd95458c264dc53f5ce94cd2c65404a69d0f6f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 May 2020 10:42:13 +0200 Subject: Multires: Fix wrong or missing mask propagation Propagation when changing sculpt level was missing. In fact, the mask was simply completely removed when changing sculpt level. Subdivision worked for simple and linear subdivision, but Catmull-Clark was giving empty results. Fixes propagation part of T76386. --- source/blender/blenkernel/intern/multires_reshape.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/multires_reshape.c') diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c index c5184881b7c..e59b19638f8 100644 --- a/source/blender/blenkernel/intern/multires_reshape.c +++ b/source/blender/blenkernel/intern/multires_reshape.c @@ -216,19 +216,20 @@ void multiresModifier_subdivide_to_level(struct Object *object, multires_reshape_store_original_grids(&reshape_context); multires_reshape_ensure_grids(coarse_mesh, reshape_context.top.level); - multires_reshape_assign_final_coords_from_orig_mdisps(&reshape_context); + multires_reshape_assign_final_elements_from_orig_mdisps(&reshape_context); + + /* Free original grids which makes it so smoothing with details thinks all the details were + * added against base mesh's limit surface. This is similar behavior to as if we've done all + * displacement in sculpt mode at the old top level and then propagated to the new top level.*/ + multires_reshape_free_original_grids(&reshape_context); if (ELEM(mode, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE)) { multires_reshape_smooth_object_grids(&reshape_context, mode); } else { - /* Free original grids which makes it so smoothing with details thinks all the details were - * added against base mesh's limit surface. This is similar behavior to as if we've done all - * displacement in sculpt mode at the old top level and then propagated to the new top level.*/ - multires_reshape_free_original_grids(&reshape_context); - multires_reshape_smooth_object_grids_with_details(&reshape_context); } + multires_reshape_object_grids_to_tangent_displacement(&reshape_context); multires_reshape_context_free(&reshape_context); -- cgit v1.2.3