├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── DazStudioPlugin ├── CMakeLists.txt ├── DzUnityAction.cpp ├── DzUnityAction.h ├── DzUnityBridge.aps ├── DzUnityBridge.rc ├── DzUnityDialog.cpp ├── DzUnityDialog.h ├── README.md ├── Resources │ ├── DazToUnity_2019_Builtin.unitypackage │ ├── DazToUnity_2019_HDRP.unitypackage │ ├── DazToUnity_2019_URP.unitypackage │ ├── DazToUnity_2020_Builtin.unitypackage │ ├── DazToUnity_2020_HDRP.unitypackage │ ├── DazToUnity_2020_URP.unitypackage │ ├── Images │ │ ├── Icon.png │ │ └── banner.jpg │ └── resources.qrc ├── pluginmain.cpp ├── resource.h └── version.h ├── LICENSE ├── README.md ├── Test ├── QA Manual Test Cases.md ├── QA-Test-Scene-01.duf ├── Results │ ├── Readme.MD │ ├── TestCase_Results.json │ ├── TestCase_Results.txt │ ├── TestResults_DzUnityAction.json │ ├── TestResults_DzUnityAction.txt │ ├── TestResults_DzUnityDialog.json │ ├── TestResults_DzUnityDialog.txt │ └── temp_log.txt ├── TestCases │ ├── QA_Utility_Functions.dsa │ ├── TC01.dsa │ ├── TC02.dsa │ ├── TC03.dsa │ ├── TC04.dsa │ ├── TC05.dsa │ ├── TC06.dsa │ ├── TC07.dsa │ ├── TC08.dsa │ ├── TC09.dsa │ ├── TC10.dsa │ ├── TC11.dsa │ ├── TC12.dsa │ ├── TC13.dsa │ ├── TC14.dsa │ ├── TC15.dsa │ ├── TC16.dsa │ ├── _TC1001.dsa │ ├── test_runner--single.dsa │ └── test_runner.dsa └── UnitTests │ ├── CMakeLists.txt │ ├── RunUnitTests.dsa │ ├── UnitTest_DzUnityAction.cpp │ ├── UnitTest_DzUnityAction.h │ ├── UnitTest_DzUnityDialog.cpp │ └── UnitTest_DzUnityDialog.h └── UnityPlugin ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── DiffusionProfiles.meta ├── DiffusionProfiles ├── IrayUberSkinDiffusionProfile.asset └── IrayUberSkinDiffusionProfile.asset.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Resources.meta ├── Resources ├── G8F Collision Rig.prefab ├── G8F Collision Rig.prefab.meta ├── Logo.png ├── Logo.png.meta ├── ReadMe.txt └── ReadMe.txt.meta ├── Scripts.meta ├── Scripts ├── ClothCollisionAssigner.cs ├── ClothCollisionAssigner.cs.meta ├── ClothTools.cs ├── ClothTools.cs.meta ├── CollapsedVertexArray.cs ├── CollapsedVertexArray.cs.meta ├── Daz3DInstance.cs ├── Daz3DInstance.cs.meta ├── Editor.meta ├── Editor │ ├── ClothCollisionAssignerEditor.cs │ ├── ClothCollisionAssignerEditor.cs.meta │ ├── ClothToolsEditor.cs │ ├── ClothToolsEditor.cs.meta │ ├── DTUConverter.cs │ ├── DTUConverter.cs.meta │ ├── Daz3DBridge.cs │ ├── Daz3DBridge.cs.meta │ ├── Daz3DDTUImporter.cs │ ├── Daz3DDTUImporter.cs.meta │ ├── DazCoroutine.cs │ ├── DazCoroutine.cs.meta │ ├── DazJSONHelper.cs │ ├── DazJSONHelper.cs.meta │ ├── DetectRenderPipeline.cs │ └── DetectRenderPipeline.cs.meta ├── Utilities.cs └── Utilities.cs.meta ├── Shaders.meta ├── Shaders ├── Helpers.meta ├── Helpers │ ├── GetLightDirection.hlsl │ ├── GetLightDirection.hlsl.meta │ ├── LightDirection.shadersubgraph │ └── LightDirection.shadersubgraph.meta ├── Invisible.shader ├── Invisible.shader.meta ├── Legacy.meta ├── Legacy │ ├── Hair.shadergraph │ ├── Hair.shadergraph.meta │ ├── IrayUberMetal.shadergraph │ ├── IrayUberMetal.shadergraph.meta │ ├── IrayUberSkin.shadergraph │ ├── IrayUberSkin.shadergraph.meta │ ├── IrayUberSpec.shadergraph │ └── IrayUberSpec.shadergraph.meta ├── Wet.shadergraph ├── Wet.shadergraph.meta ├── uDTU.meta └── uDTU │ ├── GetLightDirectionURP.hlsl │ ├── GetLightDirectionURP.hlsl.meta │ ├── LightDirectionURP.shadersubgraph │ ├── LightDirectionURP.shadersubgraph.meta │ ├── uDTU HDRP.Hair.shadergraph │ ├── uDTU HDRP.Hair.shadergraph.meta │ ├── uDTU HDRP.Metallic.shadergraph │ ├── uDTU HDRP.Metallic.shadergraph.meta │ ├── uDTU HDRP.SSS.shadergraph │ ├── uDTU HDRP.SSS.shadergraph.meta │ ├── uDTU HDRP.Specular.shadergraph │ ├── uDTU HDRP.Specular.shadergraph.meta │ ├── uDTU URP.Hair.AlphaBlend.shadergraph │ ├── uDTU URP.Hair.AlphaBlend.shadergraph.meta │ ├── uDTU URP.Hair.shadergraph │ ├── uDTU URP.Hair.shadergraph.meta │ ├── uDTU URP.Metallic.shadergraph │ ├── uDTU URP.Metallic.shadergraph.meta │ ├── uDTU URP.SSS.shadergraph │ ├── uDTU URP.SSS.shadergraph.meta │ ├── uDTU URP.Specular.shadergraph │ ├── uDTU URP.Specular.shadergraph.meta │ ├── uDTU URP.Transparent.shadergraph │ ├── uDTU URP.Transparent.shadergraph.meta │ ├── uDTU.Sub.AlternativeSpecularMix.shadersubgraph │ ├── uDTU.Sub.AlternativeSpecularMix.shadersubgraph.meta │ ├── uDTU.Sub.Base.shadersubgraph │ ├── uDTU.Sub.Base.shadersubgraph.meta │ ├── uDTU.Sub.DualLobeSpecular.shadersubgraph │ ├── uDTU.Sub.DualLobeSpecular.shadersubgraph.meta │ ├── uDTU.Sub.GlossyLayeredEffect.shadersubgraph │ ├── uDTU.Sub.GlossyLayeredEffect.shadersubgraph.meta │ ├── uDTU.Sub.Makeup.shadersubgraph │ ├── uDTU.Sub.Makeup.shadersubgraph.meta │ ├── uDTU.Sub.MetallicMix.shadersubgraph │ ├── uDTU.Sub.MetallicMix.shadersubgraph.meta │ ├── uDTU.Sub.SpecularMix.shadersubgraph │ ├── uDTU.Sub.SpecularMix.shadersubgraph.meta │ ├── uDTU.Sub.SubSurfaceScatter.shadersubgraph │ ├── uDTU.Sub.SubSurfaceScatter.shadersubgraph.meta │ ├── uDTU.Sub.TopCoat.shadersubgraph │ ├── uDTU.Sub.TopCoat.shadersubgraph.meta │ ├── uDTU.Sub.TranslucencyMask.shadersubgraph │ └── uDTU.Sub.TranslucencyMask.shadersubgraph.meta ├── Third Party Notices.md ├── Third Party Notices.md.meta ├── Vendors.meta └── Vendors ├── SimpleJSON.asmdef ├── SimpleJSON.asmdef.meta ├── SimpleJSON.cs └── SimpleJSON.cs.meta /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | out 3 | CMakeSettings.json 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dzbridge-common"] 2 | path = dzbridge-common 3 | url = https://github.com/daz3d/DazBridgeUtils.git 4 | branch = dzbridge-library 5 | -------------------------------------------------------------------------------- /DazStudioPlugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | set(CMAKE_AUTORCC ON) 3 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 4 | 5 | set(DZ_PLUGIN_TGT_NAME dzunitybridge) 6 | set(DZ_PLUGIN_PROJECT_NAME "DzBridge-Unity") 7 | 8 | include_directories(${COMMON_LIB_INCLUDE_DIR}) 9 | 10 | # if building a plugin and you want the compiled result placed in the Daz Studio ./plugins directory 11 | if(DAZ_STUDIO_EXE_DIR) 12 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${DAZ_STUDIO_EXE_DIR}/plugins) 13 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${DAZ_STUDIO_EXE_DIR}/plugins) 14 | endif() 15 | 16 | if(WIN32) 17 | set(OS_SOURCES 18 | DzUnityBridge.rc 19 | ) 20 | elseif(APPLE) 21 | set(OS_SOURCES "") 22 | endif() 23 | 24 | set(DPC_IMAGES_CPP "${CMAKE_CURRENT_BINARY_DIR}/DzUnityIcon.cpp" ) 25 | set(DPC_SRC_IMAGES 26 | Resources/Images/icon.png 27 | ) 28 | 29 | add_custom_command(OUTPUT ${DPC_IMAGES_CPP} 30 | COMMAND ${DAZ_SDK_DPC_EXE} -mode image -o ${DPC_IMAGES_CPP} ${DPC_SRC_IMAGES} 31 | DEPENDS ${DPC_SRC_IMAGES} 32 | WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} 33 | ) 34 | set_property(SOURCE ${DPC_IMAGES_CPP} PROPERTY SKIP_AUTOMOC ON) 35 | 36 | add_library( ${DZ_PLUGIN_TGT_NAME} SHARED 37 | DzUnityAction.cpp 38 | DzUnityAction.h 39 | DzUnityDialog.cpp 40 | DzUnityDialog.h 41 | pluginmain.cpp 42 | version.h 43 | Resources/resources.qrc 44 | ${DPC_IMAGES_CPP} 45 | ${OS_SOURCES} 46 | ${QA_SRCS} 47 | ) 48 | 49 | target_include_directories(${DZ_PLUGIN_TGT_NAME} 50 | PUBLIC 51 | ) 52 | 53 | target_link_libraries(${DZ_PLUGIN_TGT_NAME} 54 | PRIVATE 55 | dzcore 56 | dzbridge-static 57 | ${DZSDK_QT_CORE_TARGET} 58 | ${DZSDK_QT_GUI_TARGET} 59 | ${DZSDK_QT_SCRIPT_TARGET} 60 | ${DZSDK_QT_NETWORK_TARGET} 61 | ${FBX_IMPORT_LIBS} 62 | ${OPENSUBDIV_LIB} 63 | ) 64 | 65 | set_target_properties (${DZ_PLUGIN_TGT_NAME} 66 | PROPERTIES 67 | FOLDER "" 68 | PROJECT_LABEL ${DZ_PLUGIN_PROJECT_NAME} 69 | ) 70 | 71 | if (WIN32) 72 | target_compile_definitions(${DZ_PLUGIN_TGT_NAME} 73 | PUBLIC 74 | $<$:UNITTEST_DZBRIDGE> 75 | ${DZBRIDGE_LIB_FLAGS} 76 | ) 77 | elseif (APPLE) 78 | target_compile_definitions(${DZ_PLUGIN_TGT_NAME} 79 | PUBLIC 80 | ${DZBRIDGE_LIB_FLAGS} 81 | ) 82 | endif() -------------------------------------------------------------------------------- /DazStudioPlugin/DzUnityAction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "QtCore/qmetaobject.h" 21 | #include "dzmodifier.h" 22 | #include "dzgeometry.h" 23 | #include "dzweightmap.h" 24 | #include "dzfacetshape.h" 25 | #include "dzfacetmesh.h" 26 | #include "dzfacegroup.h" 27 | #include "dzprogress.h" 28 | 29 | #include "DzUnityAction.h" 30 | #include "DzUnityDialog.h" 31 | #include "DzBridgeMorphSelectionDialog.h" 32 | #include "DzBridgeSubdivisionDialog.h" 33 | 34 | #ifdef WIN32 35 | #include 36 | #endif 37 | 38 | #include "dzbridge.h" 39 | 40 | DzUnityAction::DzUnityAction() : 41 | DzBridgeAction(tr("Daz To &Unity"), tr("Send the selected node to Unity.")) 42 | { 43 | m_nNonInteractiveMode = 0; 44 | m_sAssetType = QString("SkeletalMesh"); 45 | //Setup Icon 46 | QString iconName = "icon"; 47 | QPixmap basePixmap = QPixmap::fromImage(getEmbeddedImage(iconName.toLatin1())); 48 | QIcon icon; 49 | icon.addPixmap(basePixmap, QIcon::Normal, QIcon::Off); 50 | QAction::setIcon(icon); 51 | 52 | } 53 | 54 | bool DzUnityAction::createUI() 55 | { 56 | // Check if the main window has been created yet. 57 | // If it hasn't, alert the user and exit early. 58 | DzMainWindow* mw = dzApp->getInterface(); 59 | if (!mw) 60 | { 61 | if (m_nNonInteractiveMode == 0) QMessageBox::warning(0, tr("Error"), 62 | tr("The main window has not been created yet."), QMessageBox::Ok); 63 | 64 | return false; 65 | } 66 | 67 | // m_subdivisionDialog creation REQUIRES valid Character or Prop selected 68 | if (dzScene->getNumSelectedNodes() != 1) 69 | { 70 | if (m_nNonInteractiveMode == 0) QMessageBox::warning(0, tr("Error"), 71 | tr("Please select one Character or Prop to send."), QMessageBox::Ok); 72 | 73 | return false; 74 | } 75 | 76 | // Create the dialog 77 | if (!m_bridgeDialog) 78 | { 79 | m_bridgeDialog = new DzUnityDialog(mw); 80 | } 81 | else 82 | { 83 | DzUnityDialog* unityDialog = qobject_cast(m_bridgeDialog); 84 | if (unityDialog) 85 | { 86 | unityDialog->resetToDefaults(); 87 | unityDialog->loadSavedSettings(); 88 | } 89 | } 90 | 91 | if (!m_subdivisionDialog) m_subdivisionDialog = DZ_BRIDGE_NAMESPACE::DzBridgeSubdivisionDialog::Get(m_bridgeDialog); 92 | if (!m_morphSelectionDialog) m_morphSelectionDialog = DZ_BRIDGE_NAMESPACE::DzBridgeMorphSelectionDialog::Get(m_bridgeDialog); 93 | 94 | return true; 95 | } 96 | 97 | void DzUnityAction::executeAction() 98 | { 99 | // CreateUI() disabled for debugging -- 2022-Feb-25 100 | /* 101 | // Create and show the dialog. If the user cancels, exit early, 102 | // otherwise continue on and do the thing that required modal 103 | // input from the user. 104 | if (createUI() == false) 105 | return; 106 | */ 107 | 108 | // Check if the main window has been created yet. 109 | // If it hasn't, alert the user and exit early. 110 | DzMainWindow* mw = dzApp->getInterface(); 111 | if (!mw) 112 | { 113 | if (m_nNonInteractiveMode == 0) 114 | { 115 | QMessageBox::warning(0, tr("Error"), 116 | tr("The main window has not been created yet."), QMessageBox::Ok); 117 | } 118 | return; 119 | } 120 | 121 | // Create and show the dialog. If the user cancels, exit early, 122 | // otherwise continue on and do the thing that required modal 123 | // input from the user. 124 | if (dzScene->getNumSelectedNodes() != 1) 125 | { 126 | DzNodeList rootNodes = buildRootNodeList(); 127 | if (rootNodes.length() == 1) 128 | { 129 | dzScene->setPrimarySelection(rootNodes[0]); 130 | } 131 | else if (rootNodes.length() > 1) 132 | { 133 | if (m_nNonInteractiveMode == 0) 134 | { 135 | QMessageBox::warning(0, tr("Error"), 136 | tr("Please select one Character or Prop to send."), QMessageBox::Ok); 137 | } 138 | } 139 | } 140 | 141 | // Create the dialog 142 | if (m_bridgeDialog == nullptr) 143 | { 144 | m_bridgeDialog = new DzUnityDialog(mw); 145 | } 146 | else 147 | { 148 | if (m_nNonInteractiveMode == 0) 149 | { 150 | m_bridgeDialog->resetToDefaults(); 151 | m_bridgeDialog->loadSavedSettings(); 152 | } 153 | } 154 | 155 | // Prepare member variables when not using GUI 156 | if (m_nNonInteractiveMode == 1) 157 | { 158 | // if (m_sRootFolder != "") m_bridgeDialog->getIntermediateFolderEdit()->setText(m_sRootFolder); 159 | 160 | if (m_aMorphListOverride.isEmpty() == false) 161 | { 162 | m_bEnableMorphs = true; 163 | m_sMorphSelectionRule = m_aMorphListOverride.join("\n1\n"); 164 | m_sMorphSelectionRule += "\n1\n.CTRLVS\n2\nAnything\n0"; 165 | if (m_morphSelectionDialog == nullptr) 166 | { 167 | m_morphSelectionDialog = DZ_BRIDGE_NAMESPACE::DzBridgeMorphSelectionDialog::Get(m_bridgeDialog); 168 | } 169 | m_mMorphNameToLabel.clear(); 170 | foreach(QString morphName, m_aMorphListOverride) 171 | { 172 | QString label = m_morphSelectionDialog->GetMorphLabelFromName(morphName); 173 | m_mMorphNameToLabel.insert(morphName, label); 174 | } 175 | } 176 | else 177 | { 178 | m_bEnableMorphs = false; 179 | m_sMorphSelectionRule = ""; 180 | m_mMorphNameToLabel.clear(); 181 | } 182 | 183 | } 184 | 185 | // If the Accept button was pressed, start the export 186 | int dlgResult = -1; 187 | if (m_nNonInteractiveMode == 0) 188 | { 189 | dlgResult = m_bridgeDialog->exec(); 190 | } 191 | if (m_nNonInteractiveMode == 1 || dlgResult == QDialog::Accepted) 192 | { 193 | // DB 2021-10-11: Progress Bar 194 | DzProgress* exportProgress = new DzProgress("Sending to Unity...", 10); 195 | 196 | // Read Common GUI values 197 | readGui(m_bridgeDialog); 198 | 199 | // Read Custom GUI values 200 | DzUnityDialog* unityDialog = qobject_cast(m_bridgeDialog); 201 | if (unityDialog) 202 | m_bInstallUnityFiles = unityDialog->installUnityFilesCheckBox->isChecked(); 203 | // custom animation filename correction for Unity 204 | if (m_sAssetType == "Animation") 205 | { 206 | if (m_nNonInteractiveMode == 0) 207 | { 208 | // correct CharacterFolder 209 | m_sExportSubfolder = m_sAssetName.left(m_sAssetName.indexOf("@")); 210 | m_sDestinationPath = m_sRootFolder + "/" + m_sExportSubfolder + "/"; 211 | // correct animation filename 212 | m_sDestinationFBX = m_sDestinationPath + m_sAssetName + ".fbx"; 213 | } 214 | } 215 | 216 | //Create Daz3D folder if it doesn't exist 217 | QDir dir; 218 | dir.mkpath(m_sRootFolder); 219 | exportProgress->step(); 220 | 221 | exportHD(exportProgress); 222 | 223 | // DB 2021-10-11: Progress Bar 224 | exportProgress->finish(); 225 | 226 | // DB 2021-09-02: messagebox "Export Complete" 227 | if (m_nNonInteractiveMode == 0) 228 | { 229 | if (m_bInstallUnityFiles) 230 | { 231 | QMessageBox::information(0, "Daz To Unity Bridge", 232 | tr("Export phase from Daz Studio complete. Please switch to Unity to continue.\n\n\ 233 | If Unity Import dialog does not appear, then please double-click the \"DazToUnity HDRP\" UnityPackage \ 234 | file located in the Assets\\Daz3D\\Support\\ folder of your Unity Project."), QMessageBox::Ok); 235 | QString destPath = createUnityFiles(true); 236 | #ifdef WIN32 237 | ShellExecute(0, 0, destPath.toLocal8Bit().data(), 0, 0, SW_SHOW); 238 | #endif 239 | } 240 | else 241 | { 242 | QMessageBox::information(0, "Daz To Unity Bridge", 243 | tr("Export phase from Daz Studio complete. Please switch to Unity to begin Import phase."), QMessageBox::Ok); 244 | } 245 | } 246 | 247 | } 248 | } 249 | 250 | QString DzUnityAction::createUnityFiles(bool replace) 251 | { 252 | if (!m_bInstallUnityFiles) 253 | return ""; 254 | 255 | QString destinationFolder = m_sRootFolder + "/Support"; 256 | QDir dir; 257 | dir.mkpath(destinationFolder); 258 | 259 | QString srcPathHDRP = ":/DazBridgeUnity/2019-hdrp.unitypackage"; 260 | QFile srcFileHDRP(srcPathHDRP); 261 | QString destPathHDRP = destinationFolder + "/DazToUnity HDRP.unitypackage"; 262 | this->copyFile(&srcFileHDRP, &destPathHDRP, replace); 263 | srcFileHDRP.close(); 264 | 265 | QString srcPathURP = ":/DazBridgeUnity/2019-urp.unitypackage"; 266 | QFile srcFileURP(srcPathURP); 267 | QString destPathURP = destinationFolder + "/DazToUnity URP.unitypackage"; 268 | this->copyFile(&srcFileURP, &destPathURP, replace); 269 | srcFileURP.close(); 270 | 271 | QString srcPathStandard = ":/DazBridgeUnity/2019-builtin.unitypackage"; 272 | QFile srcFileStandard(srcPathStandard); 273 | QString destPathStandard = destinationFolder + "/DazToUnity Standard Shader.unitypackage"; 274 | this->copyFile(&srcFileStandard, &destPathStandard, replace); 275 | srcFileStandard.close(); 276 | 277 | 278 | return destPathHDRP; 279 | } 280 | 281 | void DzUnityAction::writeConfiguration() 282 | { 283 | QString DTUfilename = m_sDestinationPath + m_sExportFilename + ".dtu"; 284 | QFile DTUfile(DTUfilename); 285 | DTUfile.open(QIODevice::WriteOnly); 286 | DzJsonWriter writer(&DTUfile); 287 | writer.startObject(true); 288 | 289 | writeDTUHeader(writer); 290 | 291 | if (m_sAssetType.toLower().contains("mesh") || m_sAssetType == "Animation") 292 | { 293 | writeAllMaterials(m_pSelectedNode, writer); 294 | writeAllMorphs(writer); 295 | 296 | // DB, 2022-June-17: Daz To Unified Bridge Format support 297 | writeMorphLinks(writer); 298 | writeMorphNames(writer); 299 | DzBoneList aBoneList = getAllBones(m_pSelectedNode); 300 | writeSkeletonData(m_pSelectedNode, writer); 301 | writeHeadTailData(m_pSelectedNode, writer); 302 | writeJointOrientation(aBoneList, writer); 303 | writeLimitData(aBoneList, writer); 304 | writePoseData(m_pSelectedNode, writer, true); 305 | 306 | writeAllSubdivisions(writer); 307 | writeAllDforceInfo(m_pSelectedNode, writer); 308 | } 309 | 310 | if (m_sAssetType == "Pose") 311 | { 312 | writeAllPoses(writer); 313 | } 314 | 315 | if (m_sAssetType == "Environment") 316 | { 317 | writeEnvironment(writer); 318 | } 319 | 320 | writer.finishObject(); 321 | DTUfile.close(); 322 | } 323 | 324 | // Setup custom FBX export options 325 | void DzUnityAction::setExportOptions(DzFileIOSettings& ExportOptions) 326 | { 327 | ExportOptions.setBoolValue("doEmbed", false); 328 | ExportOptions.setBoolValue("doDiffuseOpacity", false); 329 | ExportOptions.setBoolValue("doCopyTextures", false); 330 | 331 | } 332 | 333 | QString DzUnityAction::readGuiRootFolder() 334 | { 335 | QString rootFolder = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) + QDir::separator() + "DazToUnity"; 336 | 337 | if (m_bridgeDialog) 338 | { 339 | QLineEdit* assetsFolderEdit = nullptr; 340 | DzUnityDialog* unityDialog = qobject_cast(m_bridgeDialog); 341 | 342 | if (unityDialog) 343 | assetsFolderEdit = unityDialog->getAssetsFolderEdit(); 344 | 345 | if (assetsFolderEdit) 346 | rootFolder = assetsFolderEdit->text().replace("\\", "/") + "/Daz3D"; 347 | } 348 | return rootFolder; 349 | } 350 | 351 | #include "moc_DzUnityAction.cpp" 352 | -------------------------------------------------------------------------------- /DazStudioPlugin/DzUnityAction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "DzUnityDialog.h" 9 | 10 | class UnitTest_DzUnityAction; 11 | 12 | #include "dzbridge.h" 13 | 14 | class DzUnityAction : public DZ_BRIDGE_NAMESPACE::DzBridgeAction { 15 | Q_OBJECT 16 | Q_PROPERTY(bool InstallUnityFiles READ getInstallUnityFiles WRITE setInstallUnityFiles) 17 | public: 18 | DzUnityAction(); 19 | 20 | void setInstallUnityFiles(bool arg) { m_bInstallUnityFiles = arg; } 21 | bool getInstallUnityFiles() { return m_bInstallUnityFiles; } 22 | 23 | protected: 24 | bool m_bInstallUnityFiles; 25 | 26 | void executeAction(); 27 | Q_INVOKABLE bool createUI(); 28 | Q_INVOKABLE void writeConfiguration(); 29 | Q_INVOKABLE void setExportOptions(DzFileIOSettings& ExportOptions); 30 | Q_INVOKABLE QString createUnityFiles(bool replace = true); 31 | QString readGuiRootFolder(); 32 | 33 | #ifdef UNITTEST_DZBRIDGE 34 | friend class UnitTest_DzUnityAction; 35 | #endif 36 | 37 | }; 38 | -------------------------------------------------------------------------------- /DazStudioPlugin/DzUnityBridge.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/DzUnityBridge.aps -------------------------------------------------------------------------------- /DazStudioPlugin/DzUnityBridge.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/DzUnityBridge.rc -------------------------------------------------------------------------------- /DazStudioPlugin/DzUnityDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dzbasicdialog.h" 3 | #include 4 | #include 5 | #include 6 | 7 | class QPushButton; 8 | class QLineEdit; 9 | class QCheckBox; 10 | class QComboBox; 11 | class QGroupBox; 12 | class QLabel; 13 | class QWidget; 14 | class DzUnityAction; 15 | 16 | class UnitTest_DzUnityDialog; 17 | 18 | #include "dzbridge.h" 19 | 20 | class DzUnityDialog : public DZ_BRIDGE_NAMESPACE::DzBridgeDialog{ 21 | friend DzUnityAction; 22 | Q_OBJECT 23 | Q_PROPERTY(QWidget* assetsFolderEdit READ getAssetsFolderEdit) 24 | public: 25 | Q_INVOKABLE QLineEdit* getAssetsFolderEdit() { return assetsFolderEdit; } 26 | 27 | /** Constructor **/ 28 | DzUnityDialog(QWidget *parent=nullptr); 29 | 30 | /** Destructor **/ 31 | virtual ~DzUnityDialog() {} 32 | 33 | Q_INVOKABLE void resetToDefaults() override; 34 | Q_INVOKABLE bool loadSavedSettings() override; 35 | 36 | protected slots: 37 | void HandleSelectAssetsFolderButton(); 38 | void HandleInstallUnityFilesCheckBoxChange(int state); 39 | void HandleAssetFolderChanged(const QString& directoryName); 40 | void HandleAssetTypeComboChange(int state) override; 41 | void HandleTargetPluginInstallerButton() override; 42 | void HandleOpenIntermediateFolderButton(QString sFolderPath = "") override; 43 | void HandleAssetTypeComboChange(const QString& assetType) override; 44 | 45 | protected: 46 | QLineEdit* projectEdit; 47 | QPushButton* projectButton; 48 | QLineEdit* assetsFolderEdit; 49 | QPushButton* assetsFolderButton; 50 | 51 | QLabel* installOrOverwriteUnityFilesLabel; 52 | QCheckBox* installUnityFilesCheckBox; 53 | 54 | bool IsValidProjectFolder(QString sProjectFolderPath); 55 | virtual void setDisabled(bool) override; 56 | 57 | #ifdef UNITTEST_DZBRIDGE 58 | friend class UnitTest_DzUnityDialog; 59 | #endif 60 | }; 61 | -------------------------------------------------------------------------------- /DazStudioPlugin/README.md: -------------------------------------------------------------------------------- 1 | # Daz To Unity - Daz Studio Plugin 2 | This is the Daz Studio side plugin for the Daz To Unity tool. 3 | ## Building the Plugin for Windows 4 | To build this plugin you need the Daz Studio SDK https://www.daz3d.com/daz-studio-4-5-sdk 5 | 6 | 1) This project requires cmake to build. You can download cmake at https://cmake.org/download/ or you can use Visual Studio 2017+ or other IDEs that support cmake. 7 | 2) If using Cmake-GUI instructions: 8 | a) Click "Browse Source" and browse to DazToRuntime folder location. 9 | b) Click "Browse Build" and select where you would like your output build location to be. 10 | c) Click "Configure" and choose what generation you would like. Then click "Finish". This should start the generation and eventually fail. 11 | d) Select "DAZ_SDK_DIR" and browse to the location that you install the Daz Studio 4.5 SDK. IE: "C:\Daz 3D\Applications\Data\DAZ 3D\My DAZ 3D Library\DAZStudio4.5+ SDK" 12 | e) Optional: Select "DAZ_STUDIO_EXE_DIR" to be the location that you install Daz Studio. IE: "C:\Daz 3D\Applications\64-bit\DAZ 3D\DAZStudio4". This will copy the .DLL output into the Daz Studio\plugins folder for you when you build. 13 | e) Select "Generate". You should now have your project setup for building. 14 | 3) If using VS2019 instructions: 15 | a) Open VS2019 and click on File->Open->CMake and browse to DazToRuntime folder location. 16 | b) Right click CMakeList.txt and select "CMake settings for DazRuntimePlugins". 17 | c) Select "DAZ_SDK_DIR" and browse to the location that you install the Daz Studio 4.5 SDK. IE: "C:\Daz 3D\Applications\Data\DAZ 3D\My DAZ 3D Library\DAZStudio4.5+ SDK" 18 | d) Optional: Select "DAZ_STUDIO_EXE_DIR" to be the location that you install Daz Studio. IE: "C:\Daz 3D\Applications\64-bit\DAZ 3D\DAZStudio4". This will copy the .DLL output into the Daz Studio\plugins folder for you when you build. 19 | e) In VS2019 Change build output from "Current Document" up at the top to be "dzunitybridge.dll". -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/DazToUnity_2019_Builtin.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/DazToUnity_2019_Builtin.unitypackage -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/DazToUnity_2019_HDRP.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/DazToUnity_2019_HDRP.unitypackage -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/DazToUnity_2019_URP.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/DazToUnity_2019_URP.unitypackage -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/DazToUnity_2020_Builtin.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/DazToUnity_2020_Builtin.unitypackage -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/DazToUnity_2020_HDRP.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/DazToUnity_2020_HDRP.unitypackage -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/DazToUnity_2020_URP.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/DazToUnity_2020_URP.unitypackage -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/Images/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/Images/Icon.png -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/Images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/DazStudioPlugin/Resources/Images/banner.jpg -------------------------------------------------------------------------------- /DazStudioPlugin/Resources/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DazToUnity_2019_HDRP.unitypackage 5 | DazToUnity_2019_URP.unitypackage 6 | DazToUnity_2019_Builtin.unitypackage 7 | DazToUnity_2020_HDRP.unitypackage 8 | DazToUnity_2020_URP.unitypackage 9 | DazToUnity_2020_Builtin.unitypackage 10 | Images/Icon.png 11 | Images/banner.jpg 12 | 13 | 14 | -------------------------------------------------------------------------------- /DazStudioPlugin/pluginmain.cpp: -------------------------------------------------------------------------------- 1 | #include "dzplugin.h" 2 | #include "dzapp.h" 3 | 4 | #include "version.h" 5 | #include "DzUnityAction.h" 6 | #include "DzUnityDialog.h" 7 | 8 | #include "dzbridge.h" 9 | 10 | CPP_PLUGIN_DEFINITION("Daz To Unity Bridge"); 11 | 12 | DZ_PLUGIN_AUTHOR("Daz 3D, Inc"); 13 | 14 | DZ_PLUGIN_VERSION(PLUGIN_MAJOR, PLUGIN_MINOR, PLUGIN_REV, PLUGIN_BUILD); 15 | 16 | #ifdef _DEBUG 17 | DZ_PLUGIN_DESCRIPTION(QString( 18 | "Pre-Release DazToUnity Bridge v%1.%2.%3.%4
\ 19 | Github

" 20 | ).arg(PLUGIN_MAJOR).arg(PLUGIN_MINOR).arg(PLUGIN_REV).arg(PLUGIN_BUILD)); 21 | #else 22 | DZ_PLUGIN_DESCRIPTION(QString( 23 | "This plugin provides the ability to send assets to Unity. \ 24 | Documentation and source code are available on Github.
" 25 | )); 26 | #endif 27 | 28 | DZ_PLUGIN_CLASS_GUID(DzUnityAction, 2C2AA695-652C-4FA9-BE48-E0AB954E28AB); 29 | NEW_PLUGIN_CUSTOM_CLASS_GUID(DzUnityDialog, 06cf5776-8e81-4a81-bad8-619ed1205b58); 30 | 31 | #ifdef UNITTEST_DZBRIDGE 32 | 33 | #include "UnitTest_DzUnityAction.h" 34 | #include "UnitTest_DzUnityDialog.h" 35 | 36 | DZ_PLUGIN_CLASS_GUID(UnitTest_DzUnityAction, 17637434-188f-46eb-81e2-8829f2440742); 37 | DZ_PLUGIN_CLASS_GUID(UnitTest_DzUnityDialog, ca9c9f54-236d-4ab6-bca3-1cf6c3f93f6a); 38 | 39 | #endif -------------------------------------------------------------------------------- /DazStudioPlugin/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "dzversion.h" 3 | 4 | // Version number for dzBridge-Unity 5 | #define PLUGIN_MAJOR 2023 6 | #define PLUGIN_MINOR 1 7 | #define PLUGIN_REV 1 8 | #define PLUGIN_BUILD 11 9 | 10 | #define PLUGIN_VERSION DZ_MAKE_VERSION( PLUGIN_MAJOR, PLUGIN_MINOR, PLUGIN_REV, PLUGIN_BUILD ) 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DazToUnity 2 | A Daz Studio Plugin based on Daz Bridge Library, allowing transfer of Daz Studio characters and props to the Unity game engine. 3 | 4 | # Table of Contents 5 | 1. About the Bridge 6 | 2. How to Install 7 | 3. How to Use 8 | 4. How to Build 9 | 5. How to QA Test 10 | 6. How to Develop 11 | 12 | 13 | # 1. About the Bridge 14 | This is a refactored version of the original DazToUnity Bridge using the Daz Bridge Library as a foundation. Using the Bridge Library allows it to share source code and features with other bridges such as the refactored DazToUnreal and DazToBlender bridges. This will improve development time and quality of all bridges. 15 | 16 | The DazToUnity Bridge consists of two parts: a Daz Studio plugin which exports assets to a Unity Project and a Unity Package which contains shaders, scripts and other resources to help recreate the look of the original Daz Studio asset in the Unity game engine. 17 | 18 | 19 | # 2. How to Install 20 | ### Daz Studio Plugin ### 21 | - You can install the Daz Studio plugin automatically through the Daz Install Manager or Daz Central. This will add a new menu option under File -> Send To -> Daz To Unity. 22 | - For the latest release and bugfixes: 23 | 1. Go to the [Release page](https://github.com/daz3d/DazToUnity/releases) 24 | 2. Download the zipped **dzunitybridge.dll** (libdzunitybridge.dylib** for macOS) 25 | 3. Unzip and copy it into the Daz Studio plugins folder (example: `\Daz 3D\Applications\64-bit\DAZ 3D\DAZStudio4\plugins`) 26 | 27 | 28 | ### Unity Plugin ### 29 | - There is now an improved Unity plugin installer which can be accessed in the Advanced Settings section of the DazToUnity Bridge dialog in Daz Studio. 30 | 1. Start your Unity Project and leave it in running in the background. 31 | 2. Start Daz Studio and select File -> Send To -> DazToUnity. 32 | 3. Enable the Advanced Settings checkbox. 33 | 4. Select your Unity Version and Rendering Pipeline from the dropdown. 34 | 5. Click "Install Plugin". A window will popup for you to select a Unity Project to which to install the Unity plugin. 35 | 6. Navigate to your Unity Project's root folder. 36 | 7. Click "Select Folder". You will see a confirmation dialog stating if the plugin was successfully copied to your Unity Project. 37 | 8. Depending on your machine and setup, a Unity Import Package dialog may automatically appear. Click Import. 38 | 9. If an Import Package dialog does not appear, switch to your Unity Project and navigate to the `Assets\Daz3D\Support` folder. 39 | 10. Inside that folder, you will find installation packages for all render-pipelines: 40 | - For HDRP: double-click "DazToUnity HDRP.unitypackage" and click Import. 41 | - For URP: double-click "DazToUnity URP.unitypackage" and click Import. 42 | - For Built-In Render-pipline: double-click "DazToUnity Standard Shader.unitypackage" and click Import. 43 | 11. If a popup window asks you to Update the Scripts or API, then click "Yes, for these and other all files". 44 | 12. For HDRP, you will also need to add a diffusion profile: Unity 2019: This list is found in the Material section of each HD RenderPipeline Asset, which can be found in the Quality->HDRP panel of the Project Settings dialog. Unity 2020 and above: This list is found at the bottom of the HDRP Default Settings panel in the Project Settings dialog. 45 | 46 | 47 | # 3. How to Use 48 | 1. Start Daz Studio, add a Figure or Prop to your scene. 49 | 2. Select the top-most node for your Figure or Prop in the Scene Pane. 50 | 3. Select from the main menu: File->Send To->Daz to Unity. 51 | 4. Select the Asset Folder for your project. 52 | 5. Select the desired Asset Type. Tip: for Figures, select "Skeletal Mesh". For Animation, select "Animation". For all others, select "Static Mesh". 53 | 6. To enable Morphs or Subdivision levels, click the CheckBox to Enable that option, then click the "Choose Morphs" or "Choose Subdivisions" button to configure your selections. 54 | 7. Click Accept, then wait for a dialog popup to notify you when to switch to the Unity Window. 55 | 56 | 57 | # 4. How to Build 58 | Requirements: Daz Studio 4.5+ SDK, Qt 4.8.1, Autodesk Fbx SDK, Pixar OpenSubdiv Library, CMake, C++ development environment 59 | 60 | Download or clone the DazToUnity github repository to your local machine. The Daz Bridge Library is linked as a git submodule to the DazToBridge repository. Depending on your git client, you may have to use `git submodule init` and `git submodule update` to properly clone the Daz Bridge Library. 61 | 62 | Use CMake to configure the project files. Daz Bridge Library will be automatically configured to static-link with DazToUnity. If using the CMake gui, you will be prompted for folder paths to dependencies: Daz SDK, Qt 4.8.1, Fbx SDK and OpenSubdiv during the Configure process. 63 | 64 | 65 | # 5. How to QA Test 66 | The Test folder contains a `QA Manual Test Cases.md` document with instructions for performaing manual tests. The Test folder also contains subfolders for UnitTests, TestCases and Results. To run automated Test Cases, run Daz Studio and load the `Test/testcases/test_runner.dsa` script, configure the sIncludePath on line 4, then execute the script. Results will be written to report files stored in the `Test/Reports` subfolder. 67 | 68 | To run UnitTests, you must first build special Debug versions of the DzBridge-Unity and DzBridge Static sub-projects with Visual Studio configured for C++ Code Generation: Enable C++ Exceptions: Yes with SEH Exceptions (/EHa). This enables the memory exception handling features which are used during null pointer argument tests of the UnitTests. Once the special Debug version of DazToUnity dll is built and installed, run Daz Studio and load the `Test/UnitTests/RunUnitTests.dsa` script. Configure the sIncludePath and sOutputPath on lines 4 and 5, then execute the script. Several UI dialog prompts will appear on screen as part of the UnitTests of their related functions. Just click OK or Cancel to advance through them. Results will be written to report files stored in the `Test/Reports` subfolder. 69 | 70 | For more information on running QA test scripts and writing your own test scripts, please refer to `How To Use QA Test Scripts.md` and `QA Script Documentation and Examples.dsa` which are located in the Daz Bridge Library repository: https://github.com/daz3d/DazBridgeUtils. 71 | 72 | Special Note: The QA Report Files generated by the UnitTest and TestCase scripts have been designed and formatted so that the QA Reports will only change when there is a change in a test result. This allows Github to conveniently track the history of test results with source-code changes, and allows developers and QA testers to notified by Github or their git client when there are any changes and the exact test that changed its result. 73 | 74 | # 6. How to Modify and Develop 75 | The Daz Studio Plugin source code is contained in the `DazStudioPlugin` folder. The Unity Package source code and resources are available in a separate github repository. Modifications to the Unity Package files can be embedded in the Daz Studio Plugin by exporting a .UnityPackage file from inside Unity. Then copying the updated UnityPackage to the `DazStudioPlugin/Resources` folder and replacing the existing .UnityPackage file there. 76 | 77 | The DazToUnity Bridge uses a branch of the Daz Bridge Library which is modified to use the "DzUnityNS" namespace. This ensures that there are no C++ Namespace collisions when other plugins based on the Daz Bridge Library are also loaded in Daz Studio. In order to link and share C++ classes between this plugin and the Daz Bridge Library, a custom `CPP_PLUGIN_DEFINITION()` macro is used instead of the standard DZ_PLUGIN_DEFINITION macro and usual .DEF (DzUnityBridge.def) file. NOTE: Use of the DZ_PLUGIN_DEFINITION macro and DEF file use will disable C++ class export in the Visual Studio compiler. 78 | -------------------------------------------------------------------------------- /Test/QA-Test-Scene-01.duf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/Test/QA-Test-Scene-01.duf -------------------------------------------------------------------------------- /Test/Results/Readme.MD: -------------------------------------------------------------------------------- 1 | This is the output folder for QA test results. 2 | -------------------------------------------------------------------------------- /Test/Results/TestCase_Results.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestCase ID": "TC01", 3 | "Test Result": true, 4 | "Time": "", 5 | "Test Log": "" 6 | } 7 | { 8 | "TestCase ID": "TC02", 9 | "Test Result": true, 10 | "Time": "", 11 | "Test Log": "" 12 | } 13 | { 14 | "TestCase ID": "TC03", 15 | "Test Result": true, 16 | "Time": "", 17 | "Test Log": "" 18 | } 19 | { 20 | "TestCase ID": "TC04", 21 | "Test Result": true, 22 | "Time": "", 23 | "Test Log": "" 24 | } 25 | { 26 | "TestCase ID": "TC05", 27 | "Test Result": true, 28 | "Time": "", 29 | "Test Log": "" 30 | } 31 | { 32 | "TestCase ID": "TC06", 33 | "Test Result": true, 34 | "Time": "", 35 | "Test Log": "" 36 | } 37 | { 38 | "TestCase ID": "TC07", 39 | "Test Result": true, 40 | "Time": "", 41 | "Test Log": "" 42 | } 43 | { 44 | "TestCase ID": "TC08", 45 | "Test Result": true, 46 | "Time": "", 47 | "Test Log": "" 48 | } 49 | { 50 | "TestCase ID": "TC09", 51 | "Test Result": true, 52 | "Time": "", 53 | "Test Log": "" 54 | } 55 | { 56 | "TestCase ID": "TC10", 57 | "Test Result": true, 58 | "Time": "", 59 | "Test Log": "" 60 | } 61 | { 62 | "TestCase ID": "TC11", 63 | "Test Result": true, 64 | "Time": "", 65 | "Test Log": "" 66 | } 67 | { 68 | "TestCase ID": "TC12", 69 | "Test Result": true, 70 | "Time": "", 71 | "Test Log": "" 72 | } 73 | { 74 | "TestCase ID": "TC13", 75 | "Test Result": true, 76 | "Time": "", 77 | "Test Log": "" 78 | } 79 | { 80 | "TestCase ID": "TC14", 81 | "Test Result": true, 82 | "Time": "", 83 | "Test Log": "" 84 | } 85 | { 86 | "TestCase ID": "TC15", 87 | "Test Result": true, 88 | "Time": "", 89 | "Test Log": "" 90 | } 91 | { 92 | "TestCase ID": "TC16", 93 | "Test Result": true, 94 | "Time": "", 95 | "Test Log": "" 96 | } 97 | -------------------------------------------------------------------------------- /Test/Results/TestCase_Results.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | ======================= 4 | Automated Test Results: 5 | ======================= 6 | 7 | 8 | Test Case 1: PASSED 9 | Test Case 2: PASSED 10 | Test Case 3: PASSED 11 | Test Case 4: PASSED 12 | Test Case 5: PASSED 13 | Test Case 6: PASSED 14 | Test Case 7: PASSED 15 | Test Case 8: PASSED 16 | Test Case 9: PASSED 17 | Test Case 10: PASSED 18 | Test Case 11: PASSED 19 | Test Case 12: PASSED 20 | Test Case 13: PASSED 21 | Test Case 14: PASSED 22 | Test Case 15: PASSED 23 | Test Case 16: PASSED 24 | -------------------------------------------------------------------------------- /Test/Results/TestResults_DzUnityAction.json: -------------------------------------------------------------------------------- 1 | { 2 | "UnitTest Results Version" : 1, 3 | "Class Name" : "DzUnityAction", 4 | "Number of UnitTests" : 9, 5 | "Detailed Test Results" : [ 6 | { 7 | "UnitTest ID" : 0, 8 | "Method Name" : "_DzBridgeUnityAction", 9 | "Test Result" : true, 10 | "Test Log" : "" 11 | }, 12 | { 13 | "UnitTest ID" : 1, 14 | "Method Name" : "setInstallUnityFiles", 15 | "Test Result" : true, 16 | "Test Log" : "" 17 | }, 18 | { 19 | "UnitTest ID" : 2, 20 | "Method Name" : "getInstallUnityFiles", 21 | "Test Result" : true, 22 | "Test Log" : "" 23 | }, 24 | { 25 | "UnitTest ID" : 3, 26 | "Method Name" : "executeAction", 27 | "Test Result" : true, 28 | "Test Log" : "" 29 | }, 30 | { 31 | "UnitTest ID" : 4, 32 | "Method Name" : "createUI", 33 | "Test Result" : true, 34 | "Test Log" : "" 35 | }, 36 | { 37 | "UnitTest ID" : 5, 38 | "Method Name" : "writeConfiguration", 39 | "Test Result" : true, 40 | "Test Log" : "" 41 | }, 42 | { 43 | "UnitTest ID" : 6, 44 | "Method Name" : "setExportOptions", 45 | "Test Result" : true, 46 | "Test Log" : "" 47 | }, 48 | { 49 | "UnitTest ID" : 7, 50 | "Method Name" : "createUnityFiles", 51 | "Test Result" : true, 52 | "Test Log" : "" 53 | }, 54 | { 55 | "UnitTest ID" : 8, 56 | "Method Name" : "readGuiRootFolder", 57 | "Test Result" : true, 58 | "Test Log" : "" 59 | } 60 | ] 61 | } -------------------------------------------------------------------------------- /Test/Results/TestResults_DzUnityAction.txt: -------------------------------------------------------------------------------- 1 | ======= UnitTest Details ======= 2 | 3 | 4 | ======= UnitTest Summary ======= 5 | 6 | Class Name: DzUnityAction 7 | Number of UnitTests: 9 8 | 9 | [ 0] _DzBridgeUnityAction:.[ PASSED ] 10 | [ 1] setInstallUnityFiles:.[ PASSED ] 11 | [ 2] getInstallUnityFiles:.[ PASSED ] 12 | [ 3] executeAction:........[ PASSED ] 13 | [ 4] createUI:.............[ PASSED ] 14 | [ 5] writeConfiguration:...[ PASSED ] 15 | [ 6] setExportOptions:.....[ PASSED ] 16 | [ 7] createUnityFiles:.....[ PASSED ] 17 | [ 8] readGuiRootFolder:....[ PASSED ] 18 | 19 | End of Report. 20 | -------------------------------------------------------------------------------- /Test/Results/TestResults_DzUnityDialog.json: -------------------------------------------------------------------------------- 1 | { 2 | "UnitTest Results Version" : 1, 3 | "Class Name" : "DzUnityDialog", 4 | "Number of UnitTests" : 8, 5 | "Detailed Test Results" : [ 6 | { 7 | "UnitTest ID" : 0, 8 | "Method Name" : "_DzBridgeUnityDialog", 9 | "Test Result" : true, 10 | "Test Log" : "" 11 | }, 12 | { 13 | "UnitTest ID" : 1, 14 | "Method Name" : "getAssetsFolderEdit", 15 | "Test Result" : true, 16 | "Test Log" : "" 17 | }, 18 | { 19 | "UnitTest ID" : 2, 20 | "Method Name" : "resetToDefaults", 21 | "Test Result" : true, 22 | "Test Log" : "" 23 | }, 24 | { 25 | "UnitTest ID" : 3, 26 | "Method Name" : "loadSavedSettings", 27 | "Test Result" : true, 28 | "Test Log" : "" 29 | }, 30 | { 31 | "UnitTest ID" : 4, 32 | "Method Name" : "HandleSelectAssetsFolderButton", 33 | "Test Result" : true, 34 | "Test Log" : "" 35 | }, 36 | { 37 | "UnitTest ID" : 5, 38 | "Method Name" : "HandleInstallUnityFilesCheckBoxChange", 39 | "Test Result" : true, 40 | "Test Log" : "" 41 | }, 42 | { 43 | "UnitTest ID" : 6, 44 | "Method Name" : "HandleAssetTypeComboChange", 45 | "Test Result" : true, 46 | "Test Log" : "" 47 | }, 48 | { 49 | "UnitTest ID" : 7, 50 | "Method Name" : "HandleAssetFolderChanged", 51 | "Test Result" : true, 52 | "Test Log" : "" 53 | } 54 | ] 55 | } -------------------------------------------------------------------------------- /Test/Results/TestResults_DzUnityDialog.txt: -------------------------------------------------------------------------------- 1 | ======= UnitTest Details ======= 2 | 3 | 4 | ======= UnitTest Summary ======= 5 | 6 | Class Name: DzUnityDialog 7 | Number of UnitTests: 8 8 | 9 | [ 0] _DzBridgeUnityDialog:..................[ PASSED ] 10 | [ 1] getAssetsFolderEdit:...................[ PASSED ] 11 | [ 2] resetToDefaults:.......................[ PASSED ] 12 | [ 3] loadSavedSettings:.....................[ PASSED ] 13 | [ 4] HandleSelectAssetsFolderButton:........[ PASSED ] 14 | [ 5] HandleInstallUnityFilesCheckBoxChange:.[ PASSED ] 15 | [ 6] HandleAssetTypeComboChange:............[ PASSED ] 16 | [ 7] HandleAssetFolderChanged:..............[ PASSED ] 17 | 18 | End of Report. 19 | -------------------------------------------------------------------------------- /Test/Results/temp_log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/Test/Results/temp_log.txt -------------------------------------------------------------------------------- /Test/TestCases/QA_Utility_Functions.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | var sOutputPath = Global_sOutputPath; 4 | var sLogFile = sOutputPath + "/" + "temp_log.txt"; 5 | var sJsonFile = sOutputPath + "/" + "TestCase_Results.json" 6 | var sReportFile = sOutputPath + "/" + "TestCase_Results.txt" 7 | 8 | function writeLogToReport() 9 | { 10 | var oFile = new DzFile(sReportFile); 11 | oFile.open( DzFile.WriteOnly ); 12 | oFile.write(readLogText()); 13 | oFile.close(); 14 | } 15 | 16 | function clearLog() 17 | { 18 | var oFile = new DzFile(sLogFile); 19 | oFile.open( DzFile.WriteOnly ); 20 | oFile.write(""); 21 | oFile.close(); 22 | } 23 | 24 | function clearJson() 25 | { 26 | var oFile = new DzFile(sJsonFile); 27 | oFile.open( DzFile.WriteOnly ); 28 | oFile.write(""); 29 | oFile.close(); 30 | } 31 | 32 | function printToLog(sText) 33 | { 34 | print(sText); 35 | var oFile = new DzFile(sLogFile); 36 | oFile.open( DzFile.Append ); 37 | oFile.write(sText + "\n"); 38 | oFile.close(); 39 | } 40 | 41 | function logTxt(logText) 42 | { 43 | var file = new DzFile(sLogFile); 44 | file.open( DzFile.Append ); 45 | file.write(logText); 46 | file.close(); 47 | } 48 | 49 | function readLogText() 50 | { 51 | var file = new DzFile(sLogFile); 52 | file.open( DzFile.ReadOnly); 53 | return file.read(); 54 | } 55 | 56 | function logToJson(testCase, result) 57 | { 58 | var TestCase = testCase; 59 | var file = new DzFile(sJsonFile); 60 | var sDateString = ""; 61 | var sLogString = ""; 62 | if (result == false) 63 | { 64 | sDateString = Date(); 65 | sLogString = readLogText() 66 | } 67 | file.open( DzFile.Append); 68 | file.write( 69 | JSON.stringify({ 70 | "TestCase ID": TestCase, 71 | "Test Result": result, 72 | "Time": sDateString, 73 | "Test Log": sLogString 74 | }, null, "\t")); 75 | file.write("\n"); 76 | file.close(); 77 | clearLog(); 78 | 79 | return result; 80 | } 81 | 82 | ///////////////////////////////////// 83 | // Validation functions 84 | ///////////////////////////////////// 85 | function Validate_DTU_file( sDtuFilename ) 86 | { 87 | /* 88 | var oFile = new DzFile( sDtuFilename ); 89 | if ( !oFile.exists() ) 90 | { 91 | printToLog("DTU File not found [FAILED]."); 92 | return false; 93 | } 94 | 95 | oFile.open( DzFile.ReadOnly ); 96 | if (!oFile) 97 | { 98 | printToLog("Unable to open DTU file [FAILED]."); 99 | return false; 100 | } 101 | 102 | var sDTU_contents = oFile.read(); 103 | if (!sDTU_contents) 104 | { 105 | printToLog("Unable to read file [FAILED]."); 106 | return false; 107 | } 108 | 109 | var oDTU = {}; 110 | try 111 | { 112 | oDTU = JSON.parse(sDTU_contents); 113 | } 114 | catch (e) 115 | { 116 | oDTU = false; 117 | } 118 | */ 119 | var oDTU = Load_DTU_file(sDtuFilename); 120 | 121 | if (!oDTU) 122 | { 123 | printToLog("DTU: Invalid JSON format [FAILED]."); 124 | return false; 125 | } 126 | else 127 | { 128 | printToLog("DTU: Valid JSON format [OK]."); 129 | return true; 130 | } 131 | return false; 132 | } 133 | 134 | function Load_DTU_file (sDtuFilename) 135 | { 136 | var oFile = new DzFile( sDtuFilename ); 137 | if ( !oFile.exists() ) 138 | { 139 | printToLog("DTU File not found [FAILED]."); 140 | return false; 141 | } 142 | 143 | oFile.open( DzFile.ReadOnly ); 144 | if (!oFile) 145 | { 146 | printToLog("Unable to open DTU file [FAILED]."); 147 | return false; 148 | } 149 | 150 | var sDTU_contents = oFile.read(); 151 | if (!sDTU_contents) 152 | { 153 | printToLog("Unable to read file [FAILED]."); 154 | return false; 155 | } 156 | 157 | var oDTU = {}; 158 | try 159 | { 160 | oDTU = JSON.parse(sDTU_contents); 161 | } 162 | catch (e) 163 | { 164 | oDTU = false; 165 | } 166 | 167 | return oDTU; 168 | } 169 | 170 | function Validate_FBX_file (sFbxFilename) 171 | { 172 | var oFBXi = new OpenFBXInterface(); 173 | var result = oFBXi.LoadScene(sFbxFilename); 174 | if (result) 175 | { 176 | printToLog("FBX fileformat check passed: valid FBX file"); 177 | return true; 178 | } 179 | else 180 | { 181 | printToLog("FBX fileformat check failed: invalid FBX file"); 182 | return false; 183 | } 184 | return false; 185 | } 186 | 187 | function Validate_NormalMaps (arrNormalMapList, sDTUpath) 188 | { 189 | var sExportTexturesFolder = sDTUpath + "/" + "exporttextures"; 190 | //printToLog(sExportTexturesFolder) 191 | var oFolderInfo = new DzDir( sExportTexturesFolder ); 192 | if ( !oFolderInfo.exists() ) 193 | { 194 | printToLog("Normal map folder not found [FAILED]."); 195 | return false; 196 | } 197 | else 198 | { 199 | printToLog("Generated Normal map folder found:"); 200 | } 201 | oFolderInfo.setNameFilters(["*_nm.png"]); 202 | var numFiles = oFolderInfo.count(); 203 | if (numFiles != arrNormalMapList.length) 204 | { 205 | printToLog("Incorrect number of normal maps found [FAILED]."); 206 | return false; 207 | } 208 | for (i=0; i < arrNormalMapList.length ; i++) 209 | { 210 | sNormalMapPath = sExportTexturesFolder + "/" + arrNormalMapList[i]; 211 | var oFileInfo = new DzFileInfo(sNormalMapPath); 212 | if (oFileInfo.exists()) 213 | { 214 | printToLog("Generated normal map found: " + arrNormalMapList[i] + ":"); 215 | if (Validate_Image_Format(sNormalMapPath) == false) 216 | { 217 | return false; 218 | } 219 | } 220 | else 221 | { 222 | printToLog("Normal map not found: " + arrNormalMapList[i] + " [FAILED]"); 223 | return false; 224 | } 225 | } 226 | 227 | ///////////////////////////////////////////// 228 | // TODO: Check undoGenerateMissingNormalMaps() 229 | // Check All Surfaces to Verify that 230 | // added Normal Maps were properly 231 | // removed. 232 | ///////////////////////////////////////////// 233 | 234 | return true; 235 | } 236 | 237 | function Validate_Image_Format(sImagePath) 238 | { 239 | var img = new QImage; 240 | if (img.load(sImagePath) == true) 241 | { 242 | printToLog(" - valid image format. [OK]"); 243 | return true; 244 | } 245 | else 246 | { 247 | printToLog(" - invalid format. [FAILED]") 248 | return false; 249 | } 250 | 251 | print ("UNKNOWN ERROR: Validate_Image_Format( \"" + sImagePath + "\" )"); 252 | return false; 253 | } 254 | 255 | function Validate_LIE_Textures(nNumLIETextures, sNameFilters, sDTUpath) 256 | { 257 | var sExportTexturesFolder = sDTUpath + "/" + "exporttextures"; 258 | var oTextureFolder = DzDir(sExportTexturesFolder); 259 | if (oTextureFolder.exists() == false) 260 | { 261 | printToLog("ExportTextures subfolder was NOT generated [FAILED]."); 262 | return false; 263 | } 264 | 265 | oTextureFolder.setNameFilters(sNameFilters); 266 | var oFileList = oTextureFolder.entryList(); 267 | 268 | if (oFileList.length != nNumLIETextures) 269 | { 270 | printToLog("Incorrect number of LIE textures found [FAILED]."); 271 | return false; 272 | } 273 | for (var i=0; i < oFileList.length; i++) 274 | { 275 | var sTexturePath = sExportTexturesFolder + "/" + oFileList[i]; 276 | printToLog("LIE texture found: " + oFileList[i] + ":"); 277 | if (Validate_Image_Format(sTexturePath) == false) 278 | { 279 | return false; 280 | } 281 | } 282 | 283 | return true; 284 | } 285 | 286 | ///////////////////////////////////// 287 | // Run Test Case function 288 | ///////////////////////////////////// 289 | function Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList) 290 | { 291 | // var oBridge = new DzUnrealAction(); 292 | var oBridge = new DzUnityAction(); 293 | // var oBridge = new DzBridgeScriptableAction(); 294 | oBridge.resetToDefaults(); 295 | 296 | var sResultString = Run_Exporter2(oBridge, sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 297 | 298 | return sResultString; 299 | } 300 | 301 | // Run_Exporter2(): 302 | // Description: Like Run_Exporter() but does not call resetToDefaults() and does not initialize DzUnrealAction() 303 | function Run_Exporter2(oBridge, sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList) 304 | { 305 | var obj = oBridge; 306 | obj.setNonInteractiveMode(1); 307 | 308 | // obj.UseRelativePaths: set true for relative Daz Library runtime paths 309 | // set false for absolute filepath 310 | // Default to true to work with interactive mode 311 | obj.setUseRelativePaths(false); 312 | // obj.UseRelativePaths = true; 313 | 314 | // obj.ExportFilename: filename stem for DTU and FBX file 315 | // Can not have spaces or hyphen. Underscore is OK 316 | // Leave blank to default to sanitized Scene Node Label 317 | if (sExportFilename != "") 318 | { 319 | obj.setExportFilename(sExportFilename); 320 | } 321 | 322 | // obj.AssetType: "SkeletalMesh" [DEFAULT], "StaticMesh", "Animation", "Environment", "Pose" 323 | if (sAssetType != "") 324 | { 325 | obj.setAssetType(sAssetType); 326 | } 327 | 328 | // obj.RootFolder: path to destination root 329 | // If folder or path doesn't exist, it will be created 330 | if (sRootFolder != "") 331 | { 332 | obj.setRootFolder(sRootFolder); 333 | } 334 | 335 | // obj.ExportFolder: name folder containing DTU/FBX 336 | // Leave blank to default to sanitized Scene Node Label like ExportFilename 337 | if (sExportFolder != "") 338 | { 339 | obj.setExportFolder(sExportFolder); 340 | } 341 | 342 | // obj.ProductName: Daz Store Product Name (or anything you want), can have spaces & special characters 343 | if (sProductName != "") 344 | { 345 | obj.setProductName(sProductName); 346 | } 347 | 348 | // obj.ProductComponentName: Friendly Name for component within Product 349 | // Put frienldy pose name or material name here 350 | if (sComponentName != "") 351 | { 352 | obj.setProductComponentName(sComponentName); 353 | } 354 | 355 | // obj.MorphList: String array of morphs to convert into blendshapes within FBX. 356 | // Leave empty if you do not want to export any blendshapes. 357 | //obj.MorphList = ["CTRLVictoria8_1", "FHMVictoria8_1", "FBMVictoria8_1"] 358 | if (arrayMorphList.length > 0) 359 | { 360 | obj.setMorphList(arrayMorphList); 361 | } 362 | 363 | obj.executeAction() 364 | 365 | var sReturnString = obj.getRootFolder() + "/" + obj.getExportFolder() + "/" + obj.getExportFilename() + ".dtu" 366 | 367 | return sReturnString; 368 | } 369 | -------------------------------------------------------------------------------- /Test/TestCases/TC01.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | // Test Case TC1 4 | function Run_TestCase_01(sTestAsset) 5 | { 6 | sExportFilename = ""; 7 | sAssetType = "SkeletalMesh"; 8 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 9 | sExportFolder = "TC01"; 10 | sProductName = ""; 11 | sComponentName = ""; 12 | arrayMorphList = []; 13 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 14 | 15 | printToLog("Running Test Case 1:"); 16 | 17 | // start with clean Daz Studio scene (TC1.1) 18 | Scene.clear(); 19 | var oContentMgr = App.getContentMgr(); 20 | 21 | // load Genesis 8 Basic Female (TC1.5) 22 | var sFullPath = oContentMgr.findFile(sTestAsset); 23 | oContentMgr.openFile(sFullPath); 24 | 25 | // Send to Unity with default settings (TC1.6) 26 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 27 | //printToLog("DEBUG: sReturnString = " + sReturnString); 28 | var sDtuFilename = sReturnString; 29 | 30 | // check for expected root folder, export folder and export filename (TC1.10) 31 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis8female.dtu") == -1) 32 | { 33 | printToLog("Test Case 1 FAILED: Incorrect output DTU filename, output filename=[" + sReturnString + "], expected filename=[" + pathToDUFolder + "/genesis8female.dtu]"); 34 | return false; 35 | } 36 | 37 | printToLog("Exported DTU = " + sDtuFilename); 38 | if (Validate_DTU_file(sDtuFilename) == false) 39 | { 40 | return false; 41 | } 42 | 43 | var sFbxFilename = sDtuFilename; 44 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 45 | printToLog("Exported FBX = " + sFbxFilename); 46 | 47 | if (Validate_FBX_file(sFbxFilename) == false) 48 | { 49 | return false; 50 | } 51 | 52 | /* 53 | // check for normal maps 54 | var arrNormalMapList = ["G8FBaseArmsMapB_1004_nm.png", "G8FBaseEyesB_1007_nm.png", "G8FBaseFaceMapB_1001_nm.png", 55 | "G8FBaseLegsMapB_1003_nm.png", "G8FBaseMouthMapB_1005_nm.png", "G8FBaseTorsoMapB_1002_nm.png"]; 56 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 57 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 58 | { 59 | return false; 60 | } 61 | */ 62 | 63 | return true; 64 | } 65 | -------------------------------------------------------------------------------- /Test/TestCases/TC02.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | // Test Case TC2 4 | function Run_TestCase_02(sTestAsset) 5 | { 6 | sExportFilename = ""; 7 | sAssetType = "SkeletalMesh"; 8 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 9 | sExportFolder = "TC02"; 10 | sProductName = ""; 11 | sComponentName = ""; 12 | arrayMorphList = []; 13 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 14 | 15 | printToLog("Running Test Case 2:"); 16 | 17 | // start with clean Daz Studio scene (TC2.1) 18 | Scene.getPrimarySelection().select(false); 19 | var oContentMgr = App.getContentMgr(); 20 | 21 | // load Genesis 8.1 Basic Female (TC2.2) 22 | var sFullPath = oContentMgr.findFile(sTestAsset); 23 | oContentMgr.openFile(sFullPath); 24 | 25 | // Send to Unity (TC2.4) 26 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 27 | var sDtuFilename = sReturnString; 28 | 29 | // check for expected root folder, export folder and export filename (TC2.7) 30 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis81female.dtu") == -1) 31 | { 32 | printToLog("Test Case 2 FAILED: Incorrect output DTU filename"); 33 | return false; 34 | } 35 | 36 | printToLog("Exported DTU = " + sDtuFilename); 37 | if (Validate_DTU_file(sDtuFilename) == false) 38 | { 39 | return false; 40 | } 41 | 42 | var sFbxFilename = sDtuFilename; 43 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 44 | printToLog("Exported FBX = " + sFbxFilename); 45 | 46 | if (Validate_FBX_file(sFbxFilename) == false) 47 | { 48 | return false; 49 | } 50 | 51 | // check for normal maps 52 | /*var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 53 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"]; 54 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 55 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 56 | { 57 | return false; 58 | }*/ 59 | 60 | return true; 61 | } 62 | -------------------------------------------------------------------------------- /Test/TestCases/TC03.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_03(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC03"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | 14 | printToLog("Running Test Case 3:"); 15 | 16 | // start with clean Daz Studio scene (TC3.1) 17 | Scene.clear(); 18 | var oContentMgr = App.getContentMgr(); 19 | 20 | // load Genesis 8.1 Basic Female (TC3.5) 21 | var sFullPath = oContentMgr.findFile(sTestAsset); 22 | oContentMgr.openFile(sFullPath); 23 | 24 | // Rename the node to "CustomSceneLabel" (TC3.7) 25 | var oNode = Scene.getPrimarySelection(); 26 | var sLabel = oNode.getLabel(); 27 | if (sLabel != "Genesis 8.1 Female") 28 | { 29 | printToLog("Test case 3 FAILED: Unable to set up test conditions: sLabel = " + sLabel); 30 | } 31 | //printToLog(sLabel) 32 | sLabel = "CustomSceneLabel"; 33 | oNode.setLabel(sLabel); 34 | 35 | // Send to Unity with default settings (TC3.8) 36 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 37 | var sDtuFilename = sReturnString; 38 | 39 | // check for expected root folder, export folder and export filename (TC3.12) 40 | if (sDtuFilename.lower().find(pathToDUFolder + "/customscenelabel.dtu") == -1) 41 | { 42 | printToLog("Test Case 3 FAILED: Incorrect output DTU filename"); 43 | return false; 44 | } 45 | 46 | printToLog("Exported DTU = " + sDtuFilename); 47 | if (Validate_DTU_file(sDtuFilename) == false) 48 | { 49 | return false; 50 | } 51 | 52 | var sFbxFilename = sDtuFilename; 53 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 54 | printToLog("Exported FBX = " + sFbxFilename); 55 | 56 | if (Validate_FBX_file(sFbxFilename) == false) 57 | { 58 | return false; 59 | } 60 | //check for normal maps 61 | /*var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 62 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"] 63 | var sDTUpath = DzFileInfo(sDtuFilename).path() 64 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 65 | { 66 | return false; 67 | }*/ 68 | 69 | return true; 70 | } 71 | -------------------------------------------------------------------------------- /Test/TestCases/TC04.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_04(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC04"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | 14 | printToLog("Running Test Case 4:"); 15 | 16 | // start with clean Daz Studio scene (TC4.1) 17 | Scene.clear(); 18 | var oContentMgr = App.getContentMgr(); 19 | 20 | // load Genesis 8.1 Basic Female (TC4.5) 21 | var sFullPath = oContentMgr.findFile(sTestAsset); 22 | oContentMgr.openFile(sFullPath); 23 | 24 | // Change Asset name to "CustomAssetName" (4.8) 25 | // ****TODO**** 26 | // Use AssetName UI textbox instead of sExportFilename 27 | sExportFilename = "CustomAssetName"; 28 | 29 | // Send to Unity (4.9) 30 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList) 31 | var sDtuFilename = sReturnString; 32 | 33 | // check for expected root folder, export folder and export filename (TC4.11) 34 | if (sDtuFilename.lower().find(pathToDUFolder + "/customassetname.dtu") == -1) 35 | { 36 | printToLog("Test Case 4 FAILED: Incorrect output DTU filename"); 37 | return false; 38 | } 39 | 40 | printToLog("Exported DTU = " + sDtuFilename); 41 | if (Validate_DTU_file(sDtuFilename) == false) 42 | { 43 | return false; 44 | } 45 | 46 | var sFbxFilename = sDtuFilename; 47 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 48 | printToLog("Exported FBX = " + sFbxFilename); 49 | 50 | if (Validate_FBX_file(sFbxFilename) == false) 51 | { 52 | return false; 53 | } 54 | 55 | // check for normal maps 56 | /*var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 57 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"]; 58 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 59 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 60 | { 61 | return false; 62 | }*/ 63 | 64 | return true; 65 | } 66 | -------------------------------------------------------------------------------- /Test/TestCases/TC05.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_05(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = ""; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | printToLog("Running Test Case 5:"); 13 | 14 | // start with clean Daz Studio scene (TC5.1) 15 | Scene.clear(); 16 | var oContentMgr = App.getContentMgr(); 17 | 18 | // load Genesis 8.1 Basic Female (TC5.5) 19 | var sFullPath = oContentMgr.findFile(sTestAsset); 20 | oContentMgr.openFile(sFullPath); 21 | 22 | // Change Intermediate Folder to "C:/CustomRoot" (5.8) 23 | // ***TODO*** 24 | // Use IntermediateFolder UI textbox instead of sRootFolder 25 | sRootFolder = "C:/CustomRoot"; 26 | 27 | // Send to Unity with default settings (TC5.9) 28 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 29 | var sDtuFilename = sReturnString; 30 | 31 | // check for expected root folder, export folder and export filename (TC5.11) 32 | if (sDtuFilename.lower().find("/customroot/genesis81female/genesis81female.dtu") == -1) 33 | { 34 | printToLog("Test Case 5 FAILED: Incorrect output DTU filename"); 35 | return false; 36 | } 37 | 38 | printToLog("Exported DTU = " + sDtuFilename); 39 | if (Validate_DTU_file(sDtuFilename) == false) 40 | { 41 | return false; 42 | } 43 | 44 | var sFbxFilename = sDtuFilename; 45 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 46 | printToLog("Exported FBX = " + sFbxFilename); 47 | 48 | if (Validate_FBX_file(sFbxFilename) == false) 49 | { 50 | return false; 51 | } 52 | 53 | // check for normal maps 54 | /*var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 55 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"]; 56 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 57 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 58 | { 59 | return false; 60 | }*/ 61 | 62 | return true; 63 | } 64 | -------------------------------------------------------------------------------- /Test/TestCases/TC06.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_06(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC06"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 6:"); 14 | 15 | // start with clean Daz Studio scene (TC6.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Genesis 8.1 Basic Female (TC6.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Select "Bodybuilder" Morph (TC6.8) 24 | arrayMorphList = ["CTRLBodybuilder"]; 25 | 26 | // Send to Unity (TC6.10) 27 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 28 | var sDtuFilename = sReturnString; 29 | 30 | // check for expected root folder, export folder and export filename 31 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis81female.dtu") == -1) 32 | { 33 | printToLog("Test Case 6 FAILED: Incorrect output DTU filename"); 34 | return false; 35 | } 36 | 37 | printToLog("Exported DTU = " + sDtuFilename); 38 | if (Validate_DTU_file(sDtuFilename) == false) 39 | { 40 | return false; 41 | } 42 | 43 | var sFbxFilename = sDtuFilename; 44 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 45 | printToLog("Exported FBX = " + sFbxFilename); 46 | 47 | if (Validate_FBX_file(sFbxFilename) == false) 48 | { 49 | return false; 50 | } 51 | 52 | // check for normal maps 53 | /*var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 54 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"]; 55 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 56 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 57 | { 58 | return false; 59 | }*/ 60 | 61 | return true; 62 | } 63 | -------------------------------------------------------------------------------- /Test/TestCases/TC07.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_07(sTestAsset) 4 | { 5 | var sExportFilename = ""; 6 | var sAssetType = "SkeletalMesh"; 7 | var sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | var sExportFolder = "TC07"; 9 | var sProductName = ""; 10 | var sComponentName = ""; 11 | var arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | var SubdivisionTestLevel = 3; 14 | 15 | printToLog("Running Test Case 7:"); 16 | 17 | // start with clean Daz Studio scene (TC7.1) 18 | Scene.clear(); 19 | var oContentMgr = App.getContentMgr(); 20 | 21 | // load Genesis 8.1 Basic Female (TC7.5) 22 | var sFullPath = oContentMgr.findFile(sTestAsset); 23 | oContentMgr.openFile(sFullPath); 24 | 25 | // Create DzBridgeUnityAction and DzUnityDialog 26 | var oBridge = new DzUnityAction(); 27 | if (oBridge == undefined) 28 | { 29 | printToLog("ERROR: could not instantiate DzUnityAction object."); 30 | return false; 31 | } 32 | 33 | var wBridgeDialog = new DzUnityDialog(); 34 | // var wBridgeDialog = oBridge.getBridgeDialog(); 35 | if (wBridgeDialog == undefined) 36 | { 37 | printToLog("ERROR: could not instantiate DzUnityDialog object."); 38 | return false; 39 | } 40 | var wSubdivDialog = new DzBridgeSubdivisionDialog(wBridgeDialog); 41 | // var wSubdivDialog = oBridge.getSubdivisionDialog(); 42 | if (wSubdivDialog == undefined) 43 | { 44 | printToLog("ERROR: could not instantiate DzBridgeSubdivisionDialog object."); 45 | return false; 46 | } 47 | 48 | oBridge.setBridgeDialog(wBridgeDialog); 49 | oBridge.setSubdivisionDialog(wSubdivDialog); 50 | 51 | wBridgeDialog.wSubdivisionEnabledCheckBox.setChecked(true); 52 | 53 | // Set Subdivision Level 2 (TC7.8) 54 | var nodeSelection = Scene.getPrimarySelection(); 55 | 56 | if (wSubdivDialog != undefined) 57 | { 58 | wSubdivDialog.setSubdivisionLevelByNode(nodeSelection, SubdivisionTestLevel); 59 | } 60 | 61 | // Send to Unity (TC7.10) 62 | var sReturnString = Run_Exporter2(oBridge, sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 63 | var sDtuFilename = sReturnString; 64 | 65 | wBridgeDialog.wSubdivisionEnabledCheckBox.setChecked(false); 66 | 67 | // check for expected root folder, export folder and export filename 68 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis81female.dtu") == -1) 69 | { 70 | printToLog("Test Case 7 FAILED: Incorrect output DTU filename"); 71 | return false; 72 | } 73 | 74 | printToLog("Exported DTU = " + sDtuFilename); 75 | if (Validate_DTU_file(sDtuFilename) == false) 76 | { 77 | return false; 78 | } 79 | var oDTU = Load_DTU_file(sDtuFilename); 80 | printToLog("DTU Subdivision Settings: " + oDTU.Subdivisions[0]["Asset Name"] + ": Subdivision Level=" + oDTU.Subdivisions[0]["Value"]); 81 | if (oDTU.Subdivisions[0]["Value"] != SubdivisionTestLevel) 82 | { 83 | printToLog("Test Case 7 FAILED: Incorrect Subdivision Level set in DTU."); 84 | return false; 85 | } 86 | 87 | var sFbxFilename = sDtuFilename; 88 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 89 | // Check for Fbx HD 90 | var sFbxFilenameHD = sFbxFilename; 91 | printToLog("Exported FBX HD = " + sFbxFilenameHD); 92 | if (Validate_FBX_file(sFbxFilenameHD) == false) 93 | { 94 | return false; 95 | } 96 | // Check for Fbx_base 97 | var sFbxFilenameHD = sFbxFilename; 98 | sFbxFilenameHD = sFbxFilenameHD.replace(".fbx","_base.fbx"); 99 | printToLog("Exported FBX base = " + sFbxFilenameHD); 100 | if (Validate_FBX_file(sFbxFilenameHD) == false) 101 | { 102 | return false; 103 | } 104 | 105 | // check for normal maps 106 | /* var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 107 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"]; 108 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 109 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 110 | { 111 | return false; 112 | }*/ 113 | 114 | return true; 115 | } 116 | 117 | //Run_TestCase_07("/people/genesis 8 female/genesis 8.1 basic female.duf"); 118 | -------------------------------------------------------------------------------- /Test/TestCases/TC08.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | // Test Case TC8 4 | function Run_TestCase_08(sTestAsset) 5 | { 6 | sExportFilename = ""; 7 | sAssetType = "SkeletalMesh"; 8 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 9 | sExportFolder = "TC08"; 10 | sProductName = ""; 11 | sComponentName = ""; 12 | arrayMorphList = []; 13 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 14 | printToLog("Running Test Case 8:"); 15 | 16 | // start with clean Daz Studio scene (TC8.2) 17 | Scene.clear(); 18 | var oContentMgr = App.getContentMgr(); 19 | 20 | // load "QA-Test-Scene-01.duf" (TC8.6) 21 | Scene.loadScene(sTestAsset, DzScene.OpenNew); 22 | 23 | // Send to Unity (TC8.9) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/qatestscene01.dtu") == -1) 29 | { 30 | printToLog("Test Case 8 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | // check for normal maps 50 | /*var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", 51 | "G8_1FBaseHeadMapB_1002_nm.png", "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"]; 52 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 53 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 54 | { 55 | return false; 56 | }*/ 57 | 58 | return true; 59 | } 60 | -------------------------------------------------------------------------------- /Test/TestCases/TC09.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_09(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC09"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 9:") 14 | 15 | // start with clean Daz Studio scene (TC9.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Victoria 8.1 (TC9.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Send to Unity with default settings (TC9.6) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC9.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/victoria81.dtu") == -1) 29 | { 30 | printToLog("Test Case 9 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | // Confirm ExportTextures folder was not generated 50 | sExportTexturePath = DzFileInfo(sDtuFilename).path() + "/" + "ExportTextures"; 51 | if (DzFileInfo(sExportTexturePath).exists()) 52 | { 53 | printToLog("Test Case 9 FAILED: ExportTexture subfolder was unexpectedly generated."); 54 | return false; 55 | } 56 | 57 | return true; 58 | } 59 | -------------------------------------------------------------------------------- /Test/TestCases/TC10.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_10(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC10"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 10:"); 14 | 15 | // start with clean Daz Studio scene (TC10.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Victoria 8.1 (TC10.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // load LIE textures (TC10.6) 24 | var sTattooAsset = "/people/genesis 8 female/characters/victoria 8.1/materials/iray/tattoos/victoria 8.1 tattoo all - add.duf"; 25 | var sTatooPath = oContentMgr.findFile(sTattooAsset); 26 | oContentMgr.openFile(sTatooPath); 27 | 28 | // Send to Unreal (TC10.10) 29 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 30 | var sDtuFilename = sReturnString; 31 | 32 | // check for expected root folder, export folder and export filename (TC10.14) 33 | if (sDtuFilename.lower().find(pathToDUFolder + "/victoria81.dtu") == -1) 34 | { 35 | printToLog("Test Case 10 FAILED: Incorrect output DTU filename"); 36 | return false; 37 | } 38 | 39 | printToLog("Exported DTU = " + sDtuFilename); 40 | if (Validate_DTU_file(sDtuFilename) == false) 41 | { 42 | return false; 43 | } 44 | 45 | var sFbxFilename = sDtuFilename; 46 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 47 | printToLog("Exported FBX = " + sFbxFilename); 48 | 49 | if (Validate_FBX_file(sFbxFilename) == false) 50 | { 51 | return false; 52 | } 53 | 54 | // Confirm ExportTextures folder was generated (TC10.14) 55 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 56 | var aLIETextureList = ["d10.png", "d11.png", "d12.png", "d13.png", "d14.png", "d15.png", "d16.png", "d17.png"]; 57 | var nNumTexturesToFind = aLIETextureList.length; 58 | var sNameFilters = ["d*.png"]; 59 | if (Validate_LIE_Textures(nNumTexturesToFind, sNameFilters, sDTUpath) == false) 60 | { 61 | return false; 62 | } 63 | 64 | return true; 65 | } 66 | -------------------------------------------------------------------------------- /Test/TestCases/TC11.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_11(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC11"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 11:"); 14 | 15 | // start with clean Daz Studio scene (TC11.1) 16 | Scene.clear() 17 | var oContentMgr = App.getContentMgr() 18 | 19 | // load Genesis 8 Basic Male (TC11.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset) 21 | oContentMgr.openFile(sFullPath) 22 | 23 | // Send to Unity (TC11.8) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList) 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC11.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis8male.dtu") == -1) 29 | { 30 | printToLog("Test Case 11 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | // check for normal maps 49 | /*var arrNormalMapList = ["G8MBaseArmsMapB_1004_nm.png", "G8MBaseEyesMapB_1007_nm.png", 50 | "G8MBaseFaceMapB01_1001_nm.png", "G8MBaseLegsMapB_1003_nm.png", 51 | "G8MBaseMouthMapB_1005_nm.png", "G8MBaseTorsoMapB_1002_nm.png"]; 52 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 53 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 54 | { 55 | return false; 56 | }*/ 57 | return true; 58 | } 59 | -------------------------------------------------------------------------------- /Test/TestCases/TC12.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_12(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC12"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 12:") 14 | 15 | // start with clean Daz Studio scene (TC12.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Genesis 8.1 Basic Male (TC12.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Send to Unity (TC12.8) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC12.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis81male.dtu") == -1) 29 | { 30 | printToLog("Test Case 12 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | //normal maps 50 | /*var arrNormalMapList = ["G8_1MBaseArmsMapB_1005_nm.png", "G8_1MBaseBodyMapB_1003_nm.png", 51 | "G8_1MBaseFaceMapB01_1001_nm.png", "G8_1MBaseHeadMapB_1002_nm.png", 52 | "G8_1MBaseLegsMapB_1004_nm.png"]; 53 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 54 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 55 | { 56 | return false; 57 | }*/ 58 | 59 | return true; 60 | } 61 | -------------------------------------------------------------------------------- /Test/TestCases/TC13.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_13(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC13"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 13:"); 14 | 15 | // start with clean Daz Studio scene (TC13.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Genesis 3 Basic Female (TC13.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Send to Unity (TC13.8) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC13.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis3female.dtu") == -1) 29 | { 30 | printToLog("Test Case 14 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | /* var arrNormalMapList = ["RyJeane_armsB_1004_nm.png", "RyJeane_eyesB_1007_nm.png", "RyJeane_faceB_1001_nm.png", 50 | "RyJeane_legsB_1003_nm.png", "RyJeane_mouthB_1005_nm.png", "RyJeane_torsoB_1002_nm.png"]; 51 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 52 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 53 | { 54 | return false; 55 | }*/ 56 | 57 | return true; 58 | } 59 | -------------------------------------------------------------------------------- /Test/TestCases/TC14.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_14(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC14"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 14:"); 14 | 15 | // start with clean Daz Studio scene (TC14.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Genesis 3 Basic Male (TC14.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Send to Unity (TC14.8) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC14.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis3male.dtu") == -1) 29 | { 30 | printToLog("Test Case 13 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | //normal maps 50 | /* var arrNormalMapList = ["RyEddie_armsB_1004_nm.png", "RyEddie_eyesB_1007_nm.png", "RyEddie_faceB_1001_nm.png", 51 | "RyEddie_legsB_1003_nm.png", "RyEddie_mouthB_1005_nm.png", "RyEddie_torsoB_1002_nm.png"]; 52 | var sDTUpath = DzFileInfo(sDtuFilename).path() 53 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 54 | { 55 | return false; 56 | }*/ 57 | 58 | return true; 59 | } 60 | -------------------------------------------------------------------------------- /Test/TestCases/TC15.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_15(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC15"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 15:"); 14 | 15 | // start with clean Daz Studio scene (TC15.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Genesis 2 Basic Female (TC15.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Send to Unity (TC15.8) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC15.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis2female.dtu") == -1) 29 | { 30 | printToLog("Test Case 15 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | //normal maps 50 | /* var arrNormalMapList = ["V5BreeEyesB_nm.png", "V5BreeHeadB_nm.png", "V5BreeInMouthB_nm.png", 51 | "V5BreeInMouthB_nm.png", "V5BreeTorsoB_nm.png"]; 52 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 53 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 54 | { 55 | return false; 56 | }*/ 57 | return true; 58 | } 59 | -------------------------------------------------------------------------------- /Test/TestCases/TC16.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | 3 | function Run_TestCase_16(sTestAsset) 4 | { 5 | sExportFilename = ""; 6 | sAssetType = "SkeletalMesh"; 7 | sRootFolder = DzDir("").homePath() + "/Documents/DazToUnity"; 8 | sExportFolder = "TC16"; 9 | sProductName = ""; 10 | sComponentName = ""; 11 | arrayMorphList = []; 12 | pathToDUFolder = "/documents/daztounity/" + sExportFolder.lower(); 13 | printToLog("Running Test Case 16:"); 14 | 15 | // start with clean Daz Studio scene (TC16.1) 16 | Scene.clear(); 17 | var oContentMgr = App.getContentMgr(); 18 | 19 | // load Genesis 2 Male (TC16.5) 20 | var sFullPath = oContentMgr.findFile(sTestAsset); 21 | oContentMgr.openFile(sFullPath); 22 | 23 | // Send to Unity (TC16.8) 24 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList); 25 | var sDtuFilename = sReturnString; 26 | 27 | // check for expected root folder, export folder and export filename (TC16.10) 28 | if (sDtuFilename.lower().find(pathToDUFolder + "/genesis2male.dtu") == -1) 29 | { 30 | printToLog("Test Case 16 FAILED: Incorrect output DTU filename"); 31 | return false; 32 | } 33 | 34 | printToLog("Exported DTU = " + sDtuFilename); 35 | if (Validate_DTU_file(sDtuFilename) == false) 36 | { 37 | return false; 38 | } 39 | 40 | var sFbxFilename = sDtuFilename; 41 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 42 | printToLog("Exported FBX = " + sFbxFilename); 43 | 44 | if (Validate_FBX_file(sFbxFilename) == false) 45 | { 46 | return false; 47 | } 48 | 49 | var sDTUpath = DzFileInfo(sDtuFilename).path(); 50 | // L.I.E. texture 51 | var nNumTexturesToFind = 1; 52 | var sNameFilters = ["d*.png"]; 53 | if (Validate_LIE_Textures(nNumTexturesToFind, sNameFilters, sDTUpath) == false) 54 | { 55 | return false; 56 | } 57 | 58 | // Normal maps 59 | /* var arrNormalMapList = ["M5PhillipEyesBS_nm.png", "M5PhillipFace01B_nm.png", 60 | "M5PhillipLimbs01B_nm.png", "M5PhillipMouthBS_nm.png", "M5PhillipTorso01B_nm.png"] 61 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 62 | { 63 | return false; 64 | } 65 | */ 66 | return true; 67 | } 68 | -------------------------------------------------------------------------------- /Test/TestCases/_TC1001.dsa: -------------------------------------------------------------------------------- 1 | // Script-Only Test Case 2 | function Run_TestCase_1001(sTestAsset) 3 | { 4 | sExportFilename = "CustomAsset" 5 | sAssetType = "SkeletalMesh" 6 | sRootFolder = "C:/CustomRoot" 7 | sExportFolder = "CustomFolder" 8 | sProductName = "" 9 | sComponentName = "" 10 | arrayMorphList = [] 11 | 12 | printToLog("Running Test Case 1001:") 13 | 14 | Scene.clear() 15 | var oContentMgr = App.getContentMgr() 16 | var sFullPath = oContentMgr.findFile(sTestAsset) 17 | oContentMgr.openFile(sFullPath) 18 | 19 | var sReturnString = Run_Exporter(sExportFilename, sAssetType, sRootFolder, sExportFolder, sProductName, sComponentName, arrayMorphList) 20 | 21 | var sDtuFilename = sReturnString 22 | printToLog("Exported DTU = " + sDtuFilename); 23 | if (Validate_DTU_file(sDtuFilename) == false) 24 | { 25 | return false; 26 | } 27 | 28 | var sFbxFilename = sDtuFilename; 29 | sFbxFilename = sFbxFilename.replace(".dtu",".fbx"); 30 | printToLog("Exported FBX = " + sFbxFilename); 31 | 32 | if (Validate_FBX_file(sFbxFilename) == false) 33 | { 34 | return false; 35 | } 36 | var arrNormalMapList = ["G8_1FBaseBodyMapB_1003_nm.png", "G8_1FBaseFaceMapB_1001_nm.png", "G8_1FBaseHeadMapB_1002_nm.png", 37 | "G8FBaseArmsMapB_1004_nm.png", "G8FBaseLegsMapB_1003_nm.png"] 38 | var sDTUpath = DzFileInfo(sDtuFilename).path() 39 | if (Validate_NormalMaps(arrNormalMapList, sDTUpath) == false) 40 | { 41 | return false; 42 | } 43 | 44 | return true; 45 | } 46 | -------------------------------------------------------------------------------- /Test/TestCases/test_runner--single.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | var includeDir_oFILE = new DzFile( getScriptFileName() ); 3 | //var sIncludePath = includeDir_oFILE.path(); 4 | var sIncludePath = "C:/GitHub/DazToUnity-daz3d/Test/TestCases/" 5 | 6 | Global_sOutputPath = "C:/GitHub/DazToUnity-daz3d/Test/Results/"; 7 | 8 | include(sIncludePath + "TC01.dsa") 9 | include(sIncludePath + "TC02.dsa") 10 | include(sIncludePath + "TC03.dsa") 11 | include(sIncludePath + "TC04.dsa") 12 | include(sIncludePath + "TC05.dsa") 13 | include(sIncludePath + "TC06.dsa") 14 | include(sIncludePath + "TC07.dsa") 15 | include(sIncludePath + "TC08.dsa") 16 | include(sIncludePath + "TC09.dsa") 17 | include(sIncludePath + "TC10.dsa") 18 | include(sIncludePath + "TC11.dsa") 19 | include(sIncludePath + "TC12.dsa") 20 | include(sIncludePath + "TC13.dsa") 21 | include(sIncludePath + "TC14.dsa") 22 | include(sIncludePath + "TC15.dsa") 23 | include(sIncludePath + "TC16.dsa") 24 | 25 | include(sIncludePath + "QA_Utility_Functions.dsa") 26 | 27 | function main() 28 | { 29 | var aTCResults = new Array(16); 30 | 31 | clearLog(); 32 | var i=0; 33 | /* 34 | aTCResults[i] = logToJson("TC01", Run_TestCase_01("/people/genesis 8 female/genesis 8 basic female.duf")); 35 | i++; 36 | aTCResults[i] = logToJson("TC02", Run_TestCase_02("/people/genesis 8 female/genesis 8.1 basic female.duf")); 37 | i++; 38 | aTCResults[i] = logToJson("TC03", Run_TestCase_03("/people/genesis 8 female/genesis 8.1 basic female.duf")); 39 | i++; 40 | aTCResults[i] = logToJson("TC04", Run_TestCase_04("/people/genesis 8 female/genesis 8.1 basic female.duf")); 41 | i++; 42 | aTCResults[i] = logToJson("TC05", Run_TestCase_05("/people/genesis 8 female/genesis 8.1 basic female.duf")); 43 | i++; 44 | aTCResults[i] = logToJson("TC06", Run_TestCase_06("/people/genesis 8 female/genesis 8.1 basic female.duf")); 45 | i++; 46 | aTCResults[i] = logToJson("TC07", Run_TestCase_07("/people/genesis 8 female/genesis 8.1 basic female.duf")); 47 | i++; 48 | var sTestScene = DzFileInfo(DzFileInfo(sIncludePath).path()).path() + "/" + "QA-Test-Scene-01.duf" ; 49 | aTCResults[i] = logToJson("TC08", Run_TestCase_08(sTestScene)); 50 | i++; 51 | aTCResults[i] = logToJson("TC09", Run_TestCase_09("/people/genesis 8 female/characters/victoria 8.1.duf")); 52 | i++; 53 | aTCResults[i] = logToJson("TC10", Run_TestCase_10("/people/genesis 8 female/characters/victoria 8.1.duf")); 54 | i++; 55 | aTCResults[i] = logToJson("TC11", Run_TestCase_11("/people/genesis 8 male/genesis 8 basic male.duf")); 56 | i++; 57 | aTCResults[i] = logToJson("TC12", Run_TestCase_12("people/genesis 8 male/genesis 8.1 basic male.duf")); 58 | i++; 59 | aTCResults[i] = logToJson("TC13", Run_TestCase_13("people/genesis 3 female/genesis 3 female.duf")); 60 | i++; 61 | aTCResults[i] = logToJson("TC14", Run_TestCase_14("people/genesis 3 male/genesis 3 male.duf")); 62 | i++; 63 | aTCResults[i] = logToJson("TC15", Run_TestCase_15("people/genesis 2 female/genesis 2 base female.duf")); 64 | i++; 65 | aTCResults[i] = logToJson("TC16", Run_TestCase_16("people/genesis 2 male/genesis 2 base male.duf")); 66 | */ 67 | 68 | // aTCResults[0] = Run_TestCase_01("/people/genesis 8 female/genesis 8 basic female.duf"); 69 | // aTCResults[6] = Run_TestCase_07("/people/genesis 8 female/genesis 8.1 basic female.duf"); 70 | aTCResults[9] = Run_TestCase_10("/people/genesis 8 female/characters/victoria 8.1.duf"); 71 | aTCResults[15] = Run_TestCase_16("people/genesis 2 male/genesis 2 base male.duf"); 72 | 73 | 74 | printToLog("\n"); 75 | printToLog("======================="); 76 | printToLog("Automated Test Results:"); 77 | printToLog("======================="); 78 | printToLog("\n"); 79 | for (var i=0; i < aTCResults.length; i++) 80 | { 81 | if (aTCResults[i]) 82 | { 83 | printToLog("Test Case " + (i+1) + ": PASSED"); 84 | } 85 | else 86 | { 87 | printToLog("Test Case " + (i+1) + ": **FAILED**"); 88 | } 89 | } 90 | 91 | } 92 | 93 | main(); 94 | -------------------------------------------------------------------------------- /Test/TestCases/test_runner.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | var includeDir_oFILE = new DzFile( getScriptFileName() ); 3 | //var sIncludePath = includeDir_oFILE.path(); 4 | var sIncludePath = "C:/GitHub/DazToUnity-daz3d/Test/TestCases/" 5 | 6 | Global_sOutputPath = "C:/GitHub/DazToUnity-daz3d/Test/Results/"; 7 | 8 | include(sIncludePath + "TC01.dsa") 9 | include(sIncludePath + "TC02.dsa") 10 | include(sIncludePath + "TC03.dsa") 11 | include(sIncludePath + "TC04.dsa") 12 | include(sIncludePath + "TC05.dsa") 13 | include(sIncludePath + "TC06.dsa") 14 | include(sIncludePath + "TC07.dsa") 15 | include(sIncludePath + "TC08.dsa") 16 | include(sIncludePath + "TC09.dsa") 17 | include(sIncludePath + "TC10.dsa") 18 | include(sIncludePath + "TC11.dsa") 19 | include(sIncludePath + "TC12.dsa") 20 | include(sIncludePath + "TC13.dsa") 21 | include(sIncludePath + "TC14.dsa") 22 | include(sIncludePath + "TC15.dsa") 23 | include(sIncludePath + "TC16.dsa") 24 | 25 | include(sIncludePath + "QA_Utility_Functions.dsa") 26 | 27 | function main() 28 | { 29 | var aTCResults = new Array(16); 30 | 31 | // perform a "priming" run 32 | Run_TestCase_03("/people/genesis 8 female/genesis 8.1 basic female.duf"); 33 | 34 | clearLog(); 35 | clearJson(); 36 | var i=0; 37 | aTCResults[i] = logToJson("TC01", Run_TestCase_01("/people/genesis 8 female/genesis 8 basic female.duf")); 38 | i++; 39 | aTCResults[i] = logToJson("TC02", Run_TestCase_02("/people/genesis 8 female/genesis 8.1 basic female.duf")); 40 | i++; 41 | aTCResults[i] = logToJson("TC03", Run_TestCase_03("/people/genesis 8 female/genesis 8.1 basic female.duf")); 42 | i++; 43 | aTCResults[i] = logToJson("TC04", Run_TestCase_04("/people/genesis 8 female/genesis 8.1 basic female.duf")); 44 | i++; 45 | aTCResults[i] = logToJson("TC05", Run_TestCase_05("/people/genesis 8 female/genesis 8.1 basic female.duf")); 46 | i++; 47 | aTCResults[i] = logToJson("TC06", Run_TestCase_06("/people/genesis 8 female/genesis 8.1 basic female.duf")); 48 | i++; 49 | aTCResults[i] = logToJson("TC07", Run_TestCase_07("/people/genesis 8 female/genesis 8.1 basic female.duf")); 50 | i++; 51 | var sTestScene = DzFileInfo(DzFileInfo(sIncludePath).path()).path() + "/" + "QA-Test-Scene-01.duf" ; 52 | aTCResults[i] = logToJson("TC08", Run_TestCase_08(sTestScene)); 53 | i++; 54 | aTCResults[i] = logToJson("TC09", Run_TestCase_09("/people/genesis 8 female/characters/victoria 8.1.duf")); 55 | i++; 56 | aTCResults[i] = logToJson("TC10", Run_TestCase_10("/people/genesis 8 female/characters/victoria 8.1.duf")); 57 | i++; 58 | aTCResults[i] = logToJson("TC11", Run_TestCase_11("/people/genesis 8 male/genesis 8 basic male.duf")); 59 | i++; 60 | aTCResults[i] = logToJson("TC12", Run_TestCase_12("people/genesis 8 male/genesis 8.1 basic male.duf")); 61 | i++; 62 | aTCResults[i] = logToJson("TC13", Run_TestCase_13("people/genesis 3 female/genesis 3 female.duf")); 63 | i++; 64 | aTCResults[i] = logToJson("TC14", Run_TestCase_14("people/genesis 3 male/genesis 3 male.duf")); 65 | i++; 66 | aTCResults[i] = logToJson("TC15", Run_TestCase_15("people/genesis 2 female/genesis 2 base female.duf")); 67 | i++; 68 | aTCResults[i] = logToJson("TC16", Run_TestCase_16("people/genesis 2 male/genesis 2 base male.duf")); 69 | 70 | clearLog(); 71 | printToLog("\n"); 72 | printToLog("======================="); 73 | printToLog("Automated Test Results:"); 74 | printToLog("======================="); 75 | printToLog("\n"); 76 | for (var i=0; i < aTCResults.length; i++) 77 | { 78 | if (aTCResults[i]) 79 | { 80 | printToLog("Test Case " + (i+1) + ": PASSED"); 81 | } 82 | else 83 | { 84 | printToLog("Test Case " + (i+1) + ": **FAILED**"); 85 | } 86 | } 87 | writeLogToReport(); 88 | clearLog(); 89 | 90 | } 91 | 92 | main(); 93 | -------------------------------------------------------------------------------- /Test/UnitTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CMAKE_AUTOMOC ON) 2 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 3 | 4 | set(COMMON_LIB_INCLUDE_DIR ${COMMON_LIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) 5 | set(COMMON_LIB_INCLUDE_DIR ${COMMON_LIB_INCLUDE_DIR} PARENT_SCOPE) 6 | 7 | include_directories(${COMMON_LIB_INCLUDE_DIR}) 8 | 9 | set(QA_SRCS 10 | ${CMAKE_CURRENT_SOURCE_DIR}/UnitTest_DzUnityAction.cpp 11 | ${CMAKE_CURRENT_SOURCE_DIR}/UnitTest_DzUnityAction.h 12 | ${CMAKE_CURRENT_SOURCE_DIR}/UnitTest_DzUnityDialog.cpp 13 | ${CMAKE_CURRENT_SOURCE_DIR}/UnitTest_DzUnityDialog.h 14 | ) 15 | set(QA_SRCS ${QA_SRCS} PARENT_SCOPE) -------------------------------------------------------------------------------- /Test/UnitTests/RunUnitTests.dsa: -------------------------------------------------------------------------------- 1 | // DAZ Studio version 4.16.0.3 filetype DAZ Script 2 | var includeDir_oFILE = new DzFile( getScriptFileName() ); 3 | //var sIncludePath = includeDir_oFILE.path(); 4 | var sIncludePath = "C:/GitHub/dzBridge-Unity/Test/UnitTests/" 5 | var sOutputPath = "C:/GitHub/dzBridge-Unity/Test/Results/"; 6 | 7 | /* 8 | obj = new UnitTest_DzBridgeScriptableAction(); 9 | result = false; 10 | result = obj.runUnitTests(); 11 | print("Unit Test Results (DzBridgeAction): " + result); 12 | obj.writeAllTestResults(sOutputPath); 13 | 14 | obj = new UnitTest_DzBridgeDialog(); 15 | result = false; 16 | result = obj.runUnitTests(); 17 | print("Unit Test Results (DzBridgeDialog): " + result); 18 | obj.writeAllTestResults(sOutputPath); 19 | 20 | obj = new UnitTest_DzBridgeMorphSelectionDialog(); 21 | result = false; 22 | result = obj.runUnitTests(); 23 | print("Unit Test Results (DzBridgeMorphSelectionDialog): " + result); 24 | obj.writeAllTestResults(sOutputPath); 25 | 26 | obj = new UnitTest_DzBridgeSubdivisionDialog(); 27 | result = false; 28 | result = obj.runUnitTests(); 29 | print("Unit Test Results (DzBridgeSubdivisionDialog): " + result); 30 | obj.writeAllTestResults(sOutputPath); 31 | */ 32 | 33 | obj = new UnitTest_DzUnityAction(); 34 | result = false; 35 | result = obj.runUnitTests(); 36 | print("Unit Test Results (DzBridgeUnityAction): " + result); 37 | obj.writeAllTestResults(sOutputPath); 38 | 39 | obj = new UnitTest_DzUnityDialog(); 40 | result = false; 41 | result = obj.runUnitTests(); 42 | print("Unit Test Results (DzBridgeUnityDialog): " + result); 43 | obj.writeAllTestResults(sOutputPath); 44 | 45 | -------------------------------------------------------------------------------- /Test/UnitTests/UnitTest_DzUnityAction.cpp: -------------------------------------------------------------------------------- 1 | #ifdef UNITTEST_DZBRIDGE 2 | 3 | #include "UnitTest_DzUnityAction.h" 4 | #include "DzUnityAction.h" 5 | 6 | 7 | UnitTest_DzUnityAction::UnitTest_DzUnityAction() 8 | { 9 | m_testObject = (QObject*) new DzUnityAction(); 10 | } 11 | 12 | bool UnitTest_DzUnityAction::runUnitTests() 13 | { 14 | RUNTEST(_DzBridgeUnityAction); 15 | RUNTEST(setInstallUnityFiles); 16 | RUNTEST(getInstallUnityFiles); 17 | RUNTEST(executeAction); 18 | RUNTEST(createUI); 19 | RUNTEST(writeConfiguration); 20 | RUNTEST(setExportOptions); 21 | RUNTEST(createUnityFiles); 22 | RUNTEST(readGuiRootFolder); 23 | 24 | return true; 25 | } 26 | 27 | bool UnitTest_DzUnityAction::_DzBridgeUnityAction(UnitTest::TestResult* testResult) 28 | { 29 | bool bResult = true; 30 | TRY_METHODCALL(new DzUnityAction()); 31 | return bResult; 32 | } 33 | 34 | bool UnitTest_DzUnityAction::setInstallUnityFiles(UnitTest::TestResult* testResult) 35 | { 36 | bool bResult = true; 37 | TRY_METHODCALL(qobject_cast(m_testObject)->setInstallUnityFiles(false)); 38 | return bResult; 39 | } 40 | 41 | bool UnitTest_DzUnityAction::getInstallUnityFiles(UnitTest::TestResult* testResult) 42 | { 43 | bool bResult = true; 44 | TRY_METHODCALL(qobject_cast(m_testObject)->getInstallUnityFiles()); 45 | return bResult; 46 | } 47 | 48 | bool UnitTest_DzUnityAction::executeAction(UnitTest::TestResult* testResult) 49 | { 50 | bool bResult = true; 51 | TRY_METHODCALL(qobject_cast(m_testObject)->executeAction()); 52 | return bResult; 53 | } 54 | 55 | bool UnitTest_DzUnityAction::createUI(UnitTest::TestResult* testResult) 56 | { 57 | bool bResult = true; 58 | TRY_METHODCALL(qobject_cast(m_testObject)->createUI()); 59 | return bResult; 60 | } 61 | 62 | bool UnitTest_DzUnityAction::writeConfiguration(UnitTest::TestResult* testResult) 63 | { 64 | bool bResult = true; 65 | TRY_METHODCALL(qobject_cast(m_testObject)->writeConfiguration()); 66 | return bResult; 67 | } 68 | 69 | bool UnitTest_DzUnityAction::setExportOptions(UnitTest::TestResult* testResult) 70 | { 71 | bool bResult = true; 72 | DzFileIOSettings arg; 73 | TRY_METHODCALL(qobject_cast(m_testObject)->setExportOptions(arg)); 74 | return bResult; 75 | } 76 | 77 | bool UnitTest_DzUnityAction::createUnityFiles(UnitTest::TestResult* testResult) 78 | { 79 | bool bResult = true; 80 | TRY_METHODCALL(qobject_cast(m_testObject)->createUnityFiles()); 81 | return bResult; 82 | } 83 | 84 | bool UnitTest_DzUnityAction::readGuiRootFolder(UnitTest::TestResult* testResult) 85 | { 86 | bool bResult = true; 87 | TRY_METHODCALL(qobject_cast(m_testObject)->readGuiRootFolder()); 88 | return bResult; 89 | } 90 | 91 | 92 | #include "moc_UnitTest_DzUnityAction.cpp" 93 | 94 | #endif -------------------------------------------------------------------------------- /Test/UnitTests/UnitTest_DzUnityAction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef UNITTEST_DZBRIDGE 3 | 4 | #include 5 | #include 6 | 7 | class UnitTest_DzUnityAction : public UnitTest { 8 | Q_OBJECT 9 | public: 10 | UnitTest_DzUnityAction(); 11 | bool runUnitTests(); 12 | 13 | private: 14 | bool _DzBridgeUnityAction(UnitTest::TestResult* testResult); 15 | bool setInstallUnityFiles(UnitTest::TestResult* testResult); 16 | bool getInstallUnityFiles(UnitTest::TestResult* testResult); 17 | bool executeAction(UnitTest::TestResult* testResult); 18 | bool createUI(UnitTest::TestResult* testResult); 19 | bool writeConfiguration(UnitTest::TestResult* testResult); 20 | bool setExportOptions(UnitTest::TestResult* testResult); 21 | bool createUnityFiles(UnitTest::TestResult* testResult); 22 | bool readGuiRootFolder(UnitTest::TestResult* testResult); 23 | 24 | }; 25 | 26 | #endif -------------------------------------------------------------------------------- /Test/UnitTests/UnitTest_DzUnityDialog.cpp: -------------------------------------------------------------------------------- 1 | #ifdef UNITTEST_DZBRIDGE 2 | 3 | #include "UnitTest_DzUnityDialog.h" 4 | #include "DzUnityDialog.h" 5 | 6 | 7 | UnitTest_DzUnityDialog::UnitTest_DzUnityDialog() 8 | { 9 | m_testObject = (QObject*) new DzUnityDialog(); 10 | } 11 | 12 | bool UnitTest_DzUnityDialog::runUnitTests() 13 | { 14 | RUNTEST(_DzBridgeUnityDialog); 15 | RUNTEST(getAssetsFolderEdit); 16 | RUNTEST(resetToDefaults); 17 | RUNTEST(loadSavedSettings); 18 | RUNTEST(HandleSelectAssetsFolderButton); 19 | RUNTEST(HandleInstallUnityFilesCheckBoxChange); 20 | RUNTEST(HandleAssetTypeComboChange); 21 | RUNTEST(HandleAssetFolderChanged); 22 | 23 | return true; 24 | } 25 | 26 | bool UnitTest_DzUnityDialog::_DzBridgeUnityDialog(UnitTest::TestResult* testResult) 27 | { 28 | bool bResult = true; 29 | TRY_METHODCALL(new DzUnityDialog()); 30 | return bResult; 31 | } 32 | 33 | bool UnitTest_DzUnityDialog::getAssetsFolderEdit(UnitTest::TestResult* testResult) 34 | { 35 | bool bResult = true; 36 | TRY_METHODCALL(qobject_cast(m_testObject)->getAssetsFolderEdit()); 37 | return bResult; 38 | } 39 | 40 | bool UnitTest_DzUnityDialog::resetToDefaults(UnitTest::TestResult* testResult) 41 | { 42 | bool bResult = true; 43 | TRY_METHODCALL(qobject_cast(m_testObject)->resetToDefaults()); 44 | return bResult; 45 | } 46 | 47 | bool UnitTest_DzUnityDialog::loadSavedSettings(UnitTest::TestResult* testResult) 48 | { 49 | bool bResult = true; 50 | TRY_METHODCALL(qobject_cast(m_testObject)->loadSavedSettings()); 51 | return bResult; 52 | } 53 | 54 | bool UnitTest_DzUnityDialog::HandleSelectAssetsFolderButton(UnitTest::TestResult* testResult) 55 | { 56 | bool bResult = true; 57 | TRY_METHODCALL(qobject_cast(m_testObject)->HandleSelectAssetsFolderButton()); 58 | return bResult; 59 | } 60 | 61 | bool UnitTest_DzUnityDialog::HandleInstallUnityFilesCheckBoxChange(UnitTest::TestResult* testResult) 62 | { 63 | bool bResult = true; 64 | TRY_METHODCALL(qobject_cast(m_testObject)->HandleInstallUnityFilesCheckBoxChange(0)); 65 | return bResult; 66 | } 67 | 68 | bool UnitTest_DzUnityDialog::HandleAssetTypeComboChange(UnitTest::TestResult* testResult) 69 | { 70 | bool bResult = true; 71 | TRY_METHODCALL(qobject_cast(m_testObject)->HandleAssetTypeComboChange(0)); 72 | return bResult; 73 | } 74 | 75 | bool UnitTest_DzUnityDialog::HandleAssetFolderChanged(UnitTest::TestResult* testResult) 76 | { 77 | bool bResult = true; 78 | TRY_METHODCALL(qobject_cast(m_testObject)->HandleAssetFolderChanged("")); 79 | return bResult; 80 | } 81 | 82 | 83 | 84 | #include "moc_UnitTest_DzUnityDialog.cpp" 85 | #endif -------------------------------------------------------------------------------- /Test/UnitTests/UnitTest_DzUnityDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef UNITTEST_DZBRIDGE 3 | 4 | #include 5 | #include "UnitTest.h" 6 | 7 | class UnitTest_DzUnityDialog : public UnitTest { 8 | Q_OBJECT 9 | public: 10 | UnitTest_DzUnityDialog(); 11 | bool runUnitTests(); 12 | 13 | private: 14 | bool _DzBridgeUnityDialog(UnitTest::TestResult* testResult); 15 | bool getAssetsFolderEdit(UnitTest::TestResult* testResult); 16 | bool resetToDefaults(UnitTest::TestResult* testResult); 17 | bool loadSavedSettings(UnitTest::TestResult* testResult); 18 | bool HandleSelectAssetsFolderButton(UnitTest::TestResult* testResult); 19 | bool HandleInstallUnityFilesCheckBoxChange(UnitTest::TestResult* testResult); 20 | bool HandleAssetTypeComboChange(UnitTest::TestResult* testResult); 21 | bool HandleAssetFolderChanged(UnitTest::TestResult* testResult); 22 | 23 | }; 24 | 25 | 26 | #endif -------------------------------------------------------------------------------- /UnityPlugin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Daz To Unity Change Log: 2 | ================================= 3 | Version 2023.1.1.11: 4 | - Integration with latest Daz Bridge Library v1.1 5 | 6 | Version 2023.1.0.9: 7 | - PBRSkin Makeup support 8 | - Improved Geografts (duplicate removal) 9 | 10 | Version 2022.2.4.8: 11 | - Bugfixed URP shader code 12 | - Updated to latest Daz Bridge Library v2.2 13 | - Fixed morph undo bug (distorted faces on export) 14 | - Improved Geograft material support 15 | - Preliminary steps for Geograft Morph support (exports blendshapes) 16 | 17 | Version 2022.1.3.7: 18 | - New version numbering based on Year-Revision-Bugfix 19 | - Updated and integrated latest updates to Daz Bridge Library 20 | - Improved Morph and Subdivision Selection dialogs 21 | - Improved Unity Plugin Installer 22 | - DTU updates to support future add-ons such as auto-JCM 23 | 24 | Version 2.0: 25 | - Many uDTU features now merged with official Daz To Unity bridge, including: 26 | - Mac support, 27 | - Animation support, 28 | - Improved HDRP Shaders, 29 | - New URP Shader support, 30 | - Built-In Standard Shader support, 31 | - Genesis 8.1 and PBRSkin support, 32 | - Improved Subdivision support, 33 | - Improved Emission support. 34 | 35 | Version 1.3 alpha 4: 36 | - Fixed assembly definition for Scripts/Editor folder. Projects should now properly build. 37 | - Fixed error when importing with dForce Support enabled. 38 | 39 | Version 1.3 alpha 3: 40 | - You will need to delete any existing DTU plugin from "Assets/Daz3D" folder. You can save your previous exported assets. 41 | - UseNewShaders is now enabled by default. 42 | - Added improved Hair shaders for HDRP and URP. 43 | - Alpha-value Bugfixes to Hair shaders: OOT, OmUberSurface. 44 | 45 | Version 1.3 alpha 1: 46 | - The Unity Package Source Code is now separated from the Daz Studio Plugin Source Code Repository. 47 | 48 | Version 1.2: 49 | - Bugfixed crash when exporting subdivisions for more than one figure in a single session. 50 | - Initial refactoring for planned open-source FBX and OpenSubdiv Daz-plugins. 51 | - Updated CMakeFiles for more convenient building of FBX/OpenSubdiv/Mac support. 52 | - Full MacOS support on versions 10.9 to 11. 53 | - (Baked) Subdivision support, up to Subdivision Level 4. Based on https://github.com/cocktailboy/DazToRuntime implementation. 54 | - FBX SDK and OpenSubDiv are static linked into the Unofficial DTU Bridge and requires both libraries to build the Daz Plugin. 55 | - OpenSubDiv is used under a Modified Apache License 2.0: https://github.com/PixarAnimationStudios/OpenSubdiv/blob/release/LICENSE.txt 56 | - FBX SDK is used under the Autodesk® FBX® SDK 2020 license: https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-2 57 | 58 | Version 1.1: 59 | - MacOS filesystem support. 60 | - Experimental uDTU shaders added for HDRP and URP, made from refactored and unified shadersubgraph codebase. 61 | - "Use New Shaders" option added to DTU Bridge Options panel (disabled by default). 62 | - Translucency Map, SSS, Dual Lobe Specular, Glossy Specular, Specular Strength, Top Coat implemented. 63 | - URP Transparency support via URP-Transparent shading mode. 64 | - Dual Lobe Specular and Glossy Specular simultaneously supported in all shading modes (SSS, Metallic, Specular, URP-Transparent). 65 | - Metallic emulation implemented in Specular and URP-Transparent shading modes. 66 | - SSS supported for all non-transparent materials (previously only Skin). 67 | - Fixed Alpha Clip Threshold bug in URP: affected depth-testing, especially hair. 68 | - Glossy Anisotropy, Roughness and Weight fixes. 69 | - "eyelash" material assigned to Hair shader. 70 | 71 | Version 1.0: 72 | - Bugfix: Imported asset files with different hash values are appropriately overwritten. 73 | - Bugfix: Emission strength values are properly set for IrayUber materials. 74 | - Bugfix: Emission Color now working for URP and Built-in RenderPipeline. 75 | - "Enable dForce" checkbox added to Options tab of DTU Bridge window. 76 | - RenderPipeline Detection procedure will ask to confirm Symbol Definition updates before proceeding. 77 | - Notification windows will popup when Daz Export and Unity Import steps are complete. 78 | - Daz Studio Subdivision settings are restored after Send To operation. 79 | - Changed plugin name and window titles to "Unofficial DTU Bridge". 80 | 81 | Version 0.5-alpha: 82 | - Smoother Unity Files installation with automatic dialog popup, RP detection and proper importing of first asset. 83 | - UI tweaks such as Daz3D menu command order, Install/Overwrite Unity Files checkbox. 84 | - New Unity Cloth Tools component to bulk edit weights by material groups, save/load weight maps. 85 | - Optimized HDRP and URP shadergraphs to use a single Sampler node. 86 | 87 | Version 0.4-alpha: 88 | - Preliminary support for dForce clothing, cloth physics export (only via the Simulation Properties of the Surfaces Pane of DazStudio). 89 | - Pregenerated cloth collision skeleton which is automatically merged into animation skeleton of Prefabs created by the Bridge. 90 | 91 | Version 0.3-alpha: 92 | - Animation exporting is now enabled through the Animation asset type and disabled when exporting Skeletal or Static Mesh. 93 | - Timeline animations are exported with sequentially numbered "@anim0000.fbx" filenames, which increment with each export operation. 94 | - Reverted/Fixed issue caused by removal of .meta files in v0.2-alpha which can lead to problems with mismatched GUID files when upgrading the unity plugin. 95 | 96 | Version 0.1-alpha: 97 | - Combined support for all three rendering pipelines and an autodetection/configuration system. 98 | -------------------------------------------------------------------------------- /UnityPlugin/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55ed265e4d7d543848b638941ba808b7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/DiffusionProfiles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8966c66003bc44b83bcb8bef69ae271f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/DiffusionProfiles/IrayUberSkinDiffusionProfile.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: b2686e09ec7aef44bad2843e4416f057, type: 3} 13 | m_Name: IrayUberSkinDiffusionProfile 14 | m_EditorClassIdentifier: 15 | m_Version: 1 16 | profile: 17 | scatteringDistance: {r: 0.7568628, g: 0.32156864, b: 0.20000002, a: 1} 18 | transmissionTint: {r: 0.75686276, g: 0.32156864, b: 0.2, a: 1} 19 | texturingMode: 0 20 | transmissionMode: 0 21 | thicknessRemap: {x: 0, y: 25} 22 | worldScale: 1 23 | ior: 1.36 24 | hash: 1075135919 25 | -------------------------------------------------------------------------------- /UnityPlugin/DiffusionProfiles/IrayUberSkinDiffusionProfile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 552ebd10c98753b4892491a7040b8920 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /UnityPlugin/LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7646eba07bdb34021a28d070c5b2d07c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/README.md: -------------------------------------------------------------------------------- 1 | Daz To Unity 2023 version 1.1.11 2 | ============================================= 3 | 4 | Description: 5 | ============ 6 | The Daz To Unity Bridge consists of two major parts: 7 | 1) a plug-in for Daz3D Studio responsible for exporting models and related data, and 8 | 2) a set of UnityEditor scripts (C#) which consume the exported data. 9 | 10 | 11 | New in this version: 12 | ==================== 13 | Version 2023.1.1.11: 14 | - Integration with latest Daz Bridge Library v1.1 15 | 16 | Known Issues: 17 | ============= 18 | - Subdivision procedure is currently only single-threaded CPU-based and may take several minutes to bake Subdivision level 3 and 4. 19 | - dForce strand-based hair is not yet supported. 20 | - Geograft morphs are not yet supported. 21 | - Genesis 8/8.1 prop rigging is not yet 100% accurately converted. 22 | - Identical / duplicate materials are not yet detected for merger in Unity. 23 | 24 | 25 | Setup: 26 | ====== 27 | No setup is required in Unity Editor. 28 | The Daz to Unity plugin will write all the necessary files (scripts, profiles, export data) into each targeted Unity project. 29 | The import process is automatic. 30 | 31 | 32 | Workflow: 33 | ========= 34 | Daz3D Studio - Have the root of one model selected. A menu command File >> Send To >> Daz to Unity summons a dialog, in which you specify the target Unity Project folder and other options. 35 | Unity Editor - Once the export has completed, put the Unity Editor app back into focus in Windows. The importer scripts will activate automatically and begin importing fresh export data. 36 | The first import takes longer than subsequent imports, because the Editor must compile shaders first. 37 | The first import of a given asset takes longer because textures are often copied across from Daz3D studio, and these take time to import. 38 | 39 | 40 | Folders: 41 | ======== 42 | The first time an export happens, a folder tree is written into your Unity project. 43 | Assets\Daz3D is the parent folder; the Daz to Unity Bridge only deals with files under \Daz3D\ 44 | Exports data are written to subfolders of \Daz3D\ and bear the name of the exported model. 45 | 46 | 47 | Files: 48 | ====== 49 | FBX - Much of the model data (skeletal hierarchy, weighted mesh, material mappings, lights, cameras, etc.) are conveyed in FBX format. These FBX files are constructed by Daz3D's built-in FBX exporter, and maintain the same variety of options and level of fidelity as a routine FBX export. 50 | DTU - The Bridge plug-in also writes a Daz-to-Unity file (in JSON format) which details the material properties so the importer can construct and assign high-fidelity Unity materials. 51 | Shaders - A suite of shader graphs are copied into your unity project the first time an export happens. These are imported by Unity Editor and compiled into shaders compatible with Unity's HD Render Pipeline. 52 | Scripts - A suite of C# scripts are copied into your unity project the first time an export happens. These include a custom importer for DTU file types, a custom EditorWindow and helper classes used by the importer. 53 | Diffusion Profiles - A generic diffusion profile and an IrayUberSkinDiffusionProfile are copied into your Unity project the first time an export happens. These are used by the custom shaders to replicate skin surface properties found in Daz3D Studio. 54 | 55 | 56 | Copyright Notice: 57 | ========== 58 | - This product is based on software by DAZ 3D, Inc. Copyright 2002-2021 DAZ 3D, Inc., used under modified Apache 2.0 License. All rights reserved. 59 | - OpenSubDiv is used under a Modified Apache License 2.0: https://github.com/PixarAnimationStudios/OpenSubdiv/blob/release/LICENSE.txt 60 | - FBX SDK is used under the Autodesk FBX SDK 2020 license: https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-2 61 | -------------------------------------------------------------------------------- /UnityPlugin/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c81adbc177ef4ab8ab682b9ff218a1e 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 374f7d9a4985b4f5189173e40c475797 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Resources/G8F Collision Rig.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1152a6942b99664498eebf27b04fea67 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/Resources/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daz3d/DazToUnity/b39a6760eaee3afcda19d9f82e79dfbae47483c2/UnityPlugin/Resources/Logo.png -------------------------------------------------------------------------------- /UnityPlugin/Resources/Logo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8eed129f625c93a42b5e87a62f382ee3 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 0 39 | wrapV: 0 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /UnityPlugin/Resources/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Daz To Unity 2023 version 1.1.11 2 | ============================================= 3 | 4 | Description: 5 | ============ 6 | The Daz To Unity Bridge consists of two major parts: 7 | 1) a plug-in for Daz3D Studio responsible for exporting models and related data, and 8 | 2) a set of UnityEditor scripts (C#) which consume the exported data. 9 | 10 | 11 | New in this version: 12 | ==================== 13 | - Integration with latest Daz Bridge Library v1.1 14 | 15 | 16 | Known Issues: 17 | ============= 18 | - Subdivision procedure is currently only single-threaded CPU-based and may take several minutes to bake Subdivision level 3 and 4. 19 | - dForce strand-based hair is not yet supported. 20 | - Geograft morphs are not yet supported. 21 | - Genesis 8/8.1 prop rigging is not yet 100% accurately converted. 22 | - Identical / duplicate materials are not yet detected for merger in Unity. 23 | 24 | 25 | Setup: 26 | ====== 27 | No setup is required in Unity Editor. 28 | The Daz to Unity plugin will write all the necessary files (scripts, profiles, export data) into each targeted Unity project. 29 | The import process is automatic. 30 | 31 | 32 | Workflow: 33 | ========= 34 | Daz3D Studio - Have the root of one model selected. A menu command File >> Send To >> Daz to Unity summons a dialog, in which you specify the target Unity Project folder and other options. 35 | Unity Editor - Once the export has completed, put the Unity Editor app back into focus in Windows. The importer scripts will activate automatically and begin importing fresh export data. 36 | The first import takes longer than subsequent imports, because the Editor must compile shaders first. 37 | The first import of a given asset takes longer because textures are often copied across from Daz3D studio, and these take time to import. 38 | 39 | 40 | Folders: 41 | ======== 42 | The first time an export happens, a folder tree is written into your Unity project. 43 | Assets\Daz3D is the parent folder; the Daz to Unity Bridge only deals with files under \Daz3D\ 44 | Exports data are written to subfolders of \Daz3D\ and bear the name of the exported model. 45 | 46 | 47 | Files: 48 | ====== 49 | FBX - Much of the model data (skeletal hierarchy, weighted mesh, material mappings, lights, cameras, etc.) are conveyed in FBX format. These FBX files are constructed by Daz3D's built-in FBX exporter, and maintain the same variety of options and level of fidelity as a routine FBX export. 50 | DTU - The Bridge plug-in also writes a Daz-to-Unity file (in JSON format) which details the material properties so the importer can construct and assign high-fidelity Unity materials. 51 | Shaders - A suite of shader graphs are copied into your unity project the first time an export happens. These are imported by Unity Editor and compiled into shaders compatible with Unity's HD Render Pipeline. 52 | Scripts - A suite of C# scripts are copied into your unity project the first time an export happens. These include a custom importer for DTU file types, a custom EditorWindow and helper classes used by the importer. 53 | Diffusion Profiles - A generic diffusion profile and an IrayUberSkinDiffusionProfile are copied into your Unity project the first time an export happens. These are used by the custom shaders to replicate skin surface properties found in Daz3D Studio. 54 | -------------------------------------------------------------------------------- /UnityPlugin/Resources/ReadMe.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de4adb36be8419d4fb63f6bbde810978 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee771ad73637f4b999c84373b92e2cdc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/ClothCollisionAssigner.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Serialization; 5 | using System; 6 | 7 | 8 | public class ClothCollisionAssigner : MonoBehaviour 9 | { 10 | [Header("Paired Sphere Colliders")] 11 | public SphereCollider[] m_UpperbodyColliders; 12 | public SphereCollider[] m_LowerbodyColliders; 13 | 14 | [Serializable] 15 | public class ClothConfig 16 | { 17 | public Cloth m_ClothToManage; 18 | public bool m_UpperBody; 19 | public bool m_LowerBody; 20 | } 21 | 22 | [Header("Cloth Collision Assignments")] 23 | public ClothConfig[] m_ClothConfigurationList; 24 | 25 | private void addCollidersToCloth(SphereCollider[] collider_list, Cloth cloth_component) 26 | { 27 | int collider_size = 0; 28 | foreach (SphereCollider sphere_collider in collider_list) 29 | { 30 | if (sphere_collider != null) 31 | { 32 | collider_size++; 33 | } 34 | } 35 | if (collider_size % 2 != 0) 36 | { 37 | collider_size += 1; 38 | } 39 | int original_size = 0; 40 | if (cloth_component.sphereColliders != null) 41 | { 42 | original_size = cloth_component.sphereColliders.Length; 43 | } 44 | ClothSphereColliderPair[] colliderpair_list = new ClothSphereColliderPair[original_size + (collider_size / 2)]; 45 | if (original_size > 0) 46 | { 47 | Array.Copy(cloth_component.sphereColliders, colliderpair_list, original_size); 48 | } 49 | for (int i = 0; i < collider_size / 2; i++) 50 | { 51 | 52 | colliderpair_list[original_size + i].first = collider_list[i * 2]; 53 | colliderpair_list[original_size + i].second = collider_list[i * 2 + 1]; 54 | } 55 | cloth_component.sphereColliders = colliderpair_list; 56 | 57 | } 58 | 59 | public void addClothConfig(ClothConfig newConfig) 60 | { 61 | int new_size = m_ClothConfigurationList.Length + 1; 62 | Array.Resize(ref m_ClothConfigurationList, new_size); 63 | m_ClothConfigurationList[new_size - 1] = newConfig; 64 | } 65 | 66 | 67 | // merge cloth collision rig into rootnode of main figure rig 68 | public void mergeRig(Transform destination_rootTransform) 69 | { 70 | Transform source_rootTransform = this.transform.Find("hip"); 71 | List childTransform_stack = new List(); 72 | childTransform_stack.Add(source_rootTransform); 73 | 74 | while (childTransform_stack.Count > 0) 75 | { 76 | int next_Index = childTransform_stack.Count - 1; 77 | Transform child = childTransform_stack[next_Index]; 78 | childTransform_stack.RemoveAt(next_Index); 79 | 80 | if (child == null) continue; 81 | 82 | // add all children to stack 83 | for (int i = 0; i < child.childCount; i++) 84 | { 85 | Transform grandchild = child.GetChild(i); 86 | if (grandchild != null) 87 | childTransform_stack.Add(grandchild); 88 | } 89 | 90 | // check if child is a dforce collider 91 | if (child.CompareTag("dForceCollider")) 92 | { 93 | // 1. unroll parent tree to get full path 94 | Transform parent = child.parent; 95 | String path_name = parent.name; 96 | while (parent != null && parent.parent != source_rootTransform) 97 | { 98 | if (parent.parent == null) break; 99 | parent = parent.parent; 100 | path_name = parent.name + "/" + path_name; 101 | } 102 | // 2. find destination parent node 103 | var dest_parent = destination_rootTransform.Find(path_name); 104 | if (dest_parent != null) 105 | { 106 | // 3. move child to destination parent, worldspace = false 107 | child.transform.SetParent(dest_parent, false); 108 | } 109 | } 110 | 111 | } 112 | 113 | } 114 | 115 | public void ClearAllAssignments() 116 | { 117 | foreach (ClothConfig cloth_config in m_ClothConfigurationList) 118 | { 119 | if (cloth_config == null) 120 | continue; 121 | // delete existing cloth collisions 122 | if (cloth_config.m_ClothToManage != null && cloth_config.m_ClothToManage.sphereColliders != null) 123 | cloth_config.m_ClothToManage.sphereColliders = null; 124 | } 125 | } 126 | 127 | public void AssignClothCollisionRigs() 128 | { 129 | foreach (ClothConfig cloth_config in m_ClothConfigurationList) 130 | { 131 | if (cloth_config == null) 132 | continue; 133 | if (cloth_config.m_UpperBody) 134 | addCollidersToCloth(m_UpperbodyColliders, cloth_config.m_ClothToManage); 135 | if (cloth_config.m_LowerBody) 136 | addCollidersToCloth(m_LowerbodyColliders, cloth_config.m_ClothToManage); 137 | } 138 | } 139 | 140 | // Start is called before the first frame update 141 | void Start() 142 | { 143 | ClearAllAssignments(); 144 | 145 | AssignClothCollisionRigs(); 146 | 147 | } 148 | 149 | // Update is called once per frame 150 | void Update() 151 | { 152 | 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/ClothCollisionAssigner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f94c972f9cb764449bb5b8d87e72a9dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/ClothTools.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca56b19cbb5048c469eb0727b9996e9f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/CollapsedVertexArray.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | ///////////////////////////////////////////////////////////////// 6 | // SkinnedMesh vertex index TO Cloth vertex index 7 | ///////////////////////////////////////////////////////////////// 8 | [System.Serializable] 9 | public class CollapsedVertexArray 10 | { 11 | private Dictionary m_LookupTable; 12 | private Dictionary> m_CollapsedVertices; 13 | private int m_UniqueVertexCount; 14 | 15 | public class CollapsedVertex 16 | { 17 | public Vector3 vertex; 18 | public int unique_index; 19 | public List indexes; 20 | 21 | public CollapsedVertex(Vector3 a_vertex, int index, int a_unique_index) 22 | { 23 | vertex = a_vertex; 24 | indexes = new List(1) { index }; 25 | unique_index = a_unique_index; 26 | } 27 | 28 | public void AddIndex(int index) 29 | { 30 | indexes.Add(index); 31 | } 32 | 33 | public static bool operator ==(CollapsedVertex a, Vector3 b) => a.vertex == b; 34 | public static bool operator !=(CollapsedVertex a, Vector3 b) => a.vertex != b; 35 | 36 | public static bool operator ==(CollapsedVertex a, CollapsedVertex b) => a.vertex == b.vertex; 37 | public static bool operator !=(CollapsedVertex a, CollapsedVertex b) => a.vertex != b.vertex; 38 | public override bool Equals(object obj) => this.vertex.Equals(obj); 39 | public override int GetHashCode() => this.vertex.GetHashCode(); 40 | 41 | } 42 | 43 | public int Length 44 | { 45 | get 46 | { 47 | if (m_LookupTable == null || m_LookupTable.Count == 0) 48 | { 49 | //Debug.LogError("CollapsedVertexArray.Length: m_LookupTable is null"); 50 | return -1; 51 | } 52 | 53 | if (m_LookupTable.Count < m_UniqueVertexCount) 54 | { 55 | Debug.LogWarning("mLookupTable.Count[" + m_LookupTable.Count + "] may not contain all unique vertices [" + m_UniqueVertexCount + "]"); 56 | } 57 | 58 | return m_UniqueVertexCount; 59 | } 60 | } 61 | 62 | public int LookupIndex(int a_index) 63 | { 64 | if (m_LookupTable != null) 65 | { 66 | if (m_LookupTable.ContainsKey(a_index)) 67 | return m_LookupTable[a_index]; 68 | } 69 | 70 | return -1; 71 | 72 | } 73 | 74 | public CollapsedVertexArray(Vector3[] a_vertices) 75 | { 76 | if (a_vertices.Length <= 0) 77 | { 78 | m_UniqueVertexCount = -1; 79 | return; 80 | } 81 | 82 | m_CollapsedVertices = new Dictionary>(a_vertices.Length); 83 | for (int i = 0; i < a_vertices.Length; i++) 84 | { 85 | Vector3 a_vert = a_vertices[i]; 86 | bool vert_is_unique = true; 87 | if (m_CollapsedVertices.ContainsKey(a_vert.GetHashCode())) 88 | { 89 | // get optimized (hashcode filtered) list of verts, check against each one for uniqueness 90 | List cvert_list = m_CollapsedVertices[a_vert.GetHashCode()]; 91 | foreach (CollapsedVertex cvert in cvert_list) 92 | { 93 | if (cvert == a_vert) 94 | { 95 | vert_is_unique = false; 96 | cvert.AddIndex(i); 97 | break; 98 | } 99 | } 100 | if (vert_is_unique) 101 | { 102 | // add to end of unqiue verts array 103 | //m_CollapsedVertices[m_UniqueVertexCount++] = new CollapsedVertex(a_vert, i); 104 | cvert_list.Add(new CollapsedVertex(a_vert, i, m_UniqueVertexCount++)); 105 | } 106 | 107 | } 108 | else 109 | { 110 | // assume unqiue 111 | m_CollapsedVertices.Add(a_vert.GetHashCode(), new List(1) { new CollapsedVertex(a_vert, i, m_UniqueVertexCount++) }); 112 | } 113 | 114 | } 115 | 116 | // build lookup tables / Dictionaries 117 | m_LookupTable = new Dictionary(a_vertices.Length); 118 | foreach (List cvert_list in m_CollapsedVertices.Values) 119 | { 120 | foreach (CollapsedVertex cvert in cvert_list) 121 | { 122 | foreach (int key in cvert.indexes) 123 | { 124 | if (m_LookupTable.ContainsKey(key)) 125 | { 126 | if (m_LookupTable[key] != cvert.unique_index) 127 | { 128 | Debug.LogWarning("CollapsedVertexArray: lookup table generator is overwriting unique index with another value"); 129 | m_LookupTable[key] = cvert.unique_index; 130 | } 131 | } 132 | else 133 | { 134 | m_LookupTable.Add(key, cvert.unique_index); 135 | } 136 | } 137 | 138 | } 139 | } 140 | 141 | //Debug.Log("Finished CollapsedVertexArray: original Verts=" + a_vertices.Length + ", unique Verts=" + m_UniqueVertexCount); 142 | return; 143 | 144 | } 145 | 146 | } 147 | ///////////////////////////////////////////////////////////////// 148 | // End: SkinnedMesh vertex index TO Cloth vertex index 149 | ///////////////////////////////////////////////////////////////// 150 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/CollapsedVertexArray.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62b7ba0c93dd725489c7ba1e1003f66f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Daz3DInstance.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | namespace Daz3D 5 | { 6 | /// 7 | /// A component to attach to the scene instance of the prefab created by the DTUImporter 8 | /// allows the instance to be "refreshed" with the newer prefab, between successive import sessions 9 | /// If the scene containing the instance is open and the fbx is fresher than the scene, then 10 | /// a instance of the new prefab will replace the old 11 | /// TODO add a switch in the DTU JSON to override this behavior 12 | /// 13 | public class Daz3DInstance : MonoBehaviour 14 | { 15 | /// 16 | /// The FBX modelPrefab is used as the unifying key between the import session 17 | /// and the instance in the scene. 18 | /// 19 | public GameObject SourceFBX; 20 | 21 | [Tooltip("If true, future bridge imports will replace this instance in the scene, including any prefab overrides.")] 22 | public bool ReplaceOnImport = true; 23 | 24 | // // // // // // // // 25 | 26 | 27 | //adds rightclick menu to project view 28 | //[MenuItem("Assets/MUNKEE/DoSomething")] 29 | //public static void Init() 30 | //{ 31 | // var file = Selection.activeObject.name; 32 | // Debug.LogWarning(file); 33 | //} 34 | 35 | 36 | //// Add a menu item named "Do Something" to MyMenu in the menu bar. 37 | //[MenuItem("MyMenu/Do Something M U N K E E _____________")] 38 | //static void DoSomething() 39 | //{ 40 | // Debug.Log("Doing Something..."); 41 | //} 42 | 43 | 44 | 45 | // Add a menu item named "Do Something with a Shortcut Key" to MyMenu in the menu bar 46 | // and give it a shortcut (ctrl-g on Windows, cmd-g on macOS). 47 | //[MenuItem("MyMenu/Do Something with a Shortcut Key %g M U N K E E _____________")] 48 | //static void DoSomethingWithAShortcutKey() 49 | //{ 50 | // Debug.Log("Doing something with a Shortcut Key..."); 51 | //} 52 | 53 | // Add a menu item called "Double Mass" to a Rigidbody's context menu. 54 | //[MenuItem("CONTEXT/Rigidbody/Double Mass M U N K E E _____________")] 55 | //static void DoubleMass(MenuCommand command) 56 | //{ 57 | // Rigidbody body = (Rigidbody)command.context; 58 | // body.mass = body.mass * 2; 59 | // Debug.Log("Doubled Rigidbody's Mass to " + body.mass + " from Context Menu."); 60 | //} 61 | 62 | // Add a menu item to create custom GameObjects. 63 | // Priority 1 ensures it is grouped with the other menu items of the same kind 64 | // and propagated to the hierarchy dropdown and hierarchy context menus. 65 | //[MenuItem("GameObject/M U N K E E _____________/Custom Game Object", false, 10)] 66 | //static void CreateCustomGameObject(MenuCommand menuCommand) 67 | //{ 68 | // // Create a custom game object 69 | // GameObject go = new GameObject("Custom Game Object"); 70 | // // Ensure it gets reparented if this was a context click (otherwise does nothing) 71 | // GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject); 72 | // // Register the creation in the undo system 73 | // Undo.RegisterCreatedObjectUndo(go, "Create " + go.name); 74 | // Selection.activeObject = go; 75 | //} 76 | 77 | 78 | 79 | 80 | 81 | 82 | } 83 | } -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Daz3DInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a237cd1edabd402bb18b45be88b01ed 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f04b84f831ed34d81aeec036ef008a4a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/ClothCollisionAssignerEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | [CustomEditor (typeof (ClothCollisionAssigner))] 7 | [CanEditMultipleObjects] 8 | public class ClothCollisionAssignerEditor : Editor 9 | { 10 | private SerializedObject m_Object; 11 | 12 | public void OnEnable() 13 | { 14 | m_Object = new SerializedObject(target); 15 | } 16 | 17 | public override void OnInspectorGUI() 18 | { 19 | m_Object.Update(); 20 | 21 | GUILayout.Label("**Cloth Collision Assigner**", EditorStyles.boldLabel); 22 | 23 | GUILayout.Space(10); 24 | base.OnInspectorGUI(); 25 | GUILayout.Space(10); 26 | 27 | 28 | 29 | GUILayout.Space(10); 30 | GUILayout.Label("When this script is enabled, Cloth Collision Rigs are assigned during Runtime. Click \"Assign Cloth Collision Rigs\" to assign the rigs in editor mode.", EditorStyles.wordWrappedLabel ); 31 | 32 | GUILayout.BeginHorizontal(); 33 | if (GUILayout.Button("Assign Cloth Collision Rigs")) 34 | { 35 | ClothCollisionAssigner assigner = (ClothCollisionAssigner)target; 36 | assigner.AssignClothCollisionRigs(); 37 | Debug.Log("Assigned Cloth Collision Rigs"); 38 | } 39 | 40 | if (GUILayout.Button("Clear All Assignments")) 41 | { 42 | ClothCollisionAssigner assigner = (ClothCollisionAssigner)target; 43 | assigner.ClearAllAssignments(); 44 | Debug.Log("Cleared All Assignments"); 45 | } 46 | 47 | GUILayout.EndHorizontal(); 48 | GUILayout.Space(10); 49 | 50 | m_Object.ApplyModifiedProperties(); 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/ClothCollisionAssignerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c72016c772ee8d046bd0fb2333dbdd7d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/ClothToolsEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | [CustomEditor(typeof(ClothTools))] 7 | [CanEditMultipleObjects] 8 | 9 | public class ClothToolsEditor : Editor 10 | { 11 | private SerializedObject m_Object; 12 | private float[] floatArray; 13 | 14 | public void OnEnable() 15 | { 16 | m_Object = new SerializedObject(target); 17 | } 18 | 19 | public override void OnInspectorGUI() 20 | { 21 | //ClothTools clothtools = (ClothTools)target; 22 | ClothTools clothtools = (ClothTools) m_Object.targetObject; 23 | 24 | m_Object.Update(); 25 | 26 | GUILayout.Space(10); 27 | GUILayout.Label("Set Max Distance for Material Group:", EditorStyles.whiteLargeLabel); 28 | 29 | //DrawDefaultInspector(); 30 | 31 | SkinnedMeshRenderer skinned = clothtools.gameObject.GetComponent(); 32 | int numMaterials = skinned.sharedMaterials.Length; 33 | if (floatArray == null) 34 | { 35 | floatArray = new float[numMaterials]; 36 | } 37 | else if (floatArray.Length != numMaterials) 38 | { 39 | System.Array.Resize(ref floatArray, numMaterials); 40 | } 41 | foreach (Material mat in skinned.sharedMaterials) 42 | { 43 | if (mat) 44 | { 45 | int matIndex = System.Array.IndexOf(skinned.sharedMaterials, mat); 46 | 47 | // GUILayout.Space(10); 48 | GUILayout.BeginHorizontal(); 49 | //GUILayout.Label(mat.name); 50 | floatArray[matIndex] = EditorGUILayout.Slider(mat.name,floatArray[matIndex], 0f, 0.2f); 51 | 52 | //if (GUILayout.Button("Zero")) 53 | //{ 54 | // clothtools.SetSubMeshWeights(matIndex, 0.0f); 55 | // //Debug.Log("Zero Material Weights: " + mat.name); 56 | //} 57 | //if (GUILayout.Button("One")) 58 | //{ 59 | // clothtools.SetSubMeshWeights(matIndex, 1.0f); 60 | // //Debug.Log("Set Material Weights to 1.0: " + mat.name); 61 | //} 62 | if (GUILayout.Button("Set")) 63 | { 64 | clothtools.SetSubMeshWeights(matIndex, floatArray[matIndex]); 65 | floatArray[matIndex] = 0f; 66 | //Debug.Log("Clear Material Weights: " + mat.name); 67 | } 68 | if (GUILayout.Button("Clear")) 69 | { 70 | clothtools.ClearSubMeshWeights(matIndex); 71 | floatArray[matIndex] = 0f; 72 | //Debug.Log("Clear Material Weights: " + mat.name); 73 | } 74 | //floatArray[matIndex] = EditorGUILayout.TextField(floatArray[matIndex]); 75 | 76 | GUILayout.EndHorizontal(); 77 | 78 | //GUILayout.Space(5); 79 | } 80 | } 81 | 82 | GUILayout.Space(10); 83 | if (GUILayout.Button("Load Weightmap data")) 84 | { 85 | string path = EditorUtility.OpenFilePanelWithFilters( 86 | "Load Weightmap data", 87 | "Assets/Daz3D", 88 | new string[] { "Unity Weight Maps", "unity_weightmap.bytes", "DForce Weight maps", "dforce_weightmap.bytes", "All files", "*"}); 89 | if (path.Length != 0) 90 | { 91 | if (path.Contains(".unity_weightmap.bytes")) 92 | { 93 | //Debug.Log("DEBUG: load from file: " + path); 94 | clothtools.LoadWeightMap(path); 95 | } 96 | 97 | if (path.Contains("dforce_weightmap.bytes")) 98 | { 99 | //Debug.Log("DEBUG: import from file: " + path); 100 | clothtools.ImportWeightMap(path); 101 | } 102 | 103 | } 104 | 105 | //clothtools.LoadRawWeightMap(); 106 | ////Debug.Log("Load Weightmap data."); 107 | } 108 | 109 | //GUILayout.Space(10); 110 | if (GUILayout.Button("Save Weightmap data")) 111 | { 112 | var path = EditorUtility.SaveFilePanel( 113 | "Save Weightmap data", 114 | "Assets/Daz3D", 115 | clothtools.gameObject.name, 116 | "unity_weightmap.bytes"); 117 | 118 | if (path.Length != 0) 119 | { 120 | path = path.Replace(".unity_weightmap.bytes", "") + ".unity_weightmap.bytes"; 121 | //Debug.Log("DEBUG: write to file: " + path); 122 | clothtools.SaveWeightMap(path); 123 | } 124 | 125 | } 126 | 127 | //GUILayout.Space(10); 128 | if (GUILayout.Button("Load Gradient Pattern")) 129 | { 130 | clothtools.LoadGradientPattern(); 131 | //Debug.Log("Load Gradient Pattern."); 132 | } 133 | 134 | //GUILayout.Space(10); 135 | if (GUILayout.Button("Zero All Weights")) 136 | { 137 | for (int i=0; i < skinned.sharedMaterials.Length; i++) 138 | { 139 | clothtools.SetSubMeshWeights(i, 0f); 140 | } 141 | } 142 | 143 | //GUILayout.Space(10); 144 | if (GUILayout.Button("Clear All Weights")) 145 | { 146 | //Undo.RecordObject(clothtools.m_Cloth, "Clear All Weights"); 147 | clothtools.ClearWeightMap(); 148 | //Debug.Log("Clear Weights."); 149 | } 150 | 151 | //GUILayout.Space(10); 152 | //if (GUILayout.Button("Load Stepped Gradient")) 153 | //{ 154 | // clothtools.LoadSteppedGradient(); 155 | // //Debug.Log("Load Stepped Gradient."); 156 | //} 157 | 158 | //GUILayout.Space(10); 159 | //if (GUILayout.Button("Generate Lookup Tables")) 160 | //{ 161 | // clothtools.GenerateLookupTables(); 162 | // //Debug.Log("Generate Lookup Tables Called...."); 163 | //} 164 | 165 | //GUILayout.Space(10); 166 | //if (GUILayout.Button("Run Vertex Data Test")) 167 | //{ 168 | // clothtools.TestVertData(); 169 | // //Debug.Log("Running Vertex Data Test...."); 170 | //} 171 | 172 | m_Object.ApplyModifiedProperties(); 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/ClothToolsEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d931b53394f92c44ca2c1264a9dc9f88 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DTUConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 815bdb69e76ae41c183fe950d5e58fbb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/Daz3DBridge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 422e32357dbbe49ea8ef244a2b2287ec 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/Daz3DDTUImporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74b20127438474d259671807b26b59f2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DazCoroutine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEditor; 5 | 6 | namespace Daz3D 7 | { 8 | /// 9 | /// A compact coroutine manager for executing coroutines in the unity editor 10 | /// without the need for the optional editor coroutine package to be installed 11 | /// 12 | public static class DazCoroutine 13 | { 14 | private static List s_activeCoroutines = new List(); 15 | private static int s_activeCoroutineIndex = 0; 16 | 17 | static DazCoroutine() 18 | { 19 | if (!IsEditorCoroutineActive()) 20 | EditorApplication.update += ExecuteCoroutines; 21 | } 22 | 23 | public static IEnumerator StartCoroutine(IEnumerator coroutine) 24 | { 25 | s_activeCoroutines.Add(coroutine); 26 | return coroutine; 27 | } 28 | 29 | public static void StopCoroutine(IEnumerator coroutine) 30 | { 31 | if (s_activeCoroutines.Contains(coroutine)) 32 | s_activeCoroutines.Remove(coroutine); 33 | } 34 | 35 | private static void ExecuteCoroutines() 36 | { 37 | if (s_activeCoroutines.Count > 0) 38 | { 39 | s_activeCoroutineIndex++; 40 | s_activeCoroutineIndex %= s_activeCoroutines.Count; 41 | 42 | if (!s_activeCoroutines[s_activeCoroutineIndex].MoveNext()) 43 | s_activeCoroutines.RemoveAt(s_activeCoroutineIndex); 44 | } 45 | } 46 | 47 | private static bool IsEditorCoroutineActive() 48 | { 49 | var list = EditorApplication.update.GetInvocationList(); 50 | return Array.Exists(list, element => element.Method.Name == "ExecuteCoroutines"); 51 | } 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DazCoroutine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a32578eafb27a4ac79e297f68260f0bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DazJSONHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | 6 | namespace Daz3D 7 | { 8 | // [Serializable] 9 | // public class DTUData 10 | // { 11 | // //public string AssetName = "|||||||||||||||||"; //are these cruft from unreal dtu? 12 | // //public string AssetType = "|||||||||||||||||"; 13 | // //public string FBXFile = "|||||||||||||||||"; 14 | // //public string ImportFolder = "|||||||||||||||||"; 15 | 16 | // public List Materials = new List(); 17 | // public List Morphs = new List(); 18 | 19 | // [Serializable] 20 | // public class Material 21 | // { 22 | // public int Version = -999; 23 | // public string AssetName = "~~~~~~~~"; 24 | // public string MaterialName = "~~~~~~~~"; 25 | // public string MaterialType = "~~~~~~~~"; 26 | // public string Value = "~~~~~~~~"; 27 | // public List Properties = new List(); 28 | 29 | 30 | // [Serializable] 31 | // public class Property 32 | // { 33 | // public string Name = "@@@@@"; 34 | // public string Value = "@@@@@"; 35 | // public string DataType = "@@@@@"; 36 | // public string Texture = "@@@@@"; 37 | // } 38 | 39 | // } 40 | 41 | // [Serializable] 42 | // public class Morph 43 | // { 44 | // public string CTRLBodyBuilder; 45 | // } 46 | // } 47 | 48 | 49 | 50 | //} 51 | public static class DazJSONHelper 52 | { 53 | // public static string FixKeySpaces(string input) 54 | // { 55 | // var output = input.Replace("Asset Name", "AssetName"); 56 | // output = output.Replace("Asset Type", "AssetType"); 57 | // output = output.Replace("Import Folder", "ImportFolder"); 58 | // output = output.Replace("FBX File", "FBXFile"); 59 | 60 | // output = output.Replace("Material Name", "MaterialName"); 61 | // output = output.Replace("Material Type", "MaterialType"); 62 | // output = output.Replace("Data Type", "DataType"); 63 | 64 | // return output; 65 | 66 | // } 67 | 68 | public static string BuildUnityPath(string path, string subDir) 69 | { 70 | var result = Path.Combine(path, subDir).Replace("\\", "/"); //unity likes forward slashes in asset database paths; 71 | 72 | return result; 73 | } 74 | 75 | // // public static T[] FromJson(string json) 76 | // // { 77 | // // Wrapper wrapper = JsonUtility.FromJson>(json); 78 | // // return wrapper.Items; 79 | // // } 80 | 81 | // // public static string ToJson(T[] array) 82 | // // { 83 | // // Wrapper wrapper = new Wrapper(); 84 | // // wrapper.Items = array; 85 | // // return JsonUtility.ToJson(wrapper); 86 | // // } 87 | 88 | // // public static string ToJson(T[] array, bool prettyPrint) 89 | // // { 90 | // // Wrapper wrapper = new Wrapper(); 91 | // // wrapper.Items = array; 92 | // // return JsonUtility.ToJson(wrapper, prettyPrint); 93 | // // } 94 | 95 | // // [Serializable] 96 | // // private class Wrapper 97 | // // { 98 | // // public T[] Items; 99 | // // } 100 | } 101 | } 102 | 103 | 104 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DazJSONHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b7753464d84409ca1d1beb6644f2dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DetectRenderPipeline.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System.Linq; 6 | 7 | #if UNITY_EDITOR 8 | //[InitializeOnLoad] 9 | public static class DetectRenderPipeline 10 | { 11 | 12 | public static readonly string[] usingRPSymbols = new string[] { 13 | "USING_HDRP", 14 | "USING_URP", 15 | "USING_BUILTIN", 16 | "USING_2019", 17 | }; 18 | 19 | static string CleanPreprocessorDirectives(string definedSymbolsString) 20 | { 21 | List allDefinedSymbols = definedSymbolsString.Split(';').ToList(); 22 | 23 | foreach (string removeSymbol in usingRPSymbols) 24 | { 25 | if (allDefinedSymbols.Contains(removeSymbol)) 26 | { 27 | allDefinedSymbols.Remove(removeSymbol); 28 | if (!allDefinedSymbols.Contains(removeSymbol)) 29 | { 30 | // Debug.Log("Defined Symbol removed: " + removeSymbol); 31 | } 32 | else 33 | { 34 | // Debug.LogError("Defined Symbol could not be removed: " + removeSymbol); 35 | } 36 | } 37 | else 38 | { 39 | // Debug.Log("Defined Symbol not detected: " + removeSymbol); 40 | } 41 | } 42 | 43 | return string.Join(";", allDefinedSymbols.ToArray()); 44 | } 45 | 46 | static string DetectAndSetSymbolString(string definedSymbols) 47 | { 48 | string newSymbolString = ""; 49 | 50 | if (definedSymbols != "") 51 | { 52 | newSymbolString = definedSymbols + ";"; 53 | } 54 | if (IsHDRPInstalled()) 55 | { 56 | newSymbolString += "USING_HDRP"; 57 | } 58 | else if (IsURPInstalled()) 59 | { 60 | newSymbolString += "USING_URP"; 61 | // check for 2019 62 | if (Application.unityVersion.Contains("2019")) 63 | { 64 | newSymbolString += ";USING_2019"; 65 | } 66 | } 67 | else 68 | { 69 | newSymbolString += "USING_BUILTIN"; 70 | } 71 | 72 | return newSymbolString; 73 | } 74 | 75 | //[UnityEditor.Callbacks.DidReloadScripts] 76 | static void CommitDefinedSymbols(string newSymbolsString) 77 | { 78 | Debug.Log("Attempting to write new PreprocessorDirectives: " + newSymbolsString); 79 | PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, newSymbolsString); 80 | } 81 | 82 | static bool IsHDRPInstalled() 83 | { 84 | if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline != null) 85 | { 86 | string renderAssetType = "dummy string"; 87 | renderAssetType = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset.GetType().ToString(); 88 | if (renderAssetType.Contains("HDRenderPipeline")) 89 | { 90 | return true; 91 | } 92 | } 93 | 94 | return false; 95 | } 96 | 97 | static bool IsURPInstalled() 98 | { 99 | if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline != null) 100 | { 101 | string renderAssetType = "dummy string"; 102 | renderAssetType = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset.GetType().ToString(); 103 | if (renderAssetType.Contains("UniversalRenderPipeline")) 104 | { 105 | return true; 106 | } 107 | } 108 | 109 | return false; 110 | } 111 | 112 | public static void RunOnce() 113 | { 114 | string oldSymbolsString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); 115 | 116 | string newSymbolsString = oldSymbolsString; 117 | 118 | newSymbolsString = CleanPreprocessorDirectives(newSymbolsString); 119 | newSymbolsString = DetectAndSetSymbolString(newSymbolsString); 120 | 121 | string renderPipelineString = "Built-In Pipeline"; 122 | if (IsHDRPInstalled()) 123 | renderPipelineString = "HDRP"; 124 | else if (IsURPInstalled()) 125 | renderPipelineString = "URP"; 126 | 127 | // Debug.Log("OldString=" + oldSymbolsString + ", NewString=" + newSymbolsString); 128 | if (oldSymbolsString != newSymbolsString) 129 | { 130 | // DB: 2021-08-31, showmodal to ask to change defined symbols, warn that it will take time (minutes) 131 | // 1. DISPLAY DETECTED RP, ASK TO COMMIT, WARN OPERATION WILL TAKE TIME (MINUTES) 132 | // 2. IF YES, DO COMMIT 133 | // 3. IF NO, RESET VALUES SO DETECTION CAN BE RUN LATER... 134 | // OPTIONAL: IMPORT ASSETS WITH DEFAULT SHADER? 135 | Daz3D.Daz3DBridge.CurrentToolbarMode = Daz3D.Daz3DBridge.ToolbarMode.Options; 136 | string dtu_detectrp_message = "Detected [" + renderPipelineString + "]\n\nDTU Bridge must update symbol definitions to continue the Import Procedure. This may take a few minutes. " + 137 | "You may Cancel now, and rerun the renderpipeline detection process from the DTU Bridge at another time."; 138 | bool bUpdateSymbols = EditorUtility.DisplayDialog("RenderPipeline Detection", dtu_detectrp_message, "Update Symbol Definitions Now", "Cancel and Redetect RenderPipeline Later"); 139 | if (bUpdateSymbols) 140 | { 141 | Daz3D.Daz3DBridge.CurrentToolbarMode = Daz3D.Daz3DBridge.ToolbarMode.History; 142 | CommitDefinedSymbols(newSymbolsString); 143 | Daz3D.Daz3DDTUImporter.ImportEventRecord record = new Daz3D.Daz3DDTUImporter.ImportEventRecord(); 144 | Daz3D.Daz3DDTUImporter.EventQueue.Enqueue(record); 145 | record.AddToken("Updating Symbol Definitions.\nThis will trigger Unity Editor to recompile all scripts and may take several minutes..."); 146 | } 147 | else 148 | { 149 | Daz3D.Daz3DDTUImporter.ImportEventRecord record = new Daz3D.Daz3DDTUImporter.ImportEventRecord(); 150 | Daz3D.Daz3DDTUImporter.EventQueue.Enqueue(record); 151 | record.AddToken("Autodetection cancelled.\nPlease click the \"Detect RenderPipeline\" button \nin the Options tab to continue import procedure."); 152 | } 153 | 154 | } 155 | else 156 | { 157 | string dtu_detectrp_message = "Detected [" + renderPipelineString + "]\n\nNo changes need to be made to Symbol Definitions."; 158 | EditorUtility.DisplayDialog("RenderPipeline Detection", dtu_detectrp_message, "OK"); 159 | } 160 | 161 | } 162 | } 163 | #endif // UNITY_EDITOR -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Editor/DetectRenderPipeline.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7f6a4090d16c4a41afe1f287d606130 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Utilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using UnityEngine; 4 | 5 | namespace Daz3D 6 | { 7 | /// 8 | /// Misc helpers methods, such as file handling 9 | /// 10 | public class Utilities 11 | { 12 | protected static Regex nameScrub = new Regex("[^a-zA-Z0-9_-]+"); 13 | public static string ScrubKey(string src) 14 | { 15 | src = src.Replace(" ", "_"); 16 | src = src.Replace(":", "_"); 17 | src = nameScrub.Replace(src, ""); 18 | return src; 19 | } 20 | 21 | protected static Regex directoryScrub = new Regex(@"[^a-zA-Z0-9-._/]+"); 22 | public static string ScrubPath(string src) 23 | { 24 | src = src.Replace("\\", "/"); 25 | src = src.Replace(" ", "_"); 26 | src = directoryScrub.Replace(src, ""); 27 | return src; 28 | } 29 | 30 | public static byte[] MD5AsBytes(string path) 31 | { 32 | var md5 = System.Security.Cryptography.MD5.Create(); 33 | var stream = System.IO.File.OpenRead(path); 34 | var bytes = md5.ComputeHash(stream); 35 | return bytes; 36 | } 37 | 38 | public static string MD5(string path) 39 | { 40 | var bytes = MD5AsBytes(path); 41 | return BitConverter.ToString(bytes).Replace("-","").ToLowerInvariant(); 42 | } 43 | 44 | public static float GetStrengthFromColor(Color color) 45 | { 46 | return color.grayscale; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /UnityPlugin/Scripts/Utilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6675556b1ece044239c13627e6d7028d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdd6f6970c6e945d9a99f22af6c939de 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2387871912cae49178472609bebbcee6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Helpers/GetLightDirection.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef GETLIGHT_INCLUDED 2 | #define GETLIGHT_INCLUDED 3 | 4 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" 5 | #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightDefinition.cs.hlsl" 6 | 7 | void GetLightDirection_float(out float3 lightDir, out float3 lightColor) 8 | { 9 | #ifdef SHADERGRAPH_PREVIEW 10 | lightDir = float3(0.707, 0.707, 0); 11 | lightColor = 1; 12 | #else 13 | if (_DirectionalLightCount > 0) 14 | { 15 | DirectionalLightData light = _DirectionalLightDatas[0]; 16 | lightDir = light.forward.xyz; 17 | lightColor = light.color; 18 | } 19 | else 20 | { 21 | lightDir = float3(1, 0, 0); 22 | lightColor = 0; 23 | } 24 | #endif 25 | } 26 | 27 | #endif -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Helpers/GetLightDirection.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d498a2cd0ac51b488428a5956eee76d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Helpers/LightDirection.shadersubgraph: -------------------------------------------------------------------------------- 1 | { 2 | "m_SerializedProperties": [], 3 | "m_SerializedKeywords": [], 4 | "m_SerializableNodes": [ 5 | { 6 | "typeInfo": { 7 | "fullName": "UnityEditor.ShaderGraph.CustomFunctionNode" 8 | }, 9 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"1bf0aa00-186e-4623-83d3-478dfed940e8\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Custom Function\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 432.0,\n \"y\": -120.0,\n \"width\": 208.0,\n \"height\": 302.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"lightDir\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"lightDir\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"lightColor\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"lightColor\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n },\n \"m_SourceType\": 0,\n \"m_FunctionName\": \"GetLightDirection\",\n \"m_FunctionSource\": \"0d498a2cd0ac51b488428a5956eee76d\",\n \"m_FunctionBody\": \"Enter function body here...\"\n}" 10 | }, 11 | { 12 | "typeInfo": { 13 | "fullName": "UnityEditor.ShaderGraph.SubGraphOutputNode" 14 | }, 15 | "JSONnodeData": "{\n \"m_GuidSerialized\": \"aab49526-1979-4441-9092-63cde7c820af\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Out_Vector4\",\n \"m_NodeVersion\": 0,\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 674.0000610351563,\n \"y\": -121.00006866455078,\n \"width\": 141.0,\n \"height\": 101.00000762939453\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"LightDirection\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"LightDirection\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"LightColor\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"LightColor\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n }\n ],\n \"m_Precision\": 0,\n \"m_PreviewExpanded\": true,\n \"m_CustomColors\": {\n \"m_SerializableColors\": []\n }\n}" 16 | } 17 | ], 18 | "m_Groups": [], 19 | "m_StickyNotes": [], 20 | "m_SerializableEdges": [ 21 | { 22 | "typeInfo": { 23 | "fullName": "UnityEditor.Graphing.Edge" 24 | }, 25 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"1bf0aa00-186e-4623-83d3-478dfed940e8\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"aab49526-1979-4441-9092-63cde7c820af\"\n }\n}" 26 | }, 27 | { 28 | "typeInfo": { 29 | "fullName": "UnityEditor.Graphing.Edge" 30 | }, 31 | "JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"1bf0aa00-186e-4623-83d3-478dfed940e8\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"aab49526-1979-4441-9092-63cde7c820af\"\n }\n}" 32 | } 33 | ], 34 | "m_PreviewData": { 35 | "serializedMesh": { 36 | "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", 37 | "m_Guid": "" 38 | } 39 | }, 40 | "m_Path": "Daz3D", 41 | "m_ConcretePrecision": 0, 42 | "m_ActiveOutputNodeGuidSerialized": "" 43 | } -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Helpers/LightDirection.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40214558ca16f5048a1d754ba06c4a2c 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Invisible.shader: -------------------------------------------------------------------------------- 1 | Shader "Daz3D/Invisible" 2 | { 3 | Properties 4 | { 5 | } 6 | SubShader 7 | { 8 | Tags { "RenderType"="Opaque" } 9 | LOD 100 10 | 11 | Pass 12 | { 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | 17 | #include "UnityCG.cginc" 18 | 19 | struct appdata 20 | { 21 | float4 vertex : POSITION; 22 | float2 uv : TEXCOORD0; 23 | }; 24 | 25 | struct v2f 26 | { 27 | float2 uv : TEXCOORD0; 28 | float4 vertex : SV_POSITION; 29 | }; 30 | 31 | sampler2D _MainTex; 32 | float4 _MainTex_ST; 33 | 34 | v2f vert (appdata v) 35 | { 36 | v2f o; 37 | o.vertex = UnityObjectToClipPos(v.vertex); 38 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 39 | return o; 40 | } 41 | 42 | fixed4 frag (v2f i) : SV_Target 43 | { 44 | discard; 45 | return fixed4(0,0,0,0); 46 | } 47 | ENDCG 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Invisible.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c046d5f3ea74ec24c898eb60c5f939c3 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Legacy.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a392397b4553d34b9457848354029cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Legacy/Hair.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed6594a0dbb96cc42ae4bf8e9dba1784 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Legacy/IrayUberMetal.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9793753ee9477c4bb2e37bf97e92272 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Legacy/IrayUberSkin.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ff647fecfd0ef24e82997c3606188d6 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Legacy/IrayUberSpec.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09280686f04c105459daf62fbe40bce6 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/Wet.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fc7872334a31ba4e91ed973967cf3f9 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfb653119e8bd41aea8fbdcbd757030f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/GetLightDirectionURP.hlsl: -------------------------------------------------------------------------------- 1 | ////////////////////////////// 2 | // 3 | // Code based on tutorial by Daniel Ilett 4 | // https://danielilett.com/2020-03-21-tut5-urp-cel-shading/ 5 | // 6 | ////////////////////////////// 7 | 8 | void MainLight_half(float3 WorldPos, out half3 Direction) 9 | { 10 | #if defined(SHADERGRAPH_PREVIEW) 11 | Direction = half3(0.5, 0.5, 0); 12 | #else 13 | #if SHADOWS_SCREEN 14 | half4 clipPos = TransformWorldToHClip(WorldPos); 15 | half4 shadowCoord = ComputeScreenPos(clipPos); 16 | #else 17 | half4 shadowCoord = TransformWorldToShadowCoord(WorldPos); 18 | #endif 19 | Light mainLight = GetMainLight(shadowCoord); 20 | Direction = mainLight.direction; 21 | #endif 22 | } 23 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/GetLightDirectionURP.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f287064306441e742a05e0b3cfb7a4a6 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/LightDirectionURP.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 736dbbc5b50d971448241972ec6e8c4d 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU HDRP.Hair.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f57f66772d2cf462ca3f22009608ee3d 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU HDRP.Metallic.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6d20aba7cd04764687c737988e08a2c 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU HDRP.SSS.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a003f09bc8825a048839f5c00ce6be45 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU HDRP.Specular.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63cc86936b4837044aa6b34c7c29d8e5 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU URP.Hair.AlphaBlend.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e96bc5ccbb85e427682e3edf12cd5a2d 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU URP.Hair.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eca376bda456c4f749bd5448ad5e195d 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU URP.Metallic.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7c269126325f424ea6e1c469b57b240 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU URP.SSS.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8956ca4dad2298409844f795adcc87a 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU URP.Specular.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05d4c51f44017bb40b1d2a7a7951c4b3 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU URP.Transparent.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27bff13fafc66434e8033bf2e4d119f3 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.AlternativeSpecularMix.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6eeb53e97f023c48a8cb79b7158eca4 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.Base.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02c03d236c64dfe4488e1d8153d2c141 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.DualLobeSpecular.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 820ebec3841492f4b862e05bc9f8fe69 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.GlossyLayeredEffect.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 365ce85fd3f3f814e874bc06c42137e2 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.Makeup.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1db63cf8a503b8e439ba5d889ca40b58 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.MetallicMix.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4eece1b4a7c58443a4d92c960d67abc 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.SpecularMix.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: debc2f8325bebaa4b8e1b742727de6a6 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.SubSurfaceScatter.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff4238311ea3ad741b249ff31bf8b239 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.TopCoat.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 716e9ece6380cb940bc70d2f4617c8b1 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Shaders/uDTU/uDTU.Sub.TranslucencyMask.shadersubgraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcdf7b528c75ed145b880ba7d1dd782c 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3} 11 | -------------------------------------------------------------------------------- /UnityPlugin/Third Party Notices.md: -------------------------------------------------------------------------------- 1 | This product is based on software by DAZ 3D, Inc. Copyright 2002-2021 DAZ 3D, Inc., used under modified Apache 2.0 License. All rights reserved. 2 | 3 | OpenSubDiv is used under a Modified Apache License 2.0: https://github.com/PixarAnimationStudios/OpenSubdiv/blob/release/LICENSE.txt 4 | 5 | FBX SDK is used under the Autodesk FBX SDK 2020 license: https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-2 6 | 7 | This product contains code from SimpleJSON library, Copyright 2012-2019 Markus Göbel (Bunny83), used under MIT License. All rights reserved. 8 | -------------------------------------------------------------------------------- /UnityPlugin/Third Party Notices.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 240f9fdb36f1d4e4495dd9148ce682e2 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/Vendors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05b2c488f8adc4bbba97249d61a0fd9f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UnityPlugin/Vendors/SimpleJSON.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SimpleJSON", 3 | "references": [], 4 | "includePlatforms": [], 5 | "excludePlatforms": [], 6 | "allowUnsafeCode": false, 7 | "overrideReferences": false, 8 | "precompiledReferences": [], 9 | "autoReferenced": true, 10 | "defineConstraints": [], 11 | "versionDefines": [], 12 | "noEngineReferences": false 13 | } -------------------------------------------------------------------------------- /UnityPlugin/Vendors/SimpleJSON.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25daac269e13e4bb0966a465099a7753 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UnityPlugin/Vendors/SimpleJSON.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f4d12fcd6c214c73b31a1d65f830715 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | --------------------------------------------------------------------------------