First modifiers with deformMatrices callback used to be applied twice when

building crazytspace. Not sure why this worked.
This commit is contained in:
2011-02-14 16:06:15 +00:00
parent d845d6308a
commit 2b9c9e3ad9

View File

@@ -363,7 +363,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
float (*deformedVerts)[3]= *deformcos;
float (*origVerts)[3]= MEM_dupallocN(deformedVerts);
float *quats= NULL;
int i;
int i, deformed= 0;
ModifierData *md= modifiers_getVirtualModifierList(ob);
Mesh *me= (Mesh*)ob->data;
@@ -372,8 +372,15 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue;
if(mti->type==eModifierTypeType_OnlyDeform)
if(mti->type==eModifierTypeType_OnlyDeform) {
/* skip leading modifiers which have been alredy
handled in sculpt_get_first_deform_matrices */
if(mti->deformMatrices && !deformed)
continue;
mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0, 0);
deformed= 1;
}
}
quats= MEM_mallocN(me->totvert*sizeof(float)*4, "crazy quats");