diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 15 | ||||
-rw-r--r-- | indra/llprimitive/lldaeloader.h | 6 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 3 |
4 files changed, 28 insertions, 7 deletions
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<LLModel*> models; - loadModelsFromDomMesh(mesh, models); + loadModelsFromDomMesh(mesh, models, submodel_limit); std::vector<LLModel*>::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<LLModel*>& models_out) +bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& models_out, U32 submodel_limit) { LLVolumeParams volume_params; @@ -2321,6 +2324,10 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& 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 { diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index e71c407909..cd07ade282 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -55,7 +55,8 @@ public: LLModelLoader::state_callback_t state_cb, void* opaque_userdata, JointTransformMap& jointMap, - JointSet& jointsFromNodes); + JointSet& jointsFromNodes, + U32 modelLimit); virtual ~LLDAELoader() ; virtual bool OpenFile(const std::string& filename); @@ -93,11 +94,12 @@ protected: // Loads a mesh breaking it into one or more models as necessary // to get around volume face limitations while retaining >8 materials // - bool loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& models_out); + bool loadModelsFromDomMesh(domMesh* mesh, std::vector<LLModel*>& models_out, U32 submodel_limit); static std::string getElementLabel(daeElement *element); private: + U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels }; #endif // LL_LLDAELLOADER_H diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5f80a8095d..66d50a00a7 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13,6 +13,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ImporterModelLimit</key> + <map> + <key>Comment</key> + <string>Limits amount of importer generated models for dae files</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>768</integer> + </map> <key>IMShowTime</key> <map> <key>Comment</key> diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e9f98a5c5f..9e2e8f4bc0 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1754,7 +1754,8 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable &LLModelPreview::stateChangedCallback, this, mJointTransformMap, - mJointsFromNode ); + mJointsFromNode, + gSavedSettings.getU32("ImporterModelLimit")); if (force_disable_slm) { |