Bugfix [#29567] Second Hook Modifier fails on Curve Object

This was broken in r.42515. In particular, rigs with Spline IK would break,
since they often use curves with hook modifiers controlling the control-points
of those curves.
This commit is contained in:
2011-12-10 03:37:37 +00:00
parent 3f39fde373
commit a88b29c062

View File

@@ -186,9 +186,7 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
float fac;
const int *origindex_ar;
/* if DerivedMesh is present and has original index data,
* use it
*/
/* if DerivedMesh is present and has original index data, use it */
if(dm && (origindex_ar= dm->getVertDataArray(dm, CD_ORIGINDEX))) {
for(i= 0, index_pt= hmd->indexar; i < hmd->totindex; i++, index_pt++) {
if(*index_pt < numVerts) {
@@ -251,12 +249,8 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
{
HookModifierData *hmd = (HookModifierData*) md;
DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, 0);
deformVerts_do(hmd, ob, dm, vertexCos, numVerts);
if(derivedData != dm)
dm->release(dm);
deformVerts_do(hmd, ob, derivedData, vertexCos, numVerts);
}
static void deformVertsEM(ModifierData *md, Object *ob, struct EditMesh *editData,