summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-11-29 20:33:13 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-11-29 20:33:13 +0200
commit27e4e245d948e4d11f78a272d969b533cfe65fbf (patch)
treeeeef5d10decb9caa671eb8d9e42b02a4c11a6b72 /indra/newview/llfloatermodelpreview.cpp
parent7a0ca277f82acd2511a5dbf33956c1665d14b957 (diff)
parentcba1daaf6be4dfd031cd10d9aea07c7124d32726 (diff)
Merge branch 'DRTVWR-542-meshopt' into DRTVWR-546
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0e54b66ea9..aec4e4b8d9 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -136,10 +136,10 @@ mAvatarTabIndex(0)
mStatusLock = new LLMutex();
mModelPreview = NULL;
- mLODMode[LLModel::LOD_HIGH] = 0;
+ mLODMode[LLModel::LOD_HIGH] = LLModelPreview::LOD_FROM_FILE;
for (U32 i = 0; i < LLModel::LOD_HIGH; i++)
{
- mLODMode[i] = 1;
+ mLODMode[i] = LLModelPreview::MESH_OPTIMIZER_AUTO;
}
}
@@ -722,7 +722,20 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata)
void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
{
- mModelPreview->onLODParamCommit(lod, enforce_tri_limit);
+ LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
+ S32 mode = lod_source_combo->getCurrentIndex();
+ switch (mode)
+ {
+ case LLModelPreview::MESH_OPTIMIZER_AUTO:
+ case LLModelPreview::MESH_OPTIMIZER:
+ case LLModelPreview::MESH_OPTIMIZER_SLOPPY:
+ case LLModelPreview::MESH_OPTIMIZER_COMBINE:
+ mModelPreview->onLODMeshOptimizerParamCommit(lod, enforce_tri_limit, mode);
+ break;
+ default:
+ LL_ERRS() << "Only supposed to be called to generate models" << LL_ENDL;
+ break;
+ }
//refresh LoDs that reference this one
for (S32 i = lod - 1; i >= 0; --i)
@@ -1721,7 +1734,11 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
refresh();
LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
- if (lod_source_combo->getCurrentIndex() == LLModelPreview::GENERATE)
+ S32 index = lod_source_combo->getCurrentIndex();
+ if (index == LLModelPreview::MESH_OPTIMIZER_AUTO
+ || index == LLModelPreview::MESH_OPTIMIZER
+ || index == LLModelPreview::MESH_OPTIMIZER_SLOPPY
+ || index == LLModelPreview::MESH_OPTIMIZER_COMBINE)
{ //rebuild LoD to update triangle counts
onLODParamCommit(lod, true);
}
@@ -1752,7 +1769,7 @@ void LLFloaterModelPreview::resetUploadOptions()
getChild<LLComboBox>("lod_source_" + lod_name[NUM_LOD - 1])->setCurrentByIndex(LLModelPreview::LOD_FROM_FILE);
for (S32 lod = 0; lod < NUM_LOD - 1; ++lod)
{
- getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::GENERATE);
+ getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::MESH_OPTIMIZER_AUTO);
childSetValue("lod_file_" + lod_name[lod], "");
}