From ae035a0d66604e25b1277c4fa303aea8d798e719 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 22 Apr 2014 08:58:38 -0700 Subject: Modify importer to (optionally) improve debug output, perform name-based LOD association, and handle models with many materials. --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index de11309394..4343c7f70c 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2,6 +2,28 @@ + ImporterDebug + + Comment + Enable debug output to more precisely identify sources of import errors. Warning: the output can slow down import on many machines. + Persist + 0 + Type + Integer + Value + 0 + + IMShowTime + + Comment + Enable(disable) timestamp showing in the chat. + Persist + 1 + Type + Boolean + Value + 1 + IMShowTime Comment -- cgit v1.3 From 3501487bfc9463bf2b732d790819bc2938816287 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 28 Aug 2014 11:25:17 -0700 Subject: Make ImporterDebug facilities work again --- indra/newview/app_settings/settings.xml | 6 +++--- indra/newview/llfloatermodelpreview.cpp | 33 +++++++++++++++------------------ 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8895bba472..b63cba75ec 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7,11 +7,11 @@ Comment Enable debug output to more precisely identify sources of import errors. Warning: the output can slow down import on many machines. Persist - 0 + 1 Type - Integer + Boolean Value - 0 + 1 IMShowTime diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 78a087b050..685048ace7 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1408,7 +1408,7 @@ void LLModelPreview::rebuildUploadData() FindModel(mScene[i], name_to_match, lod_model, transform); - S32 importerDebug = gSavedSettings.getS32("ImporterDebug"); + BOOL importerDebug = gSavedSettings.getBOOL("ImporterDebug"); // Fall back to old method of index-based association if // we could not find a match based on the mesh names @@ -1418,7 +1418,7 @@ void LLModelPreview::rebuildUploadData() if (i == LLModel::LOD_PHYSICS) { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Assigning collision for " << instance.mLabel << " to match " << lod_model->mLabel << LL_ENDL; } @@ -1426,7 +1426,7 @@ void LLModelPreview::rebuildUploadData() } else { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Assigning LOD" << i << " for " << instance.mLabel << " to found match " << lod_model->mLabel << LL_ENDL; } @@ -1463,7 +1463,7 @@ void LLModelPreview::rebuildUploadData() { if (i == LLModel::LOD_PHYSICS) { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Falling back collision for " << instance.mLabel << " to " << lod_model->mLabel << LL_ENDL; } @@ -1471,7 +1471,7 @@ void LLModelPreview::rebuildUploadData() } else { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Falling back LOD" << i << " for " << instance.mLabel << " to found " << lod_model->mLabel << LL_ENDL; } @@ -1485,7 +1485,7 @@ void LLModelPreview::rebuildUploadData() { //find reference instance for this model if (mBaseModel[idx] == base_model) { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Falling back to model index " << idx << " for LOD " << i << " of " << instance.mLabel << LL_ENDL; } @@ -1503,14 +1503,14 @@ void LLModelPreview::rebuildUploadData() instance.mLOD[i] = lod_model; if (i == LLModel::LOD_PHYSICS) { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Indexed fallback to model index " << idx << ": LOD " << i << " named " << lod_model->mLabel << " for collision for " << instance.mLabel << LL_ENDL; } } else { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "Indexed fallback to model index " << idx << " LOD " << i << " named " << lod_model->mLabel << " for LOD " << i << " for " << instance.mLabel << LL_ENDL; } @@ -1518,7 +1518,7 @@ void LLModelPreview::rebuildUploadData() } else { - if (importerDebug > 0) + if (importerDebug) { LL_INFOS() << "List of models for LOD " << i << " did not include index " << idx << LL_ENDL; } @@ -2434,8 +2434,8 @@ void LLModelPreview::updateStatusMessages() std::string instance_name = instance.mLabel; - S32 importerDebug = gSavedSettings.getS32("ImporterDebug"); - if (importerDebug > 0) + BOOL importerDebug = gSavedSettings.getBOOL("ImporterDebug"); + if (importerDebug) { // Useful for debugging generalized complaints below about total submeshes which don't have enough // context to address exactly what needs to be fixed to move towards compliance with the rules. @@ -2444,14 +2444,11 @@ void LLModelPreview::updateStatusMessages() LL_INFOS() << "Instance " << lod_model->mLabel << " LOD " << i << " Tris: " << cur_tris << LL_ENDL; LL_INFOS() << "Instance " << lod_model->mLabel << " LOD " << i << " Faces: " << cur_submeshes << LL_ENDL; - if (importerDebug > 1) + LLModel::material_list::iterator mat_iter = lod_model->mMaterialList.begin(); + while (mat_iter != lod_model->mMaterialList.end()) { - LLModel::material_list::iterator mat_iter = lod_model->mMaterialList.begin(); - while (mat_iter != lod_model->mMaterialList.end()) - { - LL_INFOS() << "Instance " << lod_model->mLabel << " LOD " << i << " Material " << *(mat_iter) << LL_ENDL; - mat_iter++; - } + LL_INFOS() << "Instance " << lod_model->mLabel << " LOD " << i << " Material " << *(mat_iter) << LL_ENDL; + mat_iter++; } } -- cgit v1.3 From 7e4ec481aee7287e98e44767b10968302426c3ff Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 16 Oct 2014 16:38:11 +0300 Subject: MAINT-4405 FIXED ImporterDebug defaults to false now --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6a905eabb1..b33166bfcf 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11,7 +11,7 @@ Type Boolean Value - 1 + 0 IMShowTime -- cgit v1.3 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 +++++++++++---- indra/llprimitive/lldaeloader.h | 6 ++++-- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llfloatermodelpreview.cpp | 3 ++- 4 files changed, 28 insertions(+), 7 deletions(-) (limited to 'indra/newview/app_settings') 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 { 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& models_out); + bool loadModelsFromDomMesh(domMesh* mesh, std::vector& 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 @@ Value 0 + ImporterModelLimit + + Comment + Limits amount of importer generated models for dae files + Persist + 1 + Type + U32 + Value + 768 + IMShowTime Comment 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) { -- cgit v1.3 From 1382e9bae647d6b548cd9a1fc78339e5929ea202 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 23 Apr 2015 16:28:15 +0300 Subject: MAINT-5112 Separating legacy matching method --- indra/newview/app_settings/settings.xml | 11 ++ indra/newview/llfloatermodelpreview.cpp | 257 +++++++++++++++----------------- 2 files changed, 129 insertions(+), 139 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e2ccb89a29..f926720c51 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13,6 +13,17 @@ Value 0 + ImporterLegacyMatching + + Comment + Enable index based model matching. + Persist + 1 + Type + Boolean + Value + 0 + ImporterModelLimit Comment diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 78794d3942..eacc8d87e3 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1372,6 +1372,7 @@ void LLModelPreview::rebuildUploadData() F32 max_scale = 0.f; BOOL importerDebug = gSavedSettings.getBOOL("ImporterDebug"); + BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching"); for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter) { //for each transform in scene @@ -1404,155 +1405,133 @@ void LLModelPreview::rebuildUploadData() base_model->mMetric = metric; } - for (int i = LLModel::NUM_LODS - 1; i >= LLModel::LOD_IMPOSTOR; i--) - { // Fill LOD slots by finding matching meshes by label with name extensions - // in the appropriate scene for each LOD. This fixes all kinds of issues - // where the indexed method below fails in spectacular fashion. - // If you don't take the time to name your LOD and PHYS meshes - // with the name of their corresponding mesh in the HIGH LOD, - // then the indexed method will be attempted below. + for (int i = LLModel::NUM_LODS - 1; i >= LLModel::LOD_IMPOSTOR; i--) + { + LLModel* lod_model = NULL; + if (!legacyMatching) + { + // Fill LOD slots by finding matching meshes by label with name extensions + // in the appropriate scene for each LOD. This fixes all kinds of issues + // where the indexed method below fails in spectacular fashion. + // If you don't take the time to name your LOD and PHYS meshes + // with the name of their corresponding mesh in the HIGH LOD, + // then the indexed method will be attempted below. - LLModel* lod_model = NULL; - LLMatrix4 transform; + LLMatrix4 transform; - std::string name_to_match = instance.mLabel; - llassert(!name_to_match.empty()); + std::string name_to_match = instance.mLabel; + llassert(!name_to_match.empty()); - std::string toAdd; - switch (i) - { - case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break; - case LLModel::LOD_LOW: toAdd = "_LOD1"; break; - case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break; - case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break; - case LLModel::LOD_HIGH: break; - } + std::string toAdd; + switch (i) + { + case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break; + case LLModel::LOD_LOW: toAdd = "_LOD1"; break; + case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break; + case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break; + case LLModel::LOD_HIGH: break; + } - if (name_to_match.find(toAdd) == -1) - { - name_to_match += toAdd; - } + if (name_to_match.find(toAdd) == -1) + { + name_to_match += toAdd; + } - FindModel(mScene[i], name_to_match, lod_model, transform); + FindModel(mScene[i], name_to_match, lod_model, transform); - // Fall back to old method of index-based association if - // we could not find a match based on the mesh names - // - if (lod_model) - { - - if (i == LLModel::LOD_PHYSICS) - { - if (importerDebug) - { - LL_INFOS() << "Assigning collision for " << instance.mLabel << " to match " << lod_model->mLabel << LL_ENDL; - } - instance.mLOD[i] = lod_model; - } - else - { - if (importerDebug) - { - LL_INFOS() << "Assigning LOD" << i << " for " << instance.mLabel << " to found match " << lod_model->mLabel << LL_ENDL; - } - instance.mLOD[i] = lod_model; - } - } - else - { + if (!lod_model && i != LLModel::LOD_PHYSICS) + { + if (importerDebug) + { + LL_INFOS() << "Search of" << name_to_match << " in LOD" << i << " list failed. Searching for alternative among LOD lists." << LL_ENDL; + } - if (i != LLModel::LOD_PHYSICS) - { - int searchLOD = (i > LLModel::LOD_HIGH) ? LLModel::LOD_HIGH : i; - while ((searchLOD <= LLModel::LOD_HIGH) && !lod_model) - { - std::string name_to_match = instance.mLabel; - llassert(!name_to_match.empty()); - - std::string toAdd; - switch (searchLOD) - { - case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break; - case LLModel::LOD_LOW: toAdd = "_LOD1"; break; - case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break; - case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break; - case LLModel::LOD_HIGH: break; - } - - if (name_to_match.find(toAdd) == -1) - { - name_to_match += toAdd; - } - - // See if we can find an appropriately named model in LOD 'searchLOD' - // - FindModel(mScene[searchLOD], name_to_match, lod_model, transform); - searchLOD++; - } - } + int searchLOD = (i > LLModel::LOD_HIGH) ? LLModel::LOD_HIGH : i; + while ((searchLOD <= LLModel::LOD_HIGH) && !lod_model) + { + std::string name_to_match = instance.mLabel; + llassert(!name_to_match.empty()); - // Fall back to old method of index-based association if - // we could not find a match based on the mesh names at all. - // - if (lod_model) - { - if (importerDebug) - { - LL_INFOS() << "Falling back LOD" << i << " for " << instance.mLabel << " to found " << lod_model->mLabel << LL_ENDL; - } - instance.mLOD[i] = lod_model; - } - else - { - S32 idx = 0; - for (idx = 0; idx < mBaseModel.size(); ++idx) - { //find reference instance for this model - if (mBaseModel[idx] == base_model) - { - if (importerDebug) - { - LL_INFOS() << "Falling back to model index " << idx << " for LOD " << i << " of " << instance.mLabel << LL_ENDL; - } - break; - } - } - - // If the model list for the current LOD includes that index... - // - if (mModel[i].size() > idx) - { - // Assign that index from the model list for our LOD as the LOD model for this instance - // - lod_model = mModel[i][idx]; - instance.mLOD[i] = lod_model; - if (i == LLModel::LOD_PHYSICS) - { - if (importerDebug) - { - LL_INFOS() << "Indexed fallback to model index " << idx << ": LOD " << i << " named " << lod_model->mLabel << " for collision for " << instance.mLabel << LL_ENDL; - } - } - else - { - if (importerDebug) - { - LL_INFOS() << "Indexed fallback to model index " << idx << " LOD " << i << " named " << lod_model->mLabel << " for LOD " << i << " for " << instance.mLabel << LL_ENDL; - } - } - } - else - { - if (importerDebug) - { - LL_INFOS() << "List of models for LOD " << i << " did not include index " << idx << LL_ENDL; - } - } - } - } + std::string toAdd; + switch (searchLOD) + { + case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break; + case LLModel::LOD_LOW: toAdd = "_LOD1"; break; + case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break; + case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break; + case LLModel::LOD_HIGH: break; + } + + if (name_to_match.find(toAdd) == -1) + { + name_to_match += toAdd; + } + + // See if we can find an appropriately named model in LOD 'searchLOD' + // + FindModel(mScene[searchLOD], name_to_match, lod_model, transform); + searchLOD++; + } + } + } + else + { + // Use old method of index-based association + U32 idx = 0; + for (idx = 0; idx < mBaseModel.size(); ++idx) + { + // find reference instance for this model + if (mBaseModel[idx] == base_model) + { + if (importerDebug) + { + LL_INFOS() << "Attempting to use model index " << idx << " for LOD " << i << " of " << instance.mLabel << LL_ENDL; + } + break; + } + } + + // If the model list for the current LOD includes that index... + // + if (mModel[i].size() > idx) + { + // Assign that index from the model list for our LOD as the LOD model for this instance + // + lod_model = mModel[i][idx]; + if (importerDebug) + { + LL_INFOS() << "Indexed match of model index " << idx << " at LOD " << i << " to model named " << lod_model->mLabel << LL_ENDL; + } + } + else if (importerDebug) + { + LL_INFOS() << "List of models does not include index " << idx << LL_ENDL; + } + } + + if (lod_model) + { + if (importerDebug) + { + if (i == LLModel::LOD_PHYSICS) + { + LL_INFOS() << "Assigning collision for " << instance.mLabel << " to match " << lod_model->mLabel << LL_ENDL; + } + else + { + LL_INFOS() << "Assigning LOD" << i << " for " << instance.mLabel << " to found match " << lod_model->mLabel << LL_ENDL; + } + } + instance.mLOD[i] = lod_model; + } + else if (importerDebug) + { + LL_INFOS() << "List of models does not include " << instance.mLabel << LL_ENDL; + } } - LLModel* high_lod_model = instance.mLOD[LLModel::LOD_HIGH]; - if (!high_lod_model) + LLModel* high_lod_model = instance.mLOD[LLModel::LOD_HIGH]; + if (!high_lod_model) { setLoadState( LLModelLoader::ERROR_MATERIALS ); mFMP->childDisable( "calculate_btn" ); -- cgit v1.3 From 8a6bfb0e2213151341a25dfc4b411c2718fc64a6 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 7 Aug 2015 17:42:07 +0300 Subject: Merge fix - clearing duplicates --- indra/newview/CMakeLists.txt | 3 --- indra/newview/app_settings/settings.xml | 11 ----------- 2 files changed, 14 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e8e9e3e897..16877c345e 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1018,9 +1018,6 @@ set(viewer_HEADER_FILES llnameeditor.h llnamelistctrl.h llnavigationbar.h - llfloaterimnearbychat.h - llfloaterimnearbychathandler.h - llfloaterimnearbychatlistener.h llnetmap.h llnotificationhandler.h llnotificationmanager.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 477656c04e..4070aaa4e4 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -34,17 +34,6 @@ U32 Value 768 - - IMShowTime - - Comment - Enable(disable) timestamp showing in the chat. - Persist - 1 - Type - Boolean - Value - 1 IMShowTime -- cgit v1.3