[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35412] trunk/blender/source/blender/ collada/MeshImporter.cpp: Skip materials that are invalid.
Nathan Letwory
nathan at letworyinteractive.com
Tue Mar 8 21:41:44 CET 2011
Revision: 35412
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35412
Author: jesterking
Date: 2011-03-08 20:41:43 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
Skip materials that are invalid.
Modified Paths:
--------------
trunk/blender/source/blender/collada/MeshImporter.cpp
Modified: trunk/blender/source/blender/collada/MeshImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/MeshImporter.cpp 2011-03-08 20:39:32 UTC (rev 35411)
+++ trunk/blender/source/blender/collada/MeshImporter.cpp 2011-03-08 20:41:43 UTC (rev 35412)
@@ -912,9 +912,13 @@
// loop through geom's materials
for (unsigned int i = 0; i < mat_array.getCount(); i++) {
- texture_face = assign_material_to_geom(mat_array[i], uid_material_map, ob, geom_uid,
- &color_texture, layername, texture_face,
- material_texture_mapping_map, i);
+ if(mat_array[i].getReferencedMaterial().isValid()) {
+ texture_face = assign_material_to_geom(mat_array[i], uid_material_map, ob, geom_uid,
+ &color_texture, layername, texture_face,
+ material_texture_mapping_map, i);
+ } else {
+ fprintf(stderr, "invalid referenced material for %s\n", mat_array[i].getName().c_str());
+ }
}
return ob;
More information about the Bf-blender-cvs
mailing list