diff options
author | prep linden <prep@lindenlab.com> | 2011-06-15 13:26:14 -0400 |
---|---|---|
committer | prep linden <prep@lindenlab.com> | 2011-06-15 13:26:14 -0400 |
commit | 1b3f3fa7a66733c733a10963a2cf22477c3190e9 (patch) | |
tree | c528c53b42550d1eaca80138185e526e2ab17136 | |
parent | a451c9e83431c7d39ef912680bf9d7411c7a12d2 (diff) |
Fix for sh-1771 and also fixed a bug with a never ending load (with eventual crash) bug when a visual scene is missing.
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 2 |
2 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 866cc39eec..4e35029ce6 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1901,11 +1901,19 @@ bool LLModelLoader::doLoadModel() { llwarns << "document has no visual_scene" << llendl; setLoadState( ERROR_PARSING ); - return false; + return true; } + setLoadState( DONE ); - processElement(scene); + bool badElement = false; + + processElement( scene, badElement ); + + if ( badElement ) + { + setLoadState( ERROR_PARSING ); + } return true; } @@ -2489,7 +2497,7 @@ daeElement* LLModelLoader::getChildFromElement( daeElement* pElement, std::strin return NULL; } -void LLModelLoader::processElement(daeElement* element) +void LLModelLoader::processElement( daeElement* element, bool& badElement ) { LLMatrix4 saved_transform = mTransform; @@ -2589,6 +2597,12 @@ void LLModelLoader::processElement(daeElement* element) } } } + else + { + llinfos<<"Unable to resolve geometry URL."<<llendl; + badElement = true; + } + } domInstance_node* instance_node = daeSafeCast<domInstance_node>(element); @@ -2597,7 +2611,7 @@ void LLModelLoader::processElement(daeElement* element) daeElement* instance = instance_node->getUrl().getElement(); if (instance) { - processElement(instance); + processElement(instance,badElement); } } @@ -2605,7 +2619,7 @@ void LLModelLoader::processElement(daeElement* element) daeTArray< daeSmartRef<daeElement> > children = element->getChildren(); for (S32 i = 0; i < children.getCount(); i++) { - processElement(children[i]); + processElement(children[i],badElement); } domNode* node = daeSafeCast<domNode>(element); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a328bfb4dd..8e7189e8c6 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -108,7 +108,7 @@ public: void loadModelCallback();
void loadTextures() ; //called in the main thread.
- void processElement(daeElement* element);
+ void processElement(daeElement* element, bool& badElement);
std::vector<LLImportMaterial> getMaterials(LLModel* model, domInstance_geometry* instance_geo);
LLImportMaterial profileToMaterial(domProfile_COMMON* material);
std::string getElementLabel(daeElement *element);
|