From ca629c362c5ed248547f9df057703079c95331e7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 9 Sep 2021 20:59:21 +0300 Subject: SL-15965 Support wider range of parsing errors --- indra/llprimitive/lldaeloader.cpp | 56 ++++++++++++++++++++-- .../skins/default/xui/en/floater_model_preview.xml | 14 ++++++ 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index dcf3b5fa0e..73a0b3d673 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -153,7 +153,8 @@ LLModel::EModelStatus load_face_from_dom_triangles( std::vector& face_list, std::vector& materials, domTrianglesRef& tri, - bool &generated_additional_faces) + bool &generated_additional_faces, + LLSD& log_msg) { LLVolumeFace face; std::vector verts; @@ -173,12 +174,18 @@ LLModel::EModelStatus load_face_from_dom_triangles( if ( !get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source)) { + LLSD args; + args["Message"] = "ParsingErrorBadElement"; + log_msg.append(args); return LLModel::BAD_ELEMENT; } if (!pos_source || !pos_source->getFloat_array()) { LL_WARNS() << "Unable to process mesh without position data; invalid model; invalid model." << LL_ENDL; + LLSD args; + args["Message"] = "ParsingErrorPositionInvalidModel"; + log_msg.append(args); return LLModel::BAD_ELEMENT; } @@ -381,6 +388,10 @@ LLModel::EModelStatus load_face_from_dom_polylist( if (!get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source)) { + LL_WARNS() << "Bad element." << LL_ENDL; + LLSD args; + args["Message"] = "ParsingErrorBadElement"; + log_msg.append(args); return LLModel::BAD_ELEMENT; } @@ -432,6 +443,9 @@ LLModel::EModelStatus load_face_from_dom_polylist( if (!cv.getPosition().isFinite3()) { LL_WARNS() << "Found NaN while loading position data from DAE-Model, invalid model." << LL_ENDL; + LLSD args; + args["Message"] = "PositionNaN"; + log_msg.append(args); return LLModel::BAD_ELEMENT; } } @@ -464,6 +478,10 @@ LLModel::EModelStatus load_face_from_dom_polylist( if (!cv.getNormal().isFinite3()) { LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL; + LLSD args; + args["Message"] = "NormalsNaN"; + log_msg.append(args); + return LLModel::BAD_ELEMENT; } } @@ -928,6 +946,9 @@ bool LLDAELoader::OpenFile(const std::string& filename) if (!dom) { LL_INFOS() <<" Error with dae - traditionally indicates a corrupt file."<getVolumeFaces(), pModel->getMaterialList(), tri, pModel->mHasGeneratedFaces); + status = load_face_from_dom_triangles(pModel->getVolumeFaces(), pModel->getMaterialList(), tri, pModel->mHasGeneratedFaces, log_msg); pModel->mStatus = status; if(status != LLModel::NO_ERRORS) { diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index db9d296fa5..05990e28d8 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -45,7 +45,21 @@ Rigged to unrecognized joint name [NAME] Skinning disabled due to [COUNT] unknown joints Model [MODEL_NAME] loaded + Texture coordinates data is not complete. + Found NaN while loading position data from DAE-Model, invalid model. + Found NaN while loading normals from DAE-Model, invalid model. + Negative scale detected, unsupported transform. domInstance_geometry: [LABEL] + Negative scale detected, unsupported post-normalization transform. domInstance_geometry: [LABEL] + Unable to resolve geometry URL. + Bad element + Scene could not be parsed + Error with dae - traditionally indicates a corrupt file. + Could not verify controller + Can't find internal doc + Document has no root + Document has no visual_scene + Unable to process mesh without position data. Invalid model.