diff options
author | Sergey Sharybin <sergey@blender.org> | 2020-09-07 17:56:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2020-09-07 17:56:41 +0300 |
commit | 179bd1ea7d4d1b31ce22ac1d5d0c0b32b843aa6f (patch) | |
tree | b3404ec8188bb29649f3e2e20f58f5f7f92d1f2b /source/blender/modifiers | |
parent | 231d08cbb11277ebfe1c1700124ced9ef50229d8 (diff) |
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.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_multires.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |