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:
authorGaia Clary <gaia.clary@machinimatrix.org>2012-08-05 14:23:34 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2012-08-05 14:23:34 +0400
commitaff4c781eb27ea88a0bde0e8e0fef1691488841e (patch)
tree81ad510cbbf52914837cac036ce6dd9b44a502f6 /source/blender/collada/DocumentImporter.cpp
parentca382a8d2a5093d139859f39e26337f92b94d151 (diff)
COLLADA: #29058 Fixed crash when illegal reference to non existing camera object is found. And report a warning to the console)
Diffstat (limited to 'source/blender/collada/DocumentImporter.cpp')
-rw-r--r--source/blender/collada/DocumentImporter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 6aa600cabe2..7cfce9d2526 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -308,7 +308,7 @@ Object *DocumentImporter::create_camera_object(COLLADAFW::InstanceCamera *camera
{
const COLLADAFW::UniqueId& cam_uid = camera->getInstanciatedObjectId();
if (uid_camera_map.find(cam_uid) == uid_camera_map.end()) {
- fprintf(stderr, "Couldn't find camera by UID.\n");
+ // fprintf(stderr, "Couldn't find camera by UID.\n");
return NULL;
}
@@ -443,7 +443,13 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
}
while (camera_done < camera.getCount()) {
ob = create_camera_object(camera[camera_done], sce);
- objects_done->push_back(ob);
+ if (ob == NULL) {
+ std::string id = node->getOriginalId();
+ std::string name = node->getName();
+ fprintf(stderr, "<node id=\"%s\", name=\"%s\" >...contains a reference to an unknown instance_camera.\n", id.c_str(), name.c_str());
+ }
+ else
+ objects_done->push_back(ob);
++camera_done;
}
while (lamp_done < lamp.getCount()) {