From e3478069b4554b1016e7351e57ea5897d95666d6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 2 Oct 2006 13:24:39 +0000 Subject: [PATCH] From Per Fahlberg, "Attached is a fix for loading the same file multiple times with the COLLADA plugin. dae->load will not return DAE_OK the second time a model is loaded, so a second check for DAE_ERR_COLLECTION_ALREADY_EXISTS has been added." --- src/osgPlugins/dae/daeReader.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/osgPlugins/dae/daeReader.cpp b/src/osgPlugins/dae/daeReader.cpp index 0ea223c43..afa4b708a 100644 --- a/src/osgPlugins/dae/daeReader.cpp +++ b/src/osgPlugins/dae/daeReader.cpp @@ -19,11 +19,11 @@ using namespace osgdae; daeReader::daeReader(DAE *dae_) : dae(dae_), - rootNode(NULL), - m_numlights(0), - currentEffect(NULL), - geometryMap(), - materialMap() + rootNode(NULL), + m_numlights(0), + currentEffect(NULL), + geometryMap(), + materialMap() { } @@ -42,7 +42,9 @@ bool daeReader::convert( const std::string &fileURI ) { fURI = fileURI; } - if( dae->load( fURI.c_str() ) != DAE_OK ) + daeInt res = dae->load( fURI.c_str() ); + + if( res != DAE_OK && res != DAE_ERR_COLLECTION_ALREADY_EXISTS) { osg::notify( osg::WARN ) << "Load failed in COLLADA DOM" << std::endl; return false;