From 051052b141ef5c2c3a2f08a9d69b7b982386c8c4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 25 Mar 2015 20:07:21 +0200 Subject: MAINT-4983 Mesh upload of large model ryoma 3d loads indefinitely --- indra/llprimitive/lldaeloader.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llprimitive/lldaeloader.cpp') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index d04c7bc23c..2ec627d722 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -779,7 +779,8 @@ LLDAELoader::LLDAELoader( state_callback_t state_cb, void* opaque_userdata, JointTransformMap& jointMap, - JointSet& jointsFromNodes ) + JointSet& jointsFromNodes, + U32 modelLimit) : LLModelLoader( filename, lod, @@ -789,7 +790,8 @@ LLDAELoader::LLDAELoader( state_cb, opaque_userdata, jointMap, - jointsFromNodes) + jointsFromNodes), +mGeneratedModelLimit(modelLimit) { } @@ -911,6 +913,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) mTransform.condition(); + U32 submodel_limit = count > 0 ? mGeneratedModelLimit/count : 0; for (daeInt idx = 0; idx < count; ++idx) { //build map of domEntities to LLModel domMesh* mesh = NULL; @@ -921,7 +924,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) std::vector models; - loadModelsFromDomMesh(mesh, models); + loadModelsFromDomMesh(mesh, models, submodel_limit); std::vector::iterator i; i = models.begin(); @@ -2270,7 +2273,7 @@ LLModel* LLDAELoader::loadModelFromDomMesh(domMesh *mesh) //static diff version supports creating multiple models when material counts spill // over the 8 face server-side limit // -bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out) +bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out, U32 submodel_limit) { LLVolumeParams volume_params; @@ -2321,6 +2324,10 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& mo bool normalized = false; int submodelID = 0; + + // remove all faces that definitely won't fit into one model and submodel limit + ret->setNumVolumeFaces((submodel_limit + 1) * LL_SCULPT_MESH_MAX_FACES); + LLVolume::face_list_t remainder; do { -- cgit v1.2.3