diff --git a/include/DzBridgeDialog.h b/include/DzBridgeDialog.h index 09efd46..9404c08 100644 --- a/include/DzBridgeDialog.h +++ b/include/DzBridgeDialog.h @@ -2,6 +2,7 @@ #include "dzbasicdialog.h" #include #include +#include class QPushButton; class QLineEdit; @@ -30,6 +31,7 @@ namespace DzBridgeNameSpace Q_PROPERTY(QWidget* wExportMaterialPropertyCSVCheckBox READ getExportMaterialPropertyCSVCheckBox) Q_PROPERTY(QWidget* wTargetPluginInstallerButton READ getTargetPluginInstallerButton) Q_PROPERTY(QWidget* wTargetSoftwareVersionCombo READ getTargetSoftwareVersionCombo) + Q_PROPERTY(bool bEnableExperimentalOptions READ getEnableExperimentalOptions) public: Q_INVOKABLE QLineEdit* getAssetNameEdit() { return assetNameEdit; } Q_INVOKABLE QComboBox* getAssetTypeCombo() { return assetTypeCombo; } @@ -49,6 +51,7 @@ namespace DzBridgeNameSpace Q_INVOKABLE QCheckBox* getAnimationExportActiveCurvesCheckBox() { return animationExportActiveCurvesCheckBox; } Q_INVOKABLE QCheckBox* getAnimationApplyBoneScaleCheckBox() { return animationApplyBoneScaleCheckBox; } Q_INVOKABLE QCheckBox* getMorphLockBoneTranslationCheckBox() { return morphLockBoneTranslationCheckBox; } + Q_INVOKABLE bool getEnableExperimentalOptions() { return m_enableExperimentalOptionsCheckBox->isChecked(); } /** Constructor **/ DzBridgeDialog(QWidget* parent = nullptr, const QString& windowTitle = ""); @@ -89,7 +92,8 @@ namespace DzBridgeNameSpace virtual void HandleOpenIntermediateFolderButton(QString sFolderPath=""); virtual void HandleAssetTypeComboChange(const QString& assetType); virtual void HandleAssetTypeComboChange(int state); - + virtual void HandleExperimentalOptionsCheckBoxClicked(); + protected: QSettings* settings; @@ -105,6 +109,9 @@ namespace DzBridgeNameSpace QCheckBox* morphsEnabledCheckBox; QPushButton* subdivisionButton; QCheckBox* subdivisionEnabledCheckBox; + QLabel* m_WelcomeLabel; + + // Advanced settings QGroupBox* advancedSettingsGroupBox; QWidget* advancedWidget; QComboBox* fbxVersionCombo; @@ -115,8 +122,8 @@ namespace DzBridgeNameSpace QPushButton* m_TargetPluginInstallerButton; QComboBox* m_TargetSoftwareVersionCombo; QLabel* m_BridgeVersionLabel; - QLabel* m_WelcomeLabel; QPushButton* m_OpenIntermediateFolderButton; + QCheckBox* m_enableExperimentalOptionsCheckBox; // Animation settings QGroupBox* animationSettingsGroupBox; @@ -129,7 +136,7 @@ namespace DzBridgeNameSpace // Morph settings QGroupBox* morphSettingsGroupBox; QCheckBox* morphLockBoneTranslationCheckBox; - + QString m_sEmbeddedFilesPath = ":/DazBridge"; bool m_bDontSaveSettings = false; bool m_bSetupMode = false; diff --git a/include/common_version.h b/include/common_version.h index 788452d..30f1828 100644 --- a/include/common_version.h +++ b/include/common_version.h @@ -4,7 +4,7 @@ // Version number for Common #define COMMON_MAJOR 2023 #define COMMON_MINOR 1 -#define COMMON_REV 0 -#define COMMON_BUILD 53 +#define COMMON_REV 1 +#define COMMON_BUILD 54 #define COMMON_VERSION DZ_MAKE_VERSION( COMMON_MAJOR, COMMON_MINOR, COMMON_REV, COMMON_BUILD ) diff --git a/src/DzBridgeDialog.cpp b/src/DzBridgeDialog.cpp index eb15eab..c6b3872 100644 --- a/src/DzBridgeDialog.cpp +++ b/src/DzBridgeDialog.cpp @@ -121,7 +121,11 @@ To find out more about Daz Bridges, go to setLayout(animationSettingsLayout); experimentalAnimationExportCheckBox = new QCheckBox("", animationSettingsGroupBox); @@ -136,6 +140,23 @@ To find out more about Daz Bridges, go to addRow("Apply Bone Scale", animationApplyBoneScaleCheckBox); animationSettingsGroupBox->setVisible(false); + + // Animation Help Text + const char* AnimationExportHelpText = "New custom animation export pathway which may produce better animations. Does not export the mesh."; + experimentalAnimationExportCheckBox->setWhatsThis(tr(AnimationExportHelpText)); + experimentalAnimationExportCheckBox->setToolTip(tr(AnimationExportHelpText)); + const char* BakeAnimationHelpText ="Bake complex animations to their base componenents."; + bakeAnimationExportCheckBox->setWhatsThis(tr(BakeAnimationHelpText)); + bakeAnimationExportCheckBox->setToolTip(tr(BakeAnimationHelpText)); + const char* FaceAnimationHelpText = "Export animated face bones."; + faceAnimationExportCheckBox->setWhatsThis(tr(FaceAnimationHelpText)); + faceAnimationExportCheckBox->setToolTip(tr(FaceAnimationHelpText)); + const char* ActiveCurvesHelpText = "Export animated properties."; + animationExportActiveCurvesCheckBox->setWhatsThis(tr(ActiveCurvesHelpText)); + animationExportActiveCurvesCheckBox->setToolTip(tr(ActiveCurvesHelpText)); + const char* ApplyBoneScaleHelpText = "Apply bone scale values to animations."; + animationApplyBoneScaleCheckBox->setWhatsThis(tr(ApplyBoneScaleHelpText)); + animationApplyBoneScaleCheckBox->setToolTip(tr(ApplyBoneScaleHelpText)); // Morphs QHBoxLayout* morphsLayout = new QHBoxLayout(); @@ -213,6 +234,11 @@ To find out more about Daz Bridges, go to getEnableExperimentalOptions() to query state, see HandleAssetTypeComboChange() for example + // Enable Experimental Settings + m_enableExperimentalOptionsCheckBox = new QCheckBox("", this); + connect(m_enableExperimentalOptionsCheckBox, SIGNAL(clicked(bool)), this, SLOT(HandleExperimentalOptionsCheckBoxClicked())); + // Add the widget to the basic dialog mainLayout->addRow("Asset Name", assetNameEdit); mainLayout->addRow("Asset Type", assetTypeCombo); @@ -228,6 +254,7 @@ To find out more about Daz Bridges, go to addRow("Show FBX Dialog", showFbxDialogCheckBox); advancedLayout->addRow("Generate Normal Maps", enableNormalMapGenerationCheckBox); advancedLayout->addRow("Export Material CSV", exportMaterialPropertyCSVCheckBox); + advancedLayout->addRow("Enable Experimental Options", m_enableExperimentalOptionsCheckBox); addLayout(mainLayout); @@ -757,8 +784,22 @@ void DzBridgeDialog::HandleOpenIntermediateFolderButton(QString sFolderPath) void DzBridgeDialog::HandleAssetTypeComboChange(const QString& assetType) { +#ifdef VODSVERSION animationSettingsGroupBox->setVisible(assetType == "Animation" || assetType == "Pose"); - //mlDeformerSettingsGroupBox->setVisible(assetType == "MLDeformer"); + //mlDeformerSettingsGroupBox->setVisible(assetType == "MLDeformer"); +#else + if (this->getEnableExperimentalOptions()) { + animationSettingsGroupBox->setVisible(assetType == "Animation" || assetType == "Pose"); + } + else { + animationSettingsGroupBox->setVisible(false); + experimentalAnimationExportCheckBox->setChecked(false); + bakeAnimationExportCheckBox->setChecked(false); + faceAnimationExportCheckBox->setChecked(false); + animationExportActiveCurvesCheckBox->setChecked(false); + animationApplyBoneScaleCheckBox->setChecked(false); + } +#endif } void DzBridgeDialog::HandleAssetTypeComboChange(int state) @@ -785,4 +826,23 @@ void DzBridgeDialog::HandleAssetTypeComboChange(int state) } +void DzBridgeDialog::HandleExperimentalOptionsCheckBoxClicked() +{ + if (m_enableExperimentalOptionsCheckBox->isChecked()) + { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, "Daz Bridge", "Enabling Experimental Options may cause unexpected results. Are you sure you want to enable Experimental Options?", + QMessageBox::Yes | QMessageBox::No); + if (reply == QMessageBox::No) + { + m_enableExperimentalOptionsCheckBox->setChecked(false); + return; + } + } + + int state = m_enableExperimentalOptionsCheckBox->checkState(); + if (settings == nullptr || m_bDontSaveSettings) return; + settings->setValue("EnableExperimentalOptions", state == Qt::Checked); +} + #include "moc_DzBridgeDialog.cpp"