[Bf-blender-cvs] [6f1cdcba852] master: Fix T99929: lattice modifier looks up vertex group index in wrong place

Jacques Lucke noreply at git.blender.org
Mon Jul 25 11:55:01 CEST 2022


Commit: 6f1cdcba8528753ba6be0869f342b0ba00a0f9db
Author: Jacques Lucke
Date:   Mon Jul 25 11:54:36 2022 +0200
Branches: master
https://developer.blender.org/rB6f1cdcba8528753ba6be0869f342b0ba00a0f9db

Fix T99929: lattice modifier looks up vertex group index in wrong place

It looked up the vertex group index based on the object instead of the
actual mesh that is currently used. Since geometry nodes, the number
and order of attributes can change in arbitrary ways during evaluation.
Therefore, this index has to be looked up on the mesh which contains
the most up-to-date information.

There are probably similar issues in other modifiers. That has to be
fixed step by step. Ideally by using the attribute api directly eventually.

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

M	source/blender/blenkernel/intern/lattice_deform.c

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

diff --git a/source/blender/blenkernel/intern/lattice_deform.c b/source/blender/blenkernel/intern/lattice_deform.c
index 70f8522aab4..40a9d4befdb 100644
--- a/source/blender/blenkernel/intern/lattice_deform.c
+++ b/source/blender/blenkernel/intern/lattice_deform.c
@@ -348,7 +348,8 @@ static void lattice_deform_coords_impl(const Object *ob_lattice,
    * We want either a Mesh/Lattice with no derived data, or derived data with deformverts.
    */
   if (defgrp_name && defgrp_name[0] && ob_target && ELEM(ob_target->type, OB_MESH, OB_LATTICE)) {
-    defgrp_index = BKE_id_defgroup_name_index((ID *)ob_target->data, defgrp_name);
+    defgrp_index = BKE_id_defgroup_name_index(me_target ? &me_target->id : (ID *)ob_target->data,
+                                              defgrp_name);
 
     if (defgrp_index != -1) {
       /* if there's derived data without deformverts, don't use vgroups */



More information about the Bf-blender-cvs mailing list