Skip to content

Commit e05b32a

Browse files
committed
#4400 Model Import "use lod above" was not updating
1 parent 472ea3b commit e05b32a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

indra/newview/llfloatermodelpreview.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ bool LLFloaterModelPreview::postBuild()
165165
for (S32 lod = 0; lod <= LLModel::LOD_HIGH; ++lod)
166166
{
167167
LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[lod]);
168-
lod_source_combo->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLoDSourceCommit, this, lod));
168+
lod_source_combo->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLoDSourceCommit, this, lod, true));
169169
lod_source_combo->setCurrentByIndex(mLODMode[lod]);
170170

171171
getChild<LLButton>("lod_browse_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onBrowseLOD, this, lod));
@@ -766,7 +766,7 @@ void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
766766
LLComboBox* lod_source_combo = getChild<LLComboBox>("lod_source_" + lod_name[i]);
767767
if (lod_source_combo->getCurrentIndex() == LLModelPreview::USE_LOD_ABOVE)
768768
{
769-
onLoDSourceCommit(i);
769+
onLoDSourceCommit(i, false);
770770
}
771771
else
772772
{
@@ -1760,7 +1760,7 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
17601760
}
17611761
}
17621762

1763-
void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
1763+
void LLFloaterModelPreview::onLoDSourceCommit(S32 lod, bool refresh_ui)
17641764
{
17651765
mModelPreview->updateLodControls(lod);
17661766

@@ -1769,9 +1769,17 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
17691769
if (index == LLModelPreview::MESH_OPTIMIZER_AUTO
17701770
|| index == LLModelPreview::MESH_OPTIMIZER_SLOPPY
17711771
|| index == LLModelPreview::MESH_OPTIMIZER_PRECISE)
1772-
{ //rebuild LoD to update triangle counts
1772+
{
1773+
// rebuild LoD to update triangle counts
17731774
onLODParamCommit(lod, true);
17741775
}
1776+
else if (refresh_ui && index == LLModelPreview::USE_LOD_ABOVE)
1777+
{
1778+
// Update mUploadData for updateStatusMessages
1779+
mModelPreview->rebuildUploadData();
1780+
// Update UI with new triangle values
1781+
mModelPreview->updateStatusMessages();
1782+
}
17751783
}
17761784

17771785
void LLFloaterModelPreview::resetDisplayOptions()

indra/newview/llfloatermodelpreview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class LLFloaterModelPreview : public LLFloaterModelUploadBase
208208
void onClickCalculateBtn();
209209
void onJointListSelection();
210210

211-
void onLoDSourceCommit(S32 lod);
211+
void onLoDSourceCommit(S32 lod, bool refresh_ui);
212212

213213
void modelUpdated(bool calculate_visible);
214214

0 commit comments

Comments
 (0)