diff options
Diffstat (limited to 'source/gameengine/Converter/BL_BlenderDataConversion.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 0d9ad087c05..86fc2267c64 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -432,21 +432,19 @@ BL_Material* ConvertMaterial( else if(mttmp->tex->type == TEX_ENVMAP) { if( mttmp->tex->env->stype == ENV_LOAD ) { - material->mtexname[i]= mttmp->tex->id.name; - material->cubemap[i] = mttmp->tex->env; - if(material->cubemap[i]->ima) { - material->texname[i] = material->cubemap[i]->ima->id.name; + material->mtexname[i] = mttmp->tex->id.name; + EnvMap *env = mttmp->tex->env; + env->ima = mttmp->tex->ima; + material->cubemap[i] = env; + + if (material->cubemap[i]) + { + if (!material->cubemap[i]->cube[0]) + BL_Texture::SplitEnvMap(material->cubemap[i]); + + material->texname[i]= material->cubemap[i]->ima->id.name; material->mapping[i].mapping |= USEENV; } - else { - // in the player, we need to split it our self - material->cubemap[i]->ima = mttmp->tex->ima; - if(material->cubemap[i]->ima) { - material->texname[i] = material->cubemap[i]->ima->id.name; - material->mapping[i].mapping |= USEENV; - } - // - } } } material->flag[i] |= (mat->ipo!=0)?HASIPO:0; @@ -1098,9 +1096,6 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* } meshobj->UpdateMaterialList(); - - - // ----------------------------------- // pre calculate texture generation for(RAS_MaterialBucket::Set::iterator mit = meshobj->GetFirstMaterial(); mit != meshobj->GetLastMaterial(); ++ mit) { |