Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/physics/particle_edit.c')
-rw-r--r--source/blender/editors/physics/particle_edit.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 0803fa2a7a2..fe253df8f85 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1056,7 +1056,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
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");
@@ -1067,7 +1067,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys)
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);
@@ -2592,7 +2592,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
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)
@@ -2602,7 +2602,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
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);
@@ -2623,7 +2623,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
}
}
- if((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1)
+ if((point->flag & PEP_TAG) && mirrorfaces && mirrorfaces[pa->num*2] != -1)
newtotpart++;
}
@@ -2660,7 +2660,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
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 */
@@ -2670,7 +2670,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
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];
@@ -2682,7 +2682,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
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 */
@@ -2704,7 +2704,8 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
point->flag &= ~PEP_TAG;
}
- MEM_freeN(mirrorfaces);
+ if (mirrorfaces)
+ MEM_freeN(mirrorfaces);
}
static int mirror_exec(bContext *C, wmOperator *UNUSED(op))
@@ -3104,8 +3105,8 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, floa
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 */