Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2011-03-08 23:41:43 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2011-03-08 23:41:43 +0300
commit94b5fd6eb94e69e25d8f6c193096014abeb93e0e (patch)
treee3f466da603fb397b6fbc5c1486a9b5074c7fa57 /source/blender/collada/MeshImporter.cpp
parented8719bd1f1011ade261a8623757ac6820af5e31 (diff)
Skip materials that are invalid.
Diffstat (limited to 'source/blender/collada/MeshImporter.cpp')
-rw-r--r--source/blender/collada/MeshImporter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 89c8669a5d9..86dc1a44671 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -912,9 +912,13 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
// 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;