diff options
author | Jacques Lucke <jacques@blender.org> | 2022-07-25 12:54:36 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-07-25 12:54:49 +0300 |
commit | 6f1cdcba8528753ba6be0869f342b0ba00a0f9db (patch) | |
tree | 6eb7da60a5bc035b1b3e5e205608f43916835bc7 /source/blender/blenkernel/intern/lattice_deform.c | |
parent | c5afef12240d142bce3a22498e3aee5e4656566d (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice_deform.c')
-rw-r--r-- | source/blender/blenkernel/intern/lattice_deform.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 */ |