[Bf-blender-cvs] [46f5b305e4a] blender-v3.0-release: Fix T93611: Curve modifier crash in editmode in certain situations

Philipp Oeser noreply at git.blender.org
Mon Jan 10 17:04:40 CET 2022


Commit: 46f5b305e4a6c5d53f95d222acafbf7951987b33
Author: Philipp Oeser
Date:   Mon Dec 6 11:33:16 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB46f5b305e4a6c5d53f95d222acafbf7951987b33

Fix T93611: Curve modifier crash in editmode in certain situations

Caused by {rB3b6ee8cee708}

Above commit was trying to get the vertexgroup from the mesh that is
passed into `deformVertsEM` (but that can be NULL).
When can it be NULL, when is is non-NULL?
`editbmesh_calc_modifiers` only passes in a non-NULL mesh to
`deformVertsEM` under certain conditions:
- a non-deform-only modifier is handled currently
- a non-deform-only modifier preceeds the current modifier
- a deform-only modifier preceeds the current modifier (and the current
one depends on normals)

So the passed-in mesh cannot be relied on, now get the vertex group from
the context object data (like it was before the culprit commit).

Related commit: rB8f22feefbc20

Maniphest Tasks: T93611

Differential Revision: https://developer.blender.org/D13487

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

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

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

diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c
index aae6d257766..20dbb299767 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -167,7 +167,7 @@ static void deformVertsEM(ModifierData *md,
   int defgrp_index = -1;
 
   if (ctx->object->type == OB_MESH && cmd->name[0] != '\0') {
-    defgrp_index = BKE_id_defgroup_name_index(&mesh->id, cmd->name);
+    defgrp_index = BKE_object_defgroup_name_index(ctx->object, cmd->name);
     if (defgrp_index != -1) {
       use_dverts = true;
     }



More information about the Bf-blender-cvs mailing list