Skip to content

Commit c335cd6

Browse files
committed
LOD ui tweaks, bugfixes
1 parent 6a6ba59 commit c335cd6

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

include/DzBridgeAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ namespace DzBridgeNameSpace
195195
Q_INVOKABLE virtual int getELodMethodMax() { return 1; }
196196
ELodMethod m_eLodMethod = ELodMethod::Undefined; // WARNING: May need to change this to type int to support additional values in subclasses, depending on compiler handling of enum
197197
virtual ELodMethod getLodMethod() const { return m_eLodMethod; }
198-
int m_nNumberOfLods = 2; // total number of LOD levels (including Base LOD)
198+
int m_nNumberOfLods = 3; // total number of LOD levels (including Base LOD)
199199
bool m_bCreateLodGroup = false;
200200

201201
virtual QString getActionGroup() const { return tr("Bridges"); }

include/DzBridgeLodSettingsDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ namespace DzBridgeNameSpace
6161

6262
private:
6363
static DzBridgeLodSettingsDialog* singleton;
64+
bool bWarningShown = false;
6465

6566
};
6667

src/DzBridgeLodSettingsDialog.cpp

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ void DzBridgeLodSettingsDialog::showEvent(QShowEvent* event)
143143
resize(sizeHint());
144144

145145
DzBasicDialog::showEvent(event);
146+
bWarningShown = false;
146147
}
147148

148149
void DzBridgeLodSettingsDialog::accept()
@@ -171,6 +172,18 @@ void DzBridgeLodSettingsDialog::accept()
171172
}
172173
//applyLodPresetHighPerformance();
173174
}
175+
176+
float fEstimatedLodGenerationTime = calculateLodGenerationTime();
177+
178+
if (fEstimatedLodGenerationTime > 5.0 && !bWarningShown)
179+
{
180+
QString sWarningString = QString(tr("The estimated LOD generation time may be more than %1 minutes. Times will vary depending on your CPU.")).arg((int)fEstimatedLodGenerationTime);
181+
// Warn User with Popup that estimated LOD generation will be more than 5 minutes
182+
QMessageBox::warning(0, "Daz Bridge",
183+
sWarningString, QMessageBox::Ok);
184+
bWarningShown = true;
185+
}
186+
174187
DzBasicDialog::accept();
175188
}
176189

@@ -182,18 +195,29 @@ void DzBridgeLodSettingsDialog::reject()
182195
void DzBridgeLodSettingsDialog::HandleLodMethodComboChange(int state)
183196
{
184197
float fEstimatedLodGenerationTime = calculateLodGenerationTime();
198+
199+
if (fEstimatedLodGenerationTime > 5.0 && !bWarningShown)
200+
{
201+
QString sWarningString = QString(tr("The estimated LOD generation time may be more than %1 minutes. Times will vary depending on your CPU.")).arg((int)fEstimatedLodGenerationTime);
202+
// Warn User with Popup that estimated LOD generation will be more than 5 minutes
203+
QMessageBox::warning(0, "Daz Bridge",
204+
sWarningString, QMessageBox::Ok);
205+
bWarningShown = true;
206+
}
207+
185208
}
186209

187210
void DzBridgeLodSettingsDialog::HandleNumberOfLodComboChange(int state)
188211
{
189212
float fEstimatedLodGenerationTime = calculateLodGenerationTime();
190213

191-
if (fEstimatedLodGenerationTime > 5.0)
214+
if (fEstimatedLodGenerationTime > 5.0 && !bWarningShown)
192215
{
193216
QString sWarningString = QString(tr("The estimated LOD generation time may be more than %1 minutes. Times will vary depending on your CPU.")).arg((int) fEstimatedLodGenerationTime);
194217
// Warn User with Popup that estimated LOD generation will be more than 5 minutes
195218
QMessageBox::warning(0, "Daz Bridge",
196219
sWarningString, QMessageBox::Ok);
220+
bWarningShown = true;
197221
}
198222

199223
}
@@ -282,9 +306,9 @@ int DzBridgeLodSettingsDialog::getSourceVertexCount()
282306

283307
float DzBridgeLodSettingsDialog::calculateLodGenerationTime()
284308
{
285-
int numLODs = m_wNumberOfLodComboBox->currentIndex();
309+
int numLODs = m_wNumberOfLodComboBox->itemData(m_wNumberOfLodComboBox->currentIndex()).toInt();
286310
int numVerts = getSourceVertexCount();
287-
int lodMethod = m_wLodMethodComboBox->currentIndex();
311+
int lodMethod = m_wLodMethodComboBox->itemData(m_wLodMethodComboBox->currentIndex()).toInt();
288312
float fTimeScaleFactor = 0;
289313

290314
// hardcoded estimate for Unreal Builtin LOD generator and Zen 3 AMD processor.

0 commit comments

Comments
 (0)