From 519ad0fbeb24d24b35718bf475282a8f0ee83b35 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Mon, 8 Apr 2013 22:01:38 +0000 Subject: [PATCH] Bug in models or bug in g3dviewer ? Newer models have set opacity of Material set to 0 ( needed to see transparency in blender ) but this full transparency is ( correctly) exported, resulting in not beeing shown in G3d Viewer or when used as unit. Used as tileset Models all was ok. So fixed for the Moment, but not entirely happy with this now. Maybe the blender exporter should set opacity to 1 if its set to 0 instead. --- source/shared_lib/sources/graphics/model.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp index 50201aa1..3b1dec3e 100644 --- a/source/shared_lib/sources/graphics/model.cpp +++ b/source/shared_lib/sources/graphics/model.cpp @@ -770,7 +770,11 @@ void Mesh::load(int meshIndex, const string &dir, FILE *f, TextureManager *textu specularColor= Vec3f(meshHeader.specularColor); specularPower= meshHeader.specularPower; opacity= meshHeader.opacity; - + if(opacity==0){ + printf("found a mesh with opacity=0 in header, using opacity=1 to see it now \n"); + printf("file: %s\n",modelFile.c_str()); + opacity=1.0f; + } textureFlags= meshHeader.textures; if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Load v4, this = %p Found meshHeader.textures = %d meshIndex = %d\n",this,meshHeader.textures,meshIndex);