Fix for [#30822] Foam Mapping for Ocean Modifier is out of sync in Blender Internal Render.

We need both a new MLOOPUV and MTEXPOLY layers with generated geometry! For some reason, the loopuv alone seemed to work in 3D view, but definitively not in render.
This commit is contained in:
Bastien Montagne
2012-04-08 19:50:00 +00:00
parent 1a9a8406fe
commit 35b4836711

View File

@@ -353,7 +353,8 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd)
/* add uvs */
cdlayer= CustomData_number_of_layers(&result->loopData, CD_MLOOPUV);
if (cdlayer < MAX_MTFACE) {
MLoopUV *mloopuvs= CustomData_add_layer(&result->loopData, CD_MLOOPUV, CD_CALLOC, NULL, num_faces * 4);
MLoopUV *mloopuvs = CustomData_add_layer(&result->loopData, CD_MLOOPUV, CD_CALLOC, NULL, num_faces * 4);
CustomData_add_layer(&result->polyData, CD_MTEXPOLY, CD_CALLOC, NULL, num_faces);
if (mloopuvs) { /* unlikely to fail */
ix = 1.0 / rx;