diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 2 | ||||
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 54 |
3 files changed, 45 insertions, 35 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index aa608ea67c..ab6753b4be 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; } @@ -2490,7 +2498,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; @@ -2590,6 +2598,12 @@ void LLModelLoader::processElement(daeElement* element) } } } + else + { + llinfos<<"Unable to resolve geometry URL."<<llendl; + badElement = true; + } + } domInstance_node* instance_node = daeSafeCast<domInstance_node>(element); @@ -2598,7 +2612,7 @@ void LLModelLoader::processElement(daeElement* element) daeElement* instance = instance_node->getUrl().getElement(); if (instance) { - processElement(instance); + processElement(instance,badElement); } } @@ -2606,7 +2620,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 dcc2fc8898..ccd6fef953 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);
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index f8ffb16adb..5bb5aa1f7c 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -468,38 +468,36 @@ public: }; -void log_upload_error(const LLSD& content,std::string stage) +void log_upload_error(S32 status, const LLSD& content,std::string stage) { + llwarns << "stage: " << stage << " http status: " << status << llendl; if (content.has("error")) { const LLSD& err = content["error"]; - llwarns << "mesh upload failed, stage " << stage - << " message " << err["message"].asString() << " id " << err["identifier"].asString() - << llendl; - - if (content.has("errors")) - { - const LLSD& err_list = content["errors"]; + llwarns << "err: " << err << llendl; + llwarns << "mesh upload failed, stage '" << stage + << "' error '" << err["error"].asString() + << "', message '" << err["message"].asString() + << "', id '" << err["identifier"].asString() + << "'" << llendl; + if (err.has("errors")) + { + S32 error_num = 0; + const LLSD& err_list = err["errors"]; for (LLSD::array_const_iterator it = err_list.beginArray(); it != err_list.endArray(); ++it) { const LLSD& err_entry = *it; - std::string index_info; - std::string texture_index_str = err_entry["TextureIndex"].asString(); - if (!texture_index_str.empty()) + llwarns << "error[" << error_num << "]:" << llendl; + for (LLSD::map_const_iterator map_it = err_entry.beginMap(); + map_it != err_entry.endMap(); + ++map_it) { - index_info += " texture_index: " + texture_index_str; + llwarns << "\t" << map_it->first << ": " + << map_it->second << llendl; } - std::string mesh_index_str = err_entry["MeshIndex"].asString(); - if (!mesh_index_str.empty()) - { - index_info += " mesh_index: " + mesh_index_str; - } - llwarns << "mesh err code " << err_entry["error"].asString() - << " message " << err_entry["message"] - << index_info - << llendl; + error_num++; } } } @@ -507,8 +505,6 @@ void log_upload_error(const LLSD& content,std::string stage) { llwarns << "bad mesh, no error information available" << llendl; } - - } class LLModelObjectUploadResponder: public LLCurl::Responder @@ -547,12 +543,11 @@ public: const std::string& reason, const LLSD& content) { - //assert_main_thread(); llinfos << "completed" << llendl; mThread->mPendingUploads--; dumpLLSDToFile(content,make_dump_name("whole_model_fee_response_",dump_num)); - llinfos << "LLWholeModelFeeResponder content: " << content << llendl; - if (isGoodStatus(status)) + if (isGoodStatus(status) && + content["state"].asString() == "upload") { llinfos << "fee request succeeded" << llendl; mThread->mWholeModelUploadURL = content["uploader"].asString(); @@ -560,7 +555,7 @@ public: else { llwarns << "fee request failed" << llendl; - log_upload_error(content,"fee"); + log_upload_error(status,content,"fee"); mThread->mWholeModelUploadURL = ""; } } @@ -588,7 +583,8 @@ public: llinfos << "LLWholeModelUploadResponder content: " << content << llendl; // requested "mesh" asset type isn't actually the type // of the resultant object, fix it up here. - if (isGoodStatus(status)) + if (isGoodStatus(status) && + content["state"].asString() == "complete") { llinfos << "upload succeeded" << llendl; mPostData["asset_type"] = "object"; @@ -597,7 +593,7 @@ public: else { llwarns << "upload failed" << llendl; - log_upload_error(content,"upload"); + log_upload_error(status,content,"upload"); } } }; |