Commit: 179bd1ea7d4d1b31ce22ac1d5d0c0b32b843aa6f
Author: Sergey Sharybin
Date:   Mon Sep 7 16:56:41 2020 +0200
Branches: master
https://developer.blender.org/rB179bd1ea7d4d1b31ce22ac1d5d0c0b32b843aa6f

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.

===================================================================

M       source/blender/modifiers/intern/MOD_multires.c

===================================================================

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);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to