Skip to content

Commit

Permalink
Subdivision Hotfix Only Update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbui78 committed Jun 6, 2022
1 parent 7770648 commit 4f68c63
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
27 changes: 22 additions & 5 deletions DazStudioPlugin/DzUnrealAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,25 @@ void DzUnrealAction::executeAction()

exportProgress->finish();

// DB, 2022-June-4: Hotfix for Corrupted Imports due to UDP Packet before UpgradeToHD
if (m_EnableSubdivisions)
{
QString DTUfilename = m_sDestinationPath + m_sAssetName + ".dtu";
// Send a message to Unreal telling it to start an import
QUdpSocket* sendSocket = new QUdpSocket(this);
QHostAddress* sendAddress = new QHostAddress("127.0.0.1");

sendSocket->connectToHost(*sendAddress, m_nPort);
sendSocket->write(DTUfilename.toUtf8());
}

// DB 2021-09-02: messagebox "Export Complete"
if (m_nNonInteractiveMode == 0)
{
QMessageBox::information(0, "DazToUnreal Bridge",
tr("Export phase from Daz Studio complete. Please switch to Unreal to continue with Import phase."), QMessageBox::Ok);
}

}
}

Expand Down Expand Up @@ -193,12 +206,16 @@ void DzUnrealAction::writeConfiguration()
writer.finishObject();
DTUfile.close();

// Send a message to Unreal telling it to start an import
QUdpSocket* sendSocket = new QUdpSocket(this);
QHostAddress* sendAddress = new QHostAddress("127.0.0.1");
// DB, 2022-June-4: Hotfix for Corrupted Imports due to UDP Packet before UpgradeToHD
if (m_EnableSubdivisions == false)
{
// Send a message to Unreal telling it to start an import
QUdpSocket* sendSocket = new QUdpSocket(this);
QHostAddress* sendAddress = new QHostAddress("127.0.0.1");

sendSocket->connectToHost(*sendAddress, m_nPort);
sendSocket->write(DTUfilename.toUtf8());
sendSocket->connectToHost(*sendAddress, m_nPort);
sendSocket->write(DTUfilename.toUtf8());
}
}

// Setup custom FBX export options
Expand Down
27 changes: 27 additions & 0 deletions DazStudioPlugin/DzUnrealDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ DzUnrealDialog::DzUnrealDialog(QWidget *parent) :

settings = new QSettings("Daz 3D", "DazToUnreal");

// Connect new asset type handler
connect(assetTypeCombo, SIGNAL(activated(int)), this, SLOT(HandleAssetTypeComboChange(int)));

// Intermediate Folder
QHBoxLayout* intermediateFolderLayout = new QHBoxLayout();
intermediateFolderEdit = new QLineEdit(this);
Expand Down Expand Up @@ -151,4 +154,28 @@ void DzUnrealDialog::HandlePortChanged(const QString& port)
settings->setValue("Port", port);
}

void DzUnrealDialog::HandleAssetTypeComboChange(int state)
{
QString assetNameString = assetNameEdit->text();

// enable/disable Subdivision if Environment selected
if (assetTypeCombo->currentText() == "Environment")
{
morphsEnabledCheckBox->setChecked(false);
morphsEnabledCheckBox->setDisabled(true);
morphsButton->setDisabled(true);
subdivisionEnabledCheckBox->setChecked(false);
subdivisionEnabledCheckBox->setDisabled(true);
subdivisionButton->setDisabled(true);
}
else
{
morphsEnabledCheckBox->setDisabled(false);
morphsButton->setDisabled(false);
subdivisionEnabledCheckBox->setDisabled(false);
subdivisionButton->setDisabled(false);
}

}

#include "moc_DzUnrealDialog.cpp"
1 change: 1 addition & 0 deletions DazStudioPlugin/DzUnrealDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class DzUnrealDialog : public DZ_BRIDGE_NAMESPACE::DzBridgeDialog {
protected slots:
void HandleSelectIntermediateFolderButton();
void HandlePortChanged(const QString& port);
void HandleAssetTypeComboChange(int state);

protected:
Q_INVOKABLE bool loadSavedSettings();
Expand Down
4 changes: 2 additions & 2 deletions DazStudioPlugin/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Version number for DazToUnreal
#define PLUGIN_MAJOR 2
#define PLUGIN_MINOR 0
#define PLUGIN_REV 15
#define PLUGIN_BUILD 2
#define PLUGIN_REV 16
#define PLUGIN_BUILD 4

#define PLUGIN_VERSION DZ_MAKE_VERSION( PLUGIN_MAJOR, PLUGIN_MINOR, PLUGIN_REV, PLUGIN_BUILD )

0 comments on commit 4f68c63

Please sign in to comment.