Skip to content

Commit

Permalink
Moved Animation Export Options to Experimental Options
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbui78 committed Aug 9, 2023
1 parent 25e2ae4 commit 257643e
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 7 deletions.
13 changes: 10 additions & 3 deletions include/DzBridgeDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "dzbasicdialog.h"
#include <QtGui/qcombobox.h>
#include <QtCore/qsettings.h>
#include <QtGui/qcheckbox.h>

class QPushButton;
class QLineEdit;
Expand Down Expand Up @@ -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; }
Expand All @@ -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 = "");
Expand Down Expand Up @@ -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;

Expand All @@ -105,6 +109,9 @@ namespace DzBridgeNameSpace
QCheckBox* morphsEnabledCheckBox;
QPushButton* subdivisionButton;
QCheckBox* subdivisionEnabledCheckBox;
QLabel* m_WelcomeLabel;

// Advanced settings
QGroupBox* advancedSettingsGroupBox;
QWidget* advancedWidget;
QComboBox* fbxVersionCombo;
Expand All @@ -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;
Expand All @@ -129,7 +136,7 @@ namespace DzBridgeNameSpace
// Morph settings
QGroupBox* morphSettingsGroupBox;
QCheckBox* morphLockBoneTranslationCheckBox;

QString m_sEmbeddedFilesPath = ":/DazBridge";
bool m_bDontSaveSettings = false;
bool m_bSetupMode = false;
Expand Down
4 changes: 2 additions & 2 deletions include/common_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
64 changes: 62 additions & 2 deletions src/DzBridgeDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ To find out more about Daz Bridges, go to <a href=\"https://www.daz3d.com/daz-br
connect(assetTypeCombo, SIGNAL(activated(int)), this, SLOT(HandleAssetTypeComboChange(int)));

// Animation Settings
animationSettingsGroupBox = new QGroupBox("Animation Settings", this);
#ifdef VODSVERSION
animationSettingsGroupBox = new QGroupBox("Animation Settings", this);
#else
animationSettingsGroupBox = new QGroupBox("Experimental Animation Settings", this);
#endif
QFormLayout* animationSettingsLayout = new QFormLayout();
animationSettingsGroupBox->setLayout(animationSettingsLayout);
experimentalAnimationExportCheckBox = new QCheckBox("", animationSettingsGroupBox);
Expand All @@ -136,6 +140,23 @@ To find out more about Daz Bridges, go to <a href=\"https://www.daz3d.com/daz-br
animationApplyBoneScaleCheckBox = new QCheckBox("", animationSettingsGroupBox);
animationSettingsLayout->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();
Expand Down Expand Up @@ -213,6 +234,11 @@ To find out more about Daz Bridges, go to <a href=\"https://www.daz3d.com/daz-br
m_OpenIntermediateFolderButton = new QPushButton(tr("Open Intermediate Folder"));
connect(m_OpenIntermediateFolderButton, SIGNAL(clicked(bool)), this, SLOT(HandleOpenIntermediateFolderButton()));

// Use this->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);
Expand All @@ -228,6 +254,7 @@ To find out more about Daz Bridges, go to <a href=\"https://www.daz3d.com/daz-br
advancedLayout->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);

Expand Down Expand Up @@ -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)
Expand All @@ -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"

0 comments on commit 257643e

Please sign in to comment.