Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions indra/newview/gltf/llgltfloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,21 @@ bool LLGLTFLoader::parseMeshes()
return false;
}

// Check total model count against limit
U32 total_models = static_cast<U32>(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<S32>(total_models);
args["LIMIT"] = static_cast<S32>(mGeneratedModelLimit);
mWarningsArray.append(args);
return false;
}

return true;
}

Expand Down Expand Up @@ -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<S32>(prim.getVertexCount());
args["LIMIT"] = USHRT_MAX;
mWarningsArray.append(args);
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion indra/newview/skins/default/xui/en/floater_model_preview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@
<string name="NoScenesFound">No scenes defined in GLTF file</string>
<string name="InvalidMeshReference">Node [NODE_NAME] references invalid mesh [MESH_INDEX] (total meshes: [TOTAL_MESHES])</string>
<string name="InvalidGeometryNonTriangulated">Mesh [MESH_NAME] primitive [PRIMITIVE_INDEX]: Invalid geometry with [INDEX_COUNT] indices (must be triangulated)</string>
<string name="ErrorIndexLimit">Mesh [MESH_NAME]: Vertex count [VERTEX_COUNT] exceeds 16-bit limit of [LIMIT]</string>
<string name="ErrorIndexLimit">Unable to process mesh [MESH_NAME] due to 65,534 vertex limit. Vertex count: [VERTEX_COUNT]</string>
<string name="TextureFound">Found texture: [TEXTURE_NAME] for material: [MATERIAL_NAME]</string>
<string name="IgnoredExtension">Model uses unsupported extension: [EXT], related material properties are ignored</string>
<string name="UnsupportedExtension">Unable to load model, unsupported extension: [EXT]</string>
<string name="TooManyMeshParts">Model contains [PART_COUNT] mesh parts. Maximum allowed: [LIMIT]</string>

<panel
follows="top|left"
Expand Down