From 1132b19c06aa0b154991256e5063c78ad423bdc3 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 11 Jun 2025 12:31:47 +0300 Subject: #4114 Improve GLTF mesh uploader log 2 --- indra/newview/gltf/llgltfloader.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/newview/gltf/llgltfloader.cpp') diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp index 3e7b14919b..ffe574f4b1 100644 --- a/indra/newview/gltf/llgltfloader.cpp +++ b/indra/newview/gltf/llgltfloader.cpp @@ -309,6 +309,21 @@ bool LLGLTFLoader::parseMeshes() return false; } + // Check total model count against limit + U32 total_models = static_cast(mModelList.size()); + if (total_models > mGeneratedModelLimit) + { + LL_WARNS("GLTF_IMPORT") << "Model contains " << total_models + << " mesh parts, exceeding the limit of " << mGeneratedModelLimit << LL_ENDL; + + LLSD args; + args["Message"] = "TooManyMeshParts"; + args["PART_COUNT"] = static_cast(total_models); + args["LIMIT"] = static_cast(mGeneratedModelLimit); + mWarningsArray.append(args); + return false; + } + return true; } @@ -843,13 +858,12 @@ bool LLGLTFLoader::populateModelFromMesh(LLModel* pModel, const LL::GLTF::Mesh& { LL_INFOS("GLTF_IMPORT") << "Unable to process mesh '" << mesh.mName << "' primitive " << prim_idx - << " due to 16-bit index limits. Vertex count: " - << prim.getVertexCount() << " exceeds limit: " << USHRT_MAX << LL_ENDL; + << " due to 65,534 vertex limit. Vertex count: " + << prim.getVertexCount() << LL_ENDL; LLSD args; args["Message"] = "ErrorIndexLimit"; args["MESH_NAME"] = mesh.mName.empty() ? ("mesh_" + std::to_string(&mesh - &mGLTFAsset.mMeshes[0])) : mesh.mName; args["VERTEX_COUNT"] = static_cast(prim.getVertexCount()); - args["LIMIT"] = USHRT_MAX; mWarningsArray.append(args); return false; } -- cgit v1.3