Fix [#29256] Import images as planes add on doesn't work correctly in bmesh

This commit is contained in:
Andrew Wiggin 2011-11-17 18:48:49 +00:00
parent cc64af9bfa
commit 8a8566c894
3 changed files with 13 additions and 2 deletions

@ -1454,6 +1454,12 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
}
#endif /* WITH_GAMEENGINE */
/* Re-tesselation is necessary to push render data (uvs, textures, colors)
from loops and polys onto the tessfaces. This may be currently be redundant
in cases where the render mode doesn't use these inputs, but ideally
eventually tesselation would happen on-demand, and this is one of the primary
places it would be needed. */
finaldm->recalcTesselation(finaldm);
finaldm->calcNormals(finaldm);
*final_r = finaldm;

@ -1644,8 +1644,7 @@ static CDDerivedMesh *cdDM_create(const char *desc)
dm->getTessFaceDataArray = DM_get_tessface_data_layer;
dm->calcNormals = CDDM_calc_normals;
//doesn't work yet for all cases
//dm->recalcTesselation = CDDM_recalc_tesselation;
dm->recalcTesselation = CDDM_recalc_tesselation;
dm->getVertCos = cdDM_getVertCos;
dm->getVertCo = cdDM_getVertCo;

@ -2758,6 +2758,11 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
return ccgdm->pbvh;
}
static void ccgDM_recalcTesselection(DerivedMesh *UNUSED(dm))
{
/* Nothing to do: CCG handles creating its own tessfaces */
}
static void ccgDM_calcNormals(DerivedMesh *UNUSED(dm))
{
/* Nothing to do: CCG calculates normals during drawing */
@ -2853,6 +2858,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.getTessFaceData = DM_get_face_data;
ccgdm->dm.calcNormals = ccgDM_calcNormals;
ccgdm->dm.recalcTesselation = ccgDM_recalcTesselection;
ccgdm->dm.getVertCos = cgdm_getVertCos;
ccgdm->dm.foreachMappedVert = cgdm_foreachMappedVert;