[#27884] Collada import: materials mismatch when 2 instance_geometry reference the...
authorNathan Letwory <nathan@letworyinteractive.com>
Sun, 4 Sep 2011 14:31:23 +0000 (14:31 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Sun, 4 Sep 2011 14:31:23 +0000 (14:31 +0000)
Reported by David Roy

Multi-materials used on different meshes would get ignored (resulting in white faces in textured view).

source/blender/collada/MeshImporter.cpp

index e9086f0562800f0abc96fb0415fa0973ff81a340..01eff8069c174498d20b9ec1547a0310d40ab429 100644 (file)
@@ -796,7 +796,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
        std::multimap<COLLADAFW::UniqueId, COLLADAFW::UniqueId>::iterator it;
        it=materials_mapped_to_geom.find(*geom_uid);
        while(it!=materials_mapped_to_geom.end()) {
-               if(it->second == ma_uid) return NULL; // do nothing if already found
+               if(it->second == ma_uid && it->first == *geom_uid) return NULL; // do nothing if already found
                it++;
        }
        // first time we get geom_uid, ma_uid pair. Save for later check.