Unofficial Updates for DazToUnity Bridge (URP, Built-In, PBRSkin, Anims... dForce?)
Last Update, 2021-10-03: Unofficial DTU Bridge is now at version 1.1+, please go here for the latest downloads and information: https://www.daz3d.com/forums/discussion/518681/released-unofficial-dtu-bridge-v1-0
I have started an unofficial update project for the DazToUnity Bridge. Everyone is invited to fork and participate in the development. Just like the original version by Daz, it's open-source under the Apache license and available on github: https://github.com/danielbui78/DazToRuntime
Here are some of the bugfixes and feature updates:
- Compatible and installable alongside the Official Daz-To-Unity Bridge.
- Fixed a few bugs related to key-material-name generation and specular lobe roughness texture importing
- Added preliminary support for figures that use the new PBRSkin shaders
- Added preliminary support for Universal Rendering Pipeline and Built-In Rendering Pipeline.
- Autodetection/autoconfiguration system for the different pipelines
- Enabled animation export from inside the DazToUnity Bridge
- Animation exporting is enabled through the Animation asset type and disabled when exporting Skeletal or Static Mesh.
- Timeline animations are exported with sequentially numbered "@anim0000.fbx" filenames, which increment with each export operation.
- Unofficial Bridge can be downloaded as either a DazStudio plugin with embedded Unity plugin, or as a separate .unitypackage containing just the Unity plugin.
I'm still cleaning up code and UI elements, and optimizing performance of the new shaders, but everything seems to be working well enough for people to test out and have fun:
Updated 2021-Aug-21: https://github.com/danielbui78/DazToRuntime/releases/tag/v0.5.1-alpha-unity
Here is a screenshot of using Daz's original plugin: (Notice the bug causing the pants to be garbage texture) https://www.mediafire.com/view/yt882mxy3xgm9ec/Original_screenshot.jpg/file
And here are the screenshots using the unofficial update:
Bugfixed HDRP: https://www.mediafire.com/view/h6zkn0enwll9vwo/HDRP_screenshot.jpg/file
New URP: https://www.mediafire.com/view/2ar2wz5dgbcqoka/URP_screenshot.jpg/file
New Built-In: https://www.mediafire.com/view/s8aqf4b0mjz9vf9/BUILTIN_screenshot.jpg/file
Comments
Wow, thank you for doing it - very, very interesting.
I am in the middle of the big project in HDRP, but later I could try.
How can we install your version of the bridge?
By the way: do you have any idea about how to transfer morphs from the older items from Daz 3D,
like the freebie EmotiGuy? https://www.daz3d.com/emotiguy
It has 41 facial expressions, but none of them are transferring to Unity.
I was stacked at it and could not help the fellow Unity user:
https://www.daz3d.com/forums/discussion/492886/importing-emotiguy-to-unity#latest
I'll try to look into that... [EDIT] ...it doesn't seem to be an issue with the DazToUnity Bridge, but with the underlying FBXExporter module itself -- DzFBXExporter does not seem to recognize the existence of those morphs.
Thanks a lot for explanation and checking out EmotiGuy issue. I actually like the look of EmotiGuy in Unity, so I will continue my quest.
FYI, I just fixed the DazStudio plugin to enable animation exporting, and embedded the updated unitypackage into the DS plugin. Go to https://github.com/danielbui78/DazToRuntime/releases/tag/v0.2-alpha-unity for instructions to install the DS plugin or the updated unitypackage.
Great news - thanks.
New version posted:
Go to https://github.com/danielbui78/DazToRuntime/releases/tag/v0.3-alpha-unity to download files and read instructions to install plugin.
It is getting better and better. Thanks.
omg. I love you.
I've literally been going ape shit trying to get any animations to work nicely within unity.
I have to be SOOOOOOOOOOO careful that I don't create any sort of accidental motion that won't allow me to convert a generic -> humanoid rig in unity after using the bridge to export, and then exporting the same asset again with animation as an fbx. The workflow has been utter hell. It's a shame that they release features that don't even work in the bridge (animation export doesn't do anything), why not withhold them instead aha.
Work-in-Progress: Experimental dForce Support:
There is no packaged release with this feature yet, just work-in-progress source code: https://github.com/danielbui78/DazToRuntime/tree/dforce-experimental
This new bridge feature will export Daz dForce settings from the Simulations section of dForce enabled materials in the Surface Pane. It then imports those settings into Unity Cloth components, which it adds to the gameobjects that are using these dForce enabled materials. It then generates a Unity Cloth weightmap from the submesh vertices of each material group and the Dynamics Strength value for that material from the Daz Studio side. Right now, I'm working on making a sphere collider body to add to the Unity Prefab skeleton. It's currently pretty rough when you activate the game. I need to calibrate the transfer of simulation settings from Daz Studio to Unity, since right now, almost everything is a 1-to-1 transfer of coefficient values. Daz Studio dForce Weightmap modifiers are not currently supported.
The bridge works great but only as long as it is only the base mesh that is to be exported. As soon as morphs are included that no longer belong to the base mesh then the bridge does not work exactly as with the official version.
As an example:
Male -> base mesh -> works
Male -> base mesh with additional parts like genital (no morph) -> works
Male -> base mesh with morphs -> works (at least most of the time)
Male -> base mesh with additional parts like genital with morphs -> NOT working.
Some morphs are exported / imported from the base mesh but all morphs concerning the additional parts (in this case genital) are ignored.
The same applies to the females and some other tests...
Too bad I had the hope that it was finally fixed...
Nevertheless, thanks for the effort. Great work so far...
Thanks for the feedback! Could you please clarify: do you mean that this is a bug that exists also in the official version of the Daz to Unity bridge, or are you trying to report a new bug that is only present in this unofficial version?
I will try to look into this issue when I have time. I do know that there is an issue with the FbxExporter which causes props and geoshells to be exported without proper rigging to the main figure. Maybe this is the same thing? I have read that there are workarounds for getting exported props to be rigged to the main figure, but I have not tried these techniques yet, and I do not know if that will work for other things.
UPDATE 1:
I've tried exporting genital morphs with both the official and unofficial bridges and confirm that they are not exporting. The problem appears to be in the DzFbxExporter module, which does not recognize the existence of the genitals. A common misunderstanding is that being able to see and select Morphs in the "Choose Morphs" dialog means that your morphs will be exported to Unity. This is not completely correct. Selecting morphs in this window is only a REQUEST for morphs to be exported. Daz to Unity does not actually do the direct export. When you choose morphs, Daz to Unity bridge will convert your selections into "Morph Export Rules" which the DzFbxExporter module will understand. You could also skip the "Choose Morphs" panel and create the "Morph Export Rules" directly inside the FBX Options Dialog (see below), but I think many people will find the "Choose Morphs" feature easier to use.
If you check the "Show FBX Dialog" checkbox on the Unofficial Daz to Unity dialog box, you will be presented with the DzFbxExporter's options panel after clicking Accept. This is the actual module which performs the FBX export and file generation; the Daz to Unity bridge only handles the preparation of the scene data prior to FBX export and the creation of the DTU file which contains the metadata information. FYI, the instructions to create the "Show FBX Dialog" checkbox are part of the official Daz to Unity Bridge source code, but they are just hidden and not compiled into the released version.
https://www.mediafire.com/view/ssgiycto7kn9n5v/UnofficialDTUBridge_-_Show_FBX_Options.jpg/file
https://www.mediafire.com/view/rim4w7lhdpu8bjp/FBXExport_-_no_genitals.jpg/file
Anyway, within the "FBX Export Options" dialog, you will see that the Genesis figure, hair, clothes and other props will appear in the "assets to be exported" panel, but genitals are NOT present. This suggests that the FbxExporter is unaware of the existence of the genitals: this means that it can not directly read the genital scene object data and can not export any morphs from an object it does not even know exists.
I will need to do more research to figure out how exactly the gentals differ from clothing or hair objects which prevent the DzFbxExporter module from seeing it. However, maybe if someone knows how to convert the genitals into a regular piece of clothing, then maybe the FbxExporter will be abe to see it and then be able to export morphs associated with it. In previous versions of Genesis, I remember that there were third party genital assets available that were created in this way: as regular clothing instead of geografts or geoshells. If someone is more familiar with this, please let us know if morphs for those assets work with FbxExporter and the Daz to Unity bridge.
UPDATE 2:
I was able to convert the genital to prop and export to Unity successfully. The morphs need to be exported from the original object into OBJ format and then imported back into the converted prop with Morph Loader Pro. You can also convert from prop back to figure, but I haven't been able to transfer the rigging / morph information back to the Figure-to-Prop-back-to-Figure object. I think you might be able to use the Transfer Utility to do this, but I'm not an expert in using that. Here is a helpful post about geograft to clothing: https://www.daz3d.com/forums/discussion/174126/converting-geograft-to-regular-conforming-item-inside-ds
Current issues: How to transfer back rigging from geograft back to non-geograft object? How to easily transfer back morphs so they can be easily combined?
Thank you for the detailed answer. I was really surprised that it is so much.
First of all, English is not my main language so I will probably sound quite strange, but I can understand everything.
I see that you have already figured out everything I could tell you.
My problem is that I'm an indie developer who currently still exports and re-rigs everything by hand and then has to animate everything by hand. This process takes an enormous amount of work and time. That's why I was very happy about the bridge. Of course, the work is already facilitated by this, however, adult games but also medical programs belong to the daily work and accordingly it annoys me that exactly here the bridge fails when it comes to certain details.
What surprises me is the following:
The morphs are not displayed when you want to export a model with the corresponding body parts (genital).
However, if you want to export only the genital without a corresponding model (only the genital) then you will find in the export window and the export rules a rather long list with the corresponding morphs including bones and more.
This in turn tells us that the information must be somewhere.
I have tested the following:
I loaded the corresponding body part into the scene. Export (morphs are displayed)
Now I loaded a model. Selected all meshes and exported. ( All morphs are displayed)
Now I used "Fit to Model" to fit the body part to the mesh -> Export Now the morph information has disappeared and only that of the Male Base Mesh is visible.
My problem is mainly that I don't understand why this information disappears. Actually, the additional information from the body part should be visible there or at least in the corresponding subitem. It's not like this information, which was there before, has disappeared all of a sudden. Finally, you can still adjust everything in the parameters. Somewhere the information must be stored.
No problem. English is not my first language either.
I'm actually working on the bridge to speed up my own indie development process. I am making a game based around the Centaur models, so it is also very important for me to get the bridge to easily and quickly export figures with geograft morphs. So don't worry, I won't completely give up on this issue, although I may have to prioritize other features first.
Thanks! This was very helpful information to me to better understand the ways that DzFbxExporter / Daz Studio interact with geograft items that is different from how they interact with non-geograft items. Here is a temporary workaround that seems to be almost fully working for me:
I will try to test this out more when I have time -- right now, I'm trying to finalize the dForce feature additions. Once we know of a process that works 100%, then, hopefully, I can incorporate the steps to be done automatically by the Daz and Unity Bridge plugins.
I've been reading several Daz Forum threads on geografting and how to access the combined mesh using DzShape::getAssemblyGeometry(). Then I read this thread here: https://www.daz3d.com/forums/discussion/45363/vertex-indices-on-geografted-figures which immediately made everything clear to me regarding the issue with DzFbxExporter not exporting morphs for genitals and other geografted parts.
I was wrong before: DzFbxExporter is completely aware of the existence of the geografted parts, but when it detects that those parts have been geografted onto a base figure like Genesis, the DzFbxExporter will disable exporting of the individual geograft object to avoid duplication of the mesh, because the mesh is already merged / baked into the a submesh as part of the base figure, using DzShape::getAssemblyGeometry().
Unfortunately, what it does not do (probably because there is no convenient library function to do this) is convert the morphs from the geograft part into a morph for the base figure. However, as long as the submesh in the merged base figure contains the exact same number of vertices and ordering, which I assume it does from the information from the thread that I linked above, then it should be a trivial alogrithm to create new Unity blendshapes by taking the resulting assembled geometry, then zero-ing out the base figure vertices (to make the vertex Delta be zero) and then copying the vertex Delta values from each morph into the correct location for the submesh vertices corresponding to the desired geograft.... I will definitely put this on the todo list to try out!
Here are the pieces to the solution:
I have looked at the new information and unfortunately I have to say that I am not so far advanced in the matter of DAZ. It seems to be a bit more complicated than I first thought.
However, I understand what you want to aim.
Nevertheless, I will work my way into the matter and hope that I can subsequently contribute something to support the project, which has now been started. hehe
Here is a demonstration of the experimental dForce to Unity Cloth physics support:
This version is not yet packaged or uploaded to github yet. I need to take a break but will try to package the files and upload to github in a few hours.
Very interesting, @danielbui78.
Do you think, it will be possible to add colliders, so clothes will not penetrate the character body?
Hehe, take a closer look at the video in fullscreen and high resolution: that is exactly what is going on -- I just need to tweak the size of some parts to prevent clipping into parts of the legs. Here is the cloth collision skeleton that was not being drawn:
https://www.mediafire.com/view/5vk5s1sedf2qy83/cloth_collision_rig.jpg/file
BTW, I have all of the source files uploaded, but I have not released a compiled package yet because I don't think it's in a state to be user-friendly for non-technical people. I'm currently trying to add more automation and convenience features so that it works in most cases without a lot of extra adjustments. Unlike the main unofficial branch, where most things just work, the dforce-experimental branch currently requires people with more knowledge about how to dforce/skin/rig/weightpaint items to make fine-tuning.
WoW.
You've done a really good job. I am really surprised! Well done!
If now still my problem is solved, which I had already requested and after you still finished what you wanted to do, then the bridge is almost perfect for me XD
Yes, lower part (skirt) works well, but I was thinking about the upper part (shirt or whatever you name it).
Yes, sorry I should have said "legs and upper body" instead of just "legs". Please take a look at the image that was linked and you will see there are sphere colliders all over the upper body as well as the lower body. The problem is that those colliders were made too small in the video. If they were not there, then the frills on the shirt would completely go through the entire body instead of being stopped a few centimeters under the skin of the chest and arms.
I plan to work on an automated script to resize these pre-generated colliders based on the shape and geometry of the Daz figure, but that will not be ready soon -- but I think it's still much more convenient to have the colliders pre-generated and automatically merged into the animiation skeleton, so that you can just to modify the size and position of the spheres, instead of doing this entire process by hand.
Right now, I am still working on supporting the newer dForce clothing that rely on weightmap data painted on with the "dForce Modifier Weight Node"... I have the weightmap data exported as raw bytes, but it looks like the vertex ordering of the FBX is different from Daz Studio... I need to do more testing and maybe call in the Daz 3D experts for inside information with regards to any FBX changes with vertex / submesh ordering.
After some more testing, I realized that the current dForce branch is actually more usable than I first thought. I'll try to cleanup a few experimental hooks and package it as a new Alpha Pre-Release on github. Please note: if you don't know anything about dForce or Unity Cloth physics, then this is probably too advanced for you, at least for now. But if you do have some knowledge about it, then this version could save you a lot of time rather than doing it from scratch. **dForce WeightNodes are not yet supported**
This video is a demonstration of several features: 1) PBRSkin support, 2) Animaton exporting, 3) dForce support
I just posted a new pre-release version of the Unofficial DazToUnity Bridge with partial dForce support. You can download it on github: https://github.com/danielbui78/DazToRuntime/releases/tag/v0.4-alpha-unity
Here's everything to know about it so far:
New in this version:
Installation Instructions
The "unofficialdzunitybridge_v04.7z" file should be unzipped and the "unofficialdaztounitybridge.dll" file should be placed in the plugins folder of Daz Studio (example: "\Daz 3D\Applications\64-bit\DAZ 3D\DAZStudio4"). Daz Studio can then be started, and the bridge can be accessed from the main menu: File->Send To->Unofficial Daz To Unity. The embedded Unity plugin can be installed with the "Install Unity Files" option, just like the official DazToUnity Bridge.
Alternatively, you can install the "Unofficial_Daz3D_Bridge_v04.unitypackage" by drag-and-dropping it into the Project pane of the Unity Editor window, if you want to install it without using the DazStudio plugin.
You do Not need to do both.
To Test dForce Clothing to Unity Cloth Physics support:
Make sure you save your DazStudio project before taking these steps, some will Not revert with Undo command.
Tips: if clothing falls off or explodes, try decreasing the Dynamics Strength inside Daz Studio and/or increasing the Push Modifier Offset.
Thanks a lot for the new build and explanation. Wishing you all the best.
@SionSavior:
Following these steps with Unity Bridge might help you: http://davidvodhanel.com/daz-to-unreal-transferring-morphs-on-geografts/
It did not work for centaur morphs, but I realized that it does work for simple male genital "morphs" that only affect pose properties (morph properties will do nothing). I was able to export morphs to Unity for the following properties: Length, Width, Default Pose -- however, the Unity blendshape sliders do not seem to be moving the underlying skeleton/bone rig, so I'm not sure exactly what FBXExporter and Unity Engine are doing with export of pose controls to blendshapes; maybe baking Daz skeletal poses of the geograft into mesh morphs?
Hello,
I have finally found a solution that seems to work. At least except for one small problem.
I managed to export everything properly and get the corresponding blendshapes where they belong.
But now the corresponding mesh is hidden by a second mesh which is created during the export. When this mesh is deleted everything works.
Edit.1: or you can hide it in unity and everything looks good so far. I can say now it works for male parts...
Here are the instructions:
In Daz:
Setup model in daz + gens. No clothes or hair yet just the model + gens addon. You should set the uv now(eg select the texture you want). ( Optional: you can use clothes too .. but it need more time)
In the parameters window on the model set resolution to base and sub division level to 0. Optional: I dont use this .. XD it works fine
Select merge fitted geometry option in daz (if you dont see it you can add it in window->workspace->customize->actions->geometry editting. Stick it under any menu you like). What this does is merge the gens to the character and hence merges the blendshapes when you export.
Export as FBX
Find the exported files and rename the directory ending in .images to .fbm . Then copy both the directory and the fbx file to unity. (optional) because i used the bridge
I'm sure you can build something useful out of it if even I noob could manage it ;) :)
After work I will look at the whole thing a little more closely and post updates if there is something new or I have changed steps.
@SionSavior:
Thanks for the information! I will definitely try your instructions when I get a chance. Right now, I'm still working on getting dForce weightmap data exported correctly and imported into Unity. I had to work out several issues related to remapping of SkinnedMesh vertex indexes to Cloth Simulation vertex indexes, but I think I've finally gotten it correct. Now, I just need to get the correct order for the vertex positions coming from the DzWeightmap::getWeights() method. Once that's done, I'll try to get your geograft steps working and automated.
There is a new pre-release version of the Unofficial DazToUnity Bridge posted to github: https://github.com/danielbui78/DazToRuntime/releases/tag/v0.5-alpha-unity
This is the fifth alpha build of the Unofficial DazToUnity Bridge, packaged as both a DazStudio Plugin with embedded Unity Plugin installer and a separate Unity Plugin .unitypackage installer.
New in this version:
Installation Instructions
The "unofficialdzunitybridge_v05.7z" file should be unzipped and the "unofficialdaztounitybridge.dll" file should be placed in the plugins folder of Daz Studio (example: "\Daz 3D\Applications\64-bit\DAZ 3D\DAZStudio4"). Daz Studio can then be started, and the bridge can be accessed from the main menu: File->Send To->Unofficial Daz To Unity. The embedded Unity plugin can be installed with the "Install Unity Files" option, just like the official DazToUnity Bridge.
Alternatively, you can install the "Unofficial_Daz3D_Bridge_v05.unitypackage" by drag-and-dropping it into the Project pane of the Unity Editor window, if you want to install it without using the DazStudio plugin.
You do Not need to do both.
To Test dForce Clothing to Unity Cloth Physics support:
Make sure you save your DazStudio project before taking these steps, some will Not revert with Undo command.
Preparation:
Cloth Colliders:
Cloth Physics Weight Maps:
Note: In Daz Studio, this value is multiplied by the Dynamics Strength for the corresponding material group. However, the imported Unity value is not currently multiplied by the corresponding material group because the vertex ordering of the raw Dforce weight map has not yet been decoded.
Tips: if clothing falls off or explodes, try decreasing the Dynamics Strength inside Daz Studio and/or increasing the Push Modifier Offset.
Just to clarify, for the latest v0.5 release: DForce Weight Modifier Nodes (aka DForce influence maps, aka weight maps) are not yet supported... I have the weight information exported, but I don't yet know which weight corresponds with which vertex (vertex ordering).
Wow, this is seriously incredible work! I don't think anyone else is doing what you're doing with these improvements to the Daz to Unity pipeline. Thanks for sharing this with us! I'll be following your progress with great interest.