true
    • Shop
    • NFT
    • Technology
    • Community
      • Gallery
      • Masterclass
      • In the Studio
      • Forums
      • Press
      • Blog
    • Help
    • Download Studio
  • Shop
  • NFT
  • Technology
  • Community
  • Help
  • Download Studio
  • Our Community
  • Gallery
  • Masterclass
  • In the Studio
  • Forums
  • Press
  • Blog
Loading...
    • Categories
    • Recent Discussions
Daz 3D Forums > 3rd Party Software > Unity Discussion

Unofficial Updates for DazToUnity Bridge (URP, Built-In, PBRSkin, Anims... dForce?)

danielbui78danielbui78 Posts: 329
May 2021 edited October 2021 in Unity Discussion

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

 

Post edited by danielbui78 on October 2021
«12»

Comments

  • ArtiniArtini Posts: 7,542
    May 2021

    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

  • danielbui78danielbui78 Posts: 329
    May 2021 edited August 2021

    Artini said:

    How can we install your version of the bridge?

    1. For the current development version, go to: https://github.com/danielbui78/DazToRuntime/releases/tag/v0.1-alpha-unity ;https://github.com/danielbui78/DazToRuntime/releases
    2. Download: Unofficial_Daz3D_Bridge.unitypackage
    3. Drag-and-drop Unofficial_Daz3D_Bridge.unitypackage file onto the project pane of the Unity Editor window.

     

    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'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.

    Post edited by danielbui78 on August 2021
  • ArtiniArtini Posts: 7,542
    May 2021

    danielbui78 said:

    Artini said:

    How can we install your version of the bridge?

    1. For the current development version, go to: https://github.com/danielbui78/DazToRuntime/releases/tag/v0.1-alpha-unity
    2. Download: Unofficial_Daz3D_Bridge.unitypackage
    3. Drag-and-drop Unofficial_Daz3D_Bridge.unitypackage file onto the project pane of the Unity Editor window.

     

    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'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.

  • danielbui78danielbui78 Posts: 329
    May 2021

    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.

  • ArtiniArtini Posts: 7,542
    May 2021

    Great news - thanks.

     

  • danielbui78danielbui78 Posts: 329
    May 2021

    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.

  • ArtiniArtini Posts: 7,542
    May 2021

    It is getting better and better. Thanks.

     

  • rjochinskirjochinski Posts: 0
    May 2021

    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. 

     

  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    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.

    Post edited by danielbui78 on May 2021
  • SionSaviorSionSavior Posts: 6
    May 2021

    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...

  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    SionSavior said:

    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?

    Post edited by danielbui78 on May 2021
  • SionSaviorSionSavior Posts: 6
    May 2021

    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.

  • danielbui78danielbui78 Posts: 329
    May 2021

    SionSavior said:

    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.

    No problem.  English is not my first language either.

    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.  

    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.

    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.  

    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:

    1. Create two copies of the geograft part
    2. Fit to / Parent one geograft part to the Genesis figure.  For the other geograft, only Parent but do not use "Fit to...".
    3. Export the "Fit to..." geograft part as OBJ and then reimport that as a custom morph for non-"Fit to..." geograft part.
    4. Select the "Fit to..." geograft part and set it to Hidden.
    5. Export the Genesis figure using the Bridge: select your desired geograft morphs, check mark "Show Fbx Dialog", then click Accept.  On the "Fbx Export Options" dialog window, check "No Hidden" -- this will prevent duplicate geograft meshes from being exported.
    6. In Unity, you should now have the Genesis Figure and a non-Fitted geograft part, all with morphs.  What you need to do now is change the rigging for the non geograft part so that it uses the main Genesis Figure rig.  Hopefully, the hidden-geograft part will have merged its rigging in to the Genesis figure, so that you will have the additional geograft bones available on the main Genesis Figure.

    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.

     

  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    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:

    • Background Info: https://www.daz3d.com/forums/discussion/185546/creating-a-morph-via-script-and-getting-clothing-to-conform-solved
    • bool DzShape::hasAssemblyGeometry ( ) 
    • DzGeometry * DzShape::getAssemblyGeometry ( )
    • DzMorphDeltas * DzMorph::getDeltas ( ) 
    • DzMorphDelta * DzMorphDeltas::getDeltas ( )
    • https://docs.unity3d.com/ScriptReference/Mesh.AddBlendShapeFrame.html

     

    Post edited by danielbui78 on May 2021
  • SionSaviorSionSavior Posts: 6
    May 2021

    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

  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    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.

    Post edited by danielbui78 on May 2021
  • ArtiniArtini Posts: 7,542
    May 2021

    Very interesting, @danielbui78.

    Do you think, it will be possible to add colliders, so clothes will not penetrate the character body?

     

  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    Artini said:

    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.

    Post edited by danielbui78 on May 2021
  • SionSaviorSionSavior Posts: 6
    May 2021

    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

  • ArtiniArtini Posts: 7,542
    May 2021

    danielbui78 said:

    Artini said:

    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.

    Yes, lower part (skirt) works well, but I was thinking about the upper part (shirt or whatever you name it).

  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    Artini said:

    danielbui78 said:

    Artini said:

    .....

    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

    ......

    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.

    Post edited by danielbui78 on May 2021
  • danielbui78danielbui78 Posts: 329
    May 2021 edited May 2021

    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

     

    Post edited by danielbui78 on May 2021
  • danielbui78danielbui78 Posts: 329
    June 2021 edited June 2021

    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:

    • Preliminary support for dForce clothing, cloth physics export (only via the Simulation Properties of the Surfaces Pane of DazStudio).
    • Pregenerated cloth collision skeleton which is automatically merged into animation skeleton of Prefabs created by the Bridge.

    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.

    1. Load dForce compliant clothing onto your figure.
    2. Clear any dForce simulation calculations in the scene by selecting the Simulations Settings Pane and clicking "Clear". Warning: you will NOT be able to undo this procedure.
    3. Select the Surfaces Pane and select the clothing surface materials. For each material, double-check the Simulation Properties Tab to make sure that Dynamics Strength is set correctly: a value of 1.00 will often cause clothing to fall off or explode in Unity. Try setting this to 0.5 if this happens.
    4. Recommend setting one Material's Dynamics Strength to 0.2 or less, to act as an anchor for the rest of the clothing -- example: waist-line of pants and skirts, neck-line of shirts and jackets.
    5. With dForce Clothing still selected, add a Push Modifier via the "Edit->Object->Geometry->Add Push Modifier..." menu command.  This will add a new property in the Parameters Pane called "PushModifier" in the "Mesh Offset" Property Group.  Try 0.1 as an initial value.  It can be increased if you are having cloth collision issues such as clothes exploding.
    6. Select "File->Send To->Unofficial Daz to Unity Bridge".
    7. Open Unity Editor window and wait for DTU import to complete and Prefab to be created in the Scene.
    8. In the Scene Pane, open the imported prefab and select the "Cloth Collision Rig". In the Inspector Pane, you will see the "Cloth Collision Assigner" Script Component.
    9. There are three sections that can be expanded: "Upperbody Colliders" contains a list of paired sphere colliders for the upper body. "Lowerbody Colliders" contains a similar list of paired sphere colliders for the lower body. "Paired" sphere colliders are a two sphere colliders that joined together by the Cloth Physics component into a collision cylinder with differing sized round ends. This way, you can make custom shapes for limbs, torso and other body parts.
    10. You may click on each sphere collider to access the specific sphere collider component within the animation skeleton. You can then adjust the position or size of the collider.
    11. The third section is "Cloth Configuration List". Expand this section and you will see a list of all imported dForce items that have been converted to use Unity Cloth Physics components. Select each item and uncheck "Upper Body" or "Lower Body" to disable any cloth collision skeleton parts that are unneeded by that clothing.
    12. Double click on a Cloth component here will take you to the clothing object that it controls. Do this for each one: Find the Cloth component and check the Sphere Colliders section. You will notice that this is empty. It is filled at runtime (when the project is Played) by the "Cloth Collision Assigner" Script. If you want the list to be populated at Edit-Time, then during runtime, click on the three dots of the component and select "Copy Component". Then stop the project and click the three dots again, now select "Paste Component Values".

    Tips: if clothing falls off or explodes, try decreasing the Dynamics Strength inside Daz Studio and/or increasing the Push Modifier Offset.

    Post edited by danielbui78 on June 2021
  • ArtiniArtini Posts: 7,542
    June 2021

    Thanks a lot for the new build and explanation. Wishing you all the best.

     

  • danielbui78danielbui78 Posts: 329
    June 2021 edited June 2021

    @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?

    Post edited by danielbui78 on June 2021
  • SionSaviorSionSavior Posts: 6
    June 2021 edited June 2021

    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... 

    Hierachy - Imgur .. Picture not shown here :-(  - Picture is Save XD

    Here are the instructions:

    In Daz:

    1. 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)

    2. 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 

    3. 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.

    4. Export as FBX

    5. 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. 

    Post edited by SionSavior on June 2021
  • danielbui78danielbui78 Posts: 329
    June 2021

    @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.

  • danielbui78danielbui78 Posts: 329
    June 2021 edited June 2021

    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:

    • Smoother Unity Files installation with automatic dialog popup, RP detection and by proper importing of first asset.
    • UI tweaks such as Daz3D menu command order, Install/Overwrite Unity Files checkbox.
    • New Unity Cloth Tools component to bulk edit weights by material groups, save/load weight maps.
    • Optimized HDRP and URP shadergraphs to use a single Sampler node.

    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:

    1. Load dForce compliant clothing onto your figure.
    2. Clear any dForce simulation calculations in the scene by selecting the Simulations Settings Pane and clicking "Clear". Warning: you will NOT be able to undo this procedure.
    3. Select the Surfaces Pane and select the clothing surface materials. For each material, double-check the Simulation Properties Tab to make sure that Dynamics Strength is set correctly: a value of 1.00 will often cause clothing to fall off or explode in Unity. Try setting this to 0.5 if this happens.
    4. Recommend setting one Material's Dynamics Strength to 0.2 or less, to act as an anchor for the rest of the clothing -- example: waist-line of pants and skirts, neck-line of shirts and jackets.
    5. With dForce Clothing still selected, add a Push Modifier via the "Edit->Object->Geometry->Add Push Modifier..." menu command. This will add a new property in the Parameters Pane called "PushModifier" in the "Mesh Offset" Property Group. Try 0.1 as an initial value. It can be increased if you are having cloth collision issues such as clothes exploding.
    6. Select "File->Send To->Unofficial Daz to Unity Bridge".
    7. Open Unity Editor window and wait for DTU import to complete and Prefab to be created in the Scene.

    Cloth Colliders:

    1. In the Scene Pane, open the imported prefab and select the "Cloth Collision Rig". In the Inspector Pane, you will see the "Cloth Collision Assigner" Script Component.
    2. There are three sections that can be expanded: "Upperbody Colliders" contains a list of paired sphere colliders for the upper body. "Lowerbody Colliders" contains a similar list of paired sphere colliders for the lower body. "Paired" sphere colliders are a two sphere colliders that joined together by the Cloth Physics component into a collision cylinder with differing sized round ends. This way, you can make custom shapes for limbs, torso and other body parts.
    3. You may click on each sphere collider to access the specific sphere collider component within the animation skeleton. You can then adjust the position or size of the collider.
    4. The third section is "Cloth Configuration List". Expand this section and you will see a list of all imported dForce items that have been converted to use Unity Cloth Physics components. Select each item and uncheck "Upper Body" or "Lower Body" to disable any cloth collision skeleton parts that are unneeded by that clothing.
    5. Double click on a Cloth component here will take you to the clothing object that it controls. Do this for each one: Find the Cloth component and check the Sphere Colliders section. You will notice that this is empty. It is filled at runtime (when the project is Played) by the "Cloth Collision Assigner" Script. If you want the list to be populated at Edit-Time, then during runtime, click on the three dots of the component and select "Copy Component". Then stop the project and click the three dots again, now select "Paste Component Values".

    Cloth Physics Weight Maps:

    1. Select dforce clothing in the Scene Pane and you should see the Cloth Physics Component in the Inspector Pane.
    2. Below the Cloth Physics Component is a new "Cloth Tools" component that contains convenience features for working with cloth physics weight maps.
    3. The first section lists all the material groups within the current dforce item. Each one contains a slider and number textfield and a "Set" and "Clear" button.
    4. Use the slider or textfield to enter a decimal number then click "Set" to assign that number as the "Max Distance" to all vertices within that material group. Note: "Max Distance" is the maximum distance a vertex can travel from its original position due to cloth physics and is measured in Unity worldspace units. That means a value of "1.0" will let a vertex move up to 1 meter in the world. The slider will move up to 0.2 units (20 centimeters) but the textfield can be used to enter a value of any size.
    5. Click "Clear" to remove all constraints, represented by a black sphere. This will let the vertex travel an infinite distance from its original position due to cloth physics.
    6. "Load Weightmap data" can be used to load Unity Weight Maps or Dforce Weight Maps. You can use the drop down menu in the load file dialog to choose which file types to filter or to see all files. The Unity Weight Maps are raw binary dumps of the floating point information for MaxDistance values of the selected item. The Dforce Weight Maps are raw binary dumps of the unsigned shorts (16bit) information from the Daz Studio "Dforce Weight Node Modifier / Influence Maps". Dforce Weight map files are automatically created if Daz item contains a Dforce weightmap.
      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.
    7. "Save Weightmap data" will popup the save file dialog to let you save the current weightmap in a Unity-compatible Weight Map format.
    8. "Load Gradient Pattern" will create a gradient pattern from 0.0 to 1.0 from index 0 of the weightmap to the last index of the weightmap.
    9. "Zero All Weights" will set the entire weightmap to 0.0.
    10. "Clear All Weights" will remove all constraints from the entire weightmap and allow infinite distance to be travelled by cloth physics.

    Tips: if clothing falls off or explodes, try decreasing the Dynamics Strength inside Daz Studio and/or increasing the Push Modifier Offset.

    Post edited by danielbui78 on June 2021
  • danielbui78danielbui78 Posts: 329
    June 2021

    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).

  • crdev0crdev0 Posts: 0
    June 2021

    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.

«12»
Sign In or Register to comment.
Adding to Cart…

Daz 3D is part of Tafi

Connect

DAZ Productions, Inc.
224 S 200 W, Suite #250
Salt Lake City, UT 84101

HELP

Contact Us

Tutorials

Help Center

Sell Your 3D Content

Affiliate Program

Documentation Center

Open Source

JOIN DAZ

Blog

About Us

Press

Careers

Bridges

Enterprise Licenses

Community

In the Studio

Gallery

Forum

DAZ STORE

Shop

Daz+

Freebies

Published Artists

Licensing Agreement | Terms of Service | Privacy Policy | EULA

© 2023 Daz Productions Inc. All Rights Reserved.