WIP: Fix #106127: crash enabling "Dynamic" on already bound MeshDeform mod #106617

Philipp Oeser wants to merge 1 commits from lichtwerk/blender:106127 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

View File

@ -380,6 +380,14 @@ static void meshdeformModifier_do(ModifierData *md,
goto finally;
/* The UI will not allow enabling Dynamic once bound, but setting via RNA or drivers might
* happen. Evaluation will miss important binding data then though, so better do nothing in such
* case (alternatively re-binding could be considered, see above). */
if (mmd->flag & MOD_MDEF_DYNAMIC_BIND && !mmd->dynverts) {

Use parenthesis to avoid ambiguity:
if ((mmd->flag & MOD_MDEF_DYNAMIC_BIND) && !mmd->dynverts)

Use parenthesis to avoid ambiguity: `if ((mmd->flag & MOD_MDEF_DYNAMIC_BIND) && !mmd->dynverts)`
BKE_modifier_set_error(ob, md, "Dynamic binding data missing");
goto finally;
/* verify we have compatible weights */
cage_verts_num = BKE_mesh_wrapper_vert_len(cagemesh);