Skip to content

2021-06-11 Alpha Build #5

Pre-release
Pre-release
Compare
Choose a tag to compare
@danielbui78 danielbui78 released this 11 Jun 12:38
· 2 commits to dforce-experimental since this release

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