Page MenuHome

Hook modifier port to 2.8

Authored by Christian Hubert (alikendarfen) on May 8 2018, 9:40 AM.



Some indications:

  • Use of vertex group is not functional
  • This is the same for simple deform modifier which was already ported (so I think there is some external causes to this issue)

See "modifier_get_vgroup_mesh" calls in line 280 for hook and in line 285 for simple deform.

The resulting deform verts is null because the input mesh is null.

In the previous code for the hook, it seems there is a workaround for it, which is before calling the modification function (I was not able to find an equivalent workaround for simple deform in the history, so I presume it is preferable that things works without it):

	DerivedMesh *dm = derivedData;
	/* We need a valid dm for meshes when a vgroup is set... */
	if (!dm && ctx->object->type == OB_MESH && hmd->name[0] != '\0')
		dm = get_dm(ctx->object, editData, dm, NULL, false, false);

        deformVerts_do(hmd, ctx->object, dm, vertexCos, numVerts);

I've try to setup an equivalent workaround for Mesh, but I failed as Blender crashes after the call to the modifier, when the resulting vertexCos are reported to the mesh (access violation).

To reproduce the issue, in both cases (hook and simple deform), simply create a vertex group, assign some vertices to it, and check the result when the vg is used in the modifier.

Diff Detail

rB Blender
arcpatch-D3235 (branched from blender2.8)
Build Status
Buildable 1516
Build 1516: arc lint + arc unit

Event Timeline

Fixed: retrieving deform verts when input mesh is null (done via "mesh ? mesh : ctx->object->data").

Typos and spaces corrected (to keep same as previous version)

For some reason I don't see all the spaces → tab changes here in the web interface, but I do get them when doing arc patch D3235.

I recommend doing 'git gui' and amending your commit to clean it up before using 'arc' to push it here. That makes all the changes nicely visible.

I'll clean up the patch before I commit it, because it seems to be working well now (including vertex groups)


Formatting: use spaces for alignment, not tabs.


Formatting: use spaces for alignment, not tabs.


editData isn't used any more, so it should have been wrapped with UNUSED().


Formatting: use spaces for alignment, not tabs.

Formatting + correctly getting edit mesh in edit mode

This revision is now accepted and ready to land.May 9 2018, 2:46 PM
This revision was automatically updated to reflect the committed changes.