From 179bd1ea7d4d1b31ce22ac1d5d0c0b32b843aa6f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 7 Sep 2020 16:56:41 +0200 Subject: Fix T77763: Wrong highlight of active grab vertex The "Grab Active Vertex" in sculpt mode highlights the vertex and the neighbor vertices. This was working wrong in the case when mesh has multires modifier at sculpt level 0 and has shape keys. The issue was caused by the wrong crazy space calculation, which was ignoring subdivision level. This is an oversight from the initial implementation: the modifier has no effect if the subdivision level is 0. --- source/blender/modifiers/intern/MOD_multires.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 03e7f0a235b..9c7ab50cb61 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -296,7 +296,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * } static void deformMatrices(ModifierData *md, - const ModifierEvalContext *UNUSED(ctx), + const ModifierEvalContext *ctx, Mesh *mesh, float (*vertex_cos)[3], float (*deform_matrices)[3][3], @@ -312,11 +312,19 @@ static void deformMatrices(ModifierData *md, (void)deform_matrices; MultiresModifierData *mmd = (MultiresModifierData *)md; + SubdivSettings subdiv_settings; BKE_multires_subdiv_settings_init(&subdiv_settings, mmd); if (subdiv_settings.level == 0) { return; } + + SubdivToCCGSettings ccg_settings; + multires_ccg_settings_init(&ccg_settings, mmd, ctx, mesh); + if (ccg_settings.resolution < 3) { + return; + } + BKE_subdiv_settings_validate_for_mesh(&subdiv_settings, mesh); MultiresRuntimeData *runtime_data = multires_ensure_runtime(mmd); Subdiv *subdiv = subdiv_descriptor_ensure(mmd, &subdiv_settings, mesh); -- cgit v1.2.3