From 5ccb50819c0ea909467ed00bede49bb98973adca Mon Sep 17 00:00:00 2001 From: David-Vodhanel <39318287+David-Vodhanel@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:54:10 -0800 Subject: [PATCH] Moved the Combine Materials option to the Daz Studio interface. --- DazStudioPlugin/DzUnrealAction.cpp | 1 + DazStudioPlugin/DzUnrealDialog.cpp | 14 ++++++++++++++ DazStudioPlugin/DzUnrealDialog.h | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/DazStudioPlugin/DzUnrealAction.cpp b/DazStudioPlugin/DzUnrealAction.cpp index 845e6b0..2f12d5f 100644 --- a/DazStudioPlugin/DzUnrealAction.cpp +++ b/DazStudioPlugin/DzUnrealAction.cpp @@ -211,6 +211,7 @@ void DzUnrealAction::writeConfiguration() writer.addMember("CreateUniqueSkeleton", DazToUnrealDialog->getUniqueSkeletonPerCharacter()); writer.addMember("FixTwistBones", DazToUnrealDialog->getFixTwistBones()); writer.addMember("FaceCharacterRight", DazToUnrealDialog->getFaceCharacterRight()); + writer.addMember("MaterialCombineMethod", DazToUnrealDialog->getMaterialCombineMethod()); } if (m_sAssetType == "Animation") diff --git a/DazStudioPlugin/DzUnrealDialog.cpp b/DazStudioPlugin/DzUnrealDialog.cpp index de40c17..0eae8e5 100644 --- a/DazStudioPlugin/DzUnrealDialog.cpp +++ b/DazStudioPlugin/DzUnrealDialog.cpp @@ -103,6 +103,14 @@ DzUnrealDialog::DzUnrealDialog(QWidget *parent) : skeletalMeshFaceCharacterRightCheckBox->setWhatsThis("If checked, character will be imported facing right (X Forward) in Unreal."); commonSettingsLayout->addRow("Import Facing Right", skeletalMeshFaceCharacterRightCheckBox); + combineMaterialMethodComboBox = new QComboBox(commonSettingsGroupBox); + combineMaterialMethodComboBox->setWhatsThis("How to combine Materials in Unreal"); + combineMaterialMethodComboBox->addItem("Combine Identical"); + combineMaterialMethodComboBox->addItem("No Combine"); + combineMaterialMethodComboBox->addItem("Combine All"); + combineMaterialMethodComboBox->setCurrentIndex(0); + commonSettingsLayout->addRow("Material Combine Method", combineMaterialMethodComboBox); + commonSettingsGroupBox->setVisible(true); // Add common settings to the mainLayout as a new row without header @@ -257,6 +265,11 @@ bool DzUnrealDialog::loadSavedSettings() skeletalMeshFaceCharacterRightCheckBox->setChecked(settings->value("SkeletalMeshFaceCharacterRight").toBool()); } + if (!settings->value("MaterialCombineMethod").isNull()) + { + combineMaterialMethodComboBox->setCurrentIndex(settings->value("MaterialCombineMethod").toInt()); + } + return true; } @@ -276,6 +289,7 @@ void DzUnrealDialog::saveSettings() settings->setValue("SkeletalMeshUniqueSkeletonPerCharacter", skeletalMeshUniqueSkeletonPerCharacterCheckBox->isChecked()); settings->setValue("SkeletalMeshFixTwistBones", skeletalMeshFixTwistBonesCheckBox->isChecked()); settings->setValue("SkeletalMeshFaceCharacterRight", skeletalMeshFaceCharacterRightCheckBox->isChecked()); + settings->setValue("MaterialCombineMethod", combineMaterialMethodComboBox->currentIndex()); } void DzUnrealDialog::resetToDefaults() diff --git a/DazStudioPlugin/DzUnrealDialog.h b/DazStudioPlugin/DzUnrealDialog.h index ed0b08e..bd60660 100644 --- a/DazStudioPlugin/DzUnrealDialog.h +++ b/DazStudioPlugin/DzUnrealDialog.h @@ -53,6 +53,10 @@ class DzUnrealDialog : public DZ_BRIDGE_NAMESPACE::DzBridgeDialog { return skeletalMeshFaceCharacterRightCheckBox ? skeletalMeshFaceCharacterRightCheckBox->isChecked() : false; } + QString getMaterialCombineMethod() { + return combineMaterialMethodComboBox ? combineMaterialMethodComboBox->currentText() : QString("Combine Identical"); + } + // Settings Q_INVOKABLE void resetToDefaults() override; Q_INVOKABLE void saveSettings() override; @@ -86,6 +90,7 @@ protected slots: QGroupBox* commonSettingsGroupBox = nullptr; QCheckBox* skeletalMeshFixTwistBonesCheckBox = nullptr; QCheckBox* skeletalMeshFaceCharacterRightCheckBox = nullptr; + QComboBox* combineMaterialMethodComboBox = nullptr; #ifdef UNITTEST_DZBRIDGE friend class UnitTest_DzUnrealDialog;