diff --git a/include/DzBridgeAction.h b/include/DzBridgeAction.h index e143a90..454224a 100644 --- a/include/DzBridgeAction.h +++ b/include/DzBridgeAction.h @@ -195,7 +195,7 @@ namespace DzBridgeNameSpace Q_INVOKABLE virtual int getELodMethodMax() { return 1; } 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 virtual ELodMethod getLodMethod() const { return m_eLodMethod; } - int m_nNumberOfLods = 2; // total number of LOD levels (including Base LOD) + int m_nNumberOfLods = 3; // total number of LOD levels (including Base LOD) bool m_bCreateLodGroup = false; virtual QString getActionGroup() const { return tr("Bridges"); } diff --git a/include/DzBridgeLodSettingsDialog.h b/include/DzBridgeLodSettingsDialog.h index 382a56a..6c238aa 100644 --- a/include/DzBridgeLodSettingsDialog.h +++ b/include/DzBridgeLodSettingsDialog.h @@ -61,6 +61,7 @@ namespace DzBridgeNameSpace private: static DzBridgeLodSettingsDialog* singleton; + bool bWarningShown = false; }; diff --git a/src/DzBridgeLodSettingsDialog.cpp b/src/DzBridgeLodSettingsDialog.cpp index a16ddea..f2e5324 100644 --- a/src/DzBridgeLodSettingsDialog.cpp +++ b/src/DzBridgeLodSettingsDialog.cpp @@ -143,6 +143,7 @@ void DzBridgeLodSettingsDialog::showEvent(QShowEvent* event) resize(sizeHint()); DzBasicDialog::showEvent(event); + bWarningShown = false; } void DzBridgeLodSettingsDialog::accept() @@ -171,6 +172,18 @@ void DzBridgeLodSettingsDialog::accept() } //applyLodPresetHighPerformance(); } + + float fEstimatedLodGenerationTime = calculateLodGenerationTime(); + + if (fEstimatedLodGenerationTime > 5.0 && !bWarningShown) + { + 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); + // Warn User with Popup that estimated LOD generation will be more than 5 minutes + QMessageBox::warning(0, "Daz Bridge", + sWarningString, QMessageBox::Ok); + bWarningShown = true; + } + DzBasicDialog::accept(); } @@ -182,18 +195,29 @@ void DzBridgeLodSettingsDialog::reject() void DzBridgeLodSettingsDialog::HandleLodMethodComboChange(int state) { float fEstimatedLodGenerationTime = calculateLodGenerationTime(); + + if (fEstimatedLodGenerationTime > 5.0 && !bWarningShown) + { + 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); + // Warn User with Popup that estimated LOD generation will be more than 5 minutes + QMessageBox::warning(0, "Daz Bridge", + sWarningString, QMessageBox::Ok); + bWarningShown = true; + } + } void DzBridgeLodSettingsDialog::HandleNumberOfLodComboChange(int state) { float fEstimatedLodGenerationTime = calculateLodGenerationTime(); - if (fEstimatedLodGenerationTime > 5.0) + if (fEstimatedLodGenerationTime > 5.0 && !bWarningShown) { 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); // Warn User with Popup that estimated LOD generation will be more than 5 minutes QMessageBox::warning(0, "Daz Bridge", sWarningString, QMessageBox::Ok); + bWarningShown = true; } } @@ -282,9 +306,9 @@ int DzBridgeLodSettingsDialog::getSourceVertexCount() float DzBridgeLodSettingsDialog::calculateLodGenerationTime() { - int numLODs = m_wNumberOfLodComboBox->currentIndex(); + int numLODs = m_wNumberOfLodComboBox->itemData(m_wNumberOfLodComboBox->currentIndex()).toInt(); int numVerts = getSourceVertexCount(); - int lodMethod = m_wLodMethodComboBox->currentIndex(); + int lodMethod = m_wLodMethodComboBox->itemData(m_wLodMethodComboBox->currentIndex()).toInt(); float fTimeScaleFactor = 0; // hardcoded estimate for Unreal Builtin LOD generator and Zen 3 AMD processor.