diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c index c7561fbd903..ef68ae9694c 100644 --- a/source/blender/python/api2_2x/NMesh.c +++ b/source/blender/python/api2_2x/NMesh.c @@ -1304,30 +1304,6 @@ static BPy_NMFace *nmface_from_data(BPy_NMesh *mesh, int vidxs[4], return newf; } -static BPy_NMFace *nmface_from_shortdata(BPy_NMesh *mesh, - MFace *face, TFace *tface, MCol *col) -{ - int vidxs[4]; - vidxs[0] = face->v1; - vidxs[1] = face->v2; - vidxs[2] = face->v3; - vidxs[3] = face->v4; - - return nmface_from_data(mesh, vidxs, face->mat_nr, face->flag, tface, col); -} - -static BPy_NMFace *nmface_from_intdata(BPy_NMesh *mesh, - MFace *face, TFace *tface, MCol *col) -{ - int vidxs[4]; - vidxs[0] = face->v1; - vidxs[1] = face->v2; - vidxs[2] = face->v3; - vidxs[3] = face->v4; - - return nmface_from_data(mesh, vidxs, face->mat_nr, face->flag, tface, col); -} - static BPy_NMVert *nmvert_from_data(BPy_NMesh *me, MVert *vert, MSticky *st, float *co, int idx, char flag) { @@ -1390,7 +1366,6 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, else { MVert *mverts; MSticky *msticky; - MFace *mfaceints; MFace *mfaces; TFace *tfaces; MCol *mcols; @@ -1403,7 +1378,7 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, msticky = NULL; mfaces = NULL; mverts = dlm->mvert; - mfaceints = dlm->mface; + mfaces = dlm->mface; tfaces = dlm->tface; mcols = dlm->mcol; @@ -1418,7 +1393,6 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, me->subdiv[1] = oldmesh->subdivr; me->smoothresh = oldmesh->smoothresh; - mfaceints = NULL; msticky = oldmesh->msticky; mverts = oldmesh->mvert; mfaces = oldmesh->mface; @@ -1450,17 +1424,15 @@ static PyObject *new_NMesh_internal(Mesh *oldmesh, for (i = 0; i < totface; i++) { TFace *oldtf = tfaces?&tfaces[i]:NULL; MCol *oldmc = mcols?&mcols[i*4]:NULL; + MFace *oldmf = &mfaces[i]; + int vidxs[4]; + vidxs[0] = oldmf->v1; + vidxs[1] = oldmf->v2; + vidxs[2] = oldmf->v3; + vidxs[3] = oldmf->v4; - if (mfaceints) { - MFace *oldmf = &mfaceints[i]; - PyList_SetItem (me->faces, i, - (PyObject *)nmface_from_intdata(me, oldmf, oldtf, oldmc)); - } - else { - MFace *oldmf = &mfaces[i]; - PyList_SetItem (me->faces, i, - (PyObject *)nmface_from_shortdata(me, oldmf, oldtf, oldmc)); - } + PyList_SetItem (me->faces, i, + (PyObject *)nmface_from_data(me, vidxs, oldmf->mat_nr, oldmf->flag, oldtf, oldmc)); } me->materials = EXPP_PyList_fromMaterialList(oldmesh->mat, oldmesh->totcol); } diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index 4b1338cba3f..1e851e0dedd 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -780,7 +780,6 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) if(dt > OB_SOLID) { bProperty *prop = get_property(ob, "Text"); - MFace *mfaceint= NULL; int editing= (G.f & (G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT)) && (ob==((G.scene->basact) ? (G.scene->basact->object) : 0)); MVert *mvert=NULL; int totface; @@ -796,7 +795,7 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) else { totface= dlm->totface; mvert= dlm->mvert; - mfaceint= dlm->mface; + mface= dlm->mface; tface= dlm->tface; } } @@ -813,26 +812,14 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) for (a=0; av1; - v2idx= mf->v2; - v3idx= mf->v3; - v4idx= mf->v4; - mf_smooth= mf->flag & ME_SMOOTH; - matnr= mf->mat_nr; - } else { - MFace *mf= &mface[a]; - - v1idx= mf->v1; - v2idx= mf->v2; - v3idx= mf->v3; - v4idx= mf->v4; - mf_smooth= mf->flag & ME_SMOOTH; - matnr= mf->mat_nr; - } + v1idx= mf->v1; + v2idx= mf->v2; + v3idx= mf->v3; + v4idx= mf->v4; + mf_smooth= mf->flag & ME_SMOOTH; + matnr= mf->mat_nr; if(v3idx==0) continue; if(tface->flag & TF_HIDE) continue;