BLI_kdtree_free(edit->emitter_field);
- totface=dm->getNumFaces(dm);
+ totface=dm->getNumTessFaces(dm);
/*totvert=dm->getNumVerts(dm);*/ /*UNSUED*/
edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos");
nor=vec+3;
for(i=0; i<totface; i++, vec+=6, nor+=6) {
- MFace *mface=dm->getFaceData(dm,i,CD_MFACE);
+ MFace *mface=dm->getTessFaceData(dm,i,CD_MFACE);
MVert *mvert;
mvert=dm->getVertData(dm,mface->v1,CD_MVERT);
PTCacheEditPoint *newpoint, *new_points;
POINT_P; KEY_K;
HairKey *hkey;
- int *mirrorfaces;
+ int *mirrorfaces = NULL;
int rotation, totpart, newtotpart;
if(psys->flag & PSYS_GLOBAL_HAIR)
if(!psmd->dm)
return;
- mirrorfaces= mesh_get_x_mirror_faces(ob, NULL);
+ //BMESH_TODO mirrorfaces= mesh_get_x_mirror_faces(ob, NULL);
if(!edit->mirror_cache)
PE_update_mirror_cache(ob, psys);
}
}
- if((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1)
+ if((point->flag & PEP_TAG) && mirrorfaces && mirrorfaces[pa->num*2] != -1)
newtotpart++;
}
if(point->flag & PEP_HIDE)
continue;
- if(!(point->flag & PEP_TAG) || mirrorfaces[pa->num*2] == -1)
+ if(!(point->flag & PEP_TAG) || (mirrorfaces && mirrorfaces[pa->num*2] == -1))
continue;
/* duplicate */
if(point->keys) newpoint->keys= MEM_dupallocN(point->keys);
/* rotate weights according to vertex index rotation */
- rotation= mirrorfaces[pa->num*2+1];
+ rotation= mirrorfaces ? mirrorfaces[pa->num*2+1] : 0;
newpa->fuv[0]= pa->fuv[2];
newpa->fuv[1]= pa->fuv[1];
newpa->fuv[2]= pa->fuv[0];
SHIFT3(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2])
/* assign face inddex */
- newpa->num= mirrorfaces[pa->num*2];
+ newpa->num= mirrorfaces ? mirrorfaces[pa->num*2] : 0;
newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL);
/* update edit key pointers */
point->flag &= ~PEP_TAG;
}
- MEM_freeN(mirrorfaces);
+ if (mirrorfaces)
+ MEM_freeN(mirrorfaces);
}
static int mirror_exec(bContext *C, wmOperator *UNUSED(op))
VECCOPY(p_max,pa_minmax+3);
}
- totface=dm->getNumFaces(dm);
- mface=dm->getFaceDataArray(dm,CD_MFACE);
+ totface=dm->getNumTessFaces(dm);
+ mface=dm->getTessFaceDataArray(dm,CD_MFACE);
mvert=dm->getVertDataArray(dm,CD_MVERT);
/* lets intersect the faces */