Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Vodhanel committed Nov 8, 2024
2 parents b12a271 + 8a26932 commit fb70c0b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions DazStudioPlugin/DzUnrealAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
14 changes: 14 additions & 0 deletions DazStudioPlugin/DzUnrealDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand All @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions DazStudioPlugin/DzUnrealDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fb70c0b

Please sign in to comment.