Fix #30270, #30265: cycles not displaying textured objects, and not rendering

text/curve objects after the bmesh merge. Also removed a debug print.
This commit is contained in:
Brecht Van Lommel
2012-02-21 14:39:59 +00:00
parent 6a5b34bdb5
commit d47b018f8d
4 changed files with 15 additions and 7 deletions

View File

@@ -254,7 +254,6 @@ if(APPLE)
"Choose the minimum OSX version required: 10.4 or 10.5"
FORCE)
endif()
MESSAGE(STATUS ${CMAKE_GENERATOR})
if(${CMAKE_GENERATOR} MATCHES "Xcode")
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4)
# Xcode 4 defaults to the Apple LLVM Compiler.

View File

@@ -2628,7 +2628,7 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs,
attribs->tface[a].array = tfdata->layers[layer].data;
attribs->tface[a].emOffset = tfdata->layers[layer].offset;
attribs->tface[a].glIndex = gattribs->layer[b].glindex;
/* attribs->tface[a].glTexco = gattribs->layer[b].gltexco; */ /* BMESH_TODO, trunk has this but not bmesh, need to investigate whats going on here - campbell */
attribs->tface[a].glTexco = gattribs->layer[b].gltexco;
}
/* BMESH ONLY, may need to get this working?, otherwise remove */
/* else {

View File

@@ -1129,12 +1129,18 @@ static void emDM_drawMappedFacesMat(
#define PASSATTRIB(loop, eve, vert) { \
if (attribs.totorco) { \
float *orco = attribs.orco.array[BM_elem_index_get(eve)]; \
glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \
float *orco = attribs.orco.array[BM_elem_index_get(eve)]; \
if (attribs.orco.glTexco) \
glTexCoord3fv(orco); \
else \
glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \
} \
for (b = 0; b < attribs.tottface; b++) { \
MLoopUV *_luv = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPUV, b);\
glVertexAttrib2fvARB(attribs.tface[b].glIndex, _luv->uv); \
if (attribs.tface[b].glTexco) \
glTexCoord2fv(_luv->uv); \
else \
glVertexAttrib2fvARB(attribs.tface[b].glIndex, _luv->uv); \
} \
for (b = 0; b < attribs.totmcol; b++) { \
MLoopCol *_cp = CustomData_bmesh_get_n(&bm->ldata, loop->head.data, CD_MLOOPCOL, b);\

View File

@@ -116,7 +116,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
copycu->editnurb = NULL;
nurbs_to_mesh( tmpobj );
/* nurbs_to_mesh changes the type to a mesh, check it worked */
if (tmpobj->type != OB_MESH) {
free_libblock_us( &(G.main->object), tmpobj );
@@ -239,11 +239,14 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_
break;
} /* end copy materials */
/* cycles and exporters rely on this still */
BKE_mesh_tessface_ensure(tmpmesh);
/* we don't assign it to anything */
tmpmesh->id.us--;
/* make sure materials get updated in objects */
test_object_materials( ( ID * ) tmpmesh );
test_object_materials(&tmpmesh->id);
return tmpmesh;
}