Sunday, April 11, 2021

DForce Simulations


Simulations are no longer created during import. Instead the simulation information is stored inside the imported meshes, and can be recreated with the Advanced Setup > Simulations > Make Simulation tool. See the documentation on the Simulation Section for more information.

Original post:

Many modern clothes use dForce, which simulates draping and movement of garments in DAZ Studio. The corresponding feature in Blender is cloth simulation, which has been considerably improved in Blender 2.90. For some time, Alessandro Padovani has nagged me about including dForce simulations in the DAZ Importer, and finally I got around to do it. Actually, this is not the first time that I attempted to do this, but the previous attempt was half-baked and never took off. Thanks to Alessandro's excellent help, this time things worked out better. We can now import dForce simulations in a useful way with the development version of the DAZ Importer.

First of all, we need to enable Simulation in the Global Settings, otherwise everything simulation-related will be ignored when the file is imported. We then proceed to import the DAZ character as usual. This file contains a Genesis 8 Female with Toulouse hair and the Bardot outfit that ships with DAZ Studio. The Bardot outfit is dForce compatible.
Select the body mesh and open the modifier tab. The body has a new collision modifier, which means that it will act as a collision object. The modifier settings are found inside the Physics tab if you need to change them. The DAZ Importer changes some settings, mainly it increases the collision quality.
The Bardot top has two new modifiers: a cloth modifier and a collision modifier. We can change the settings of both inside the Physics tab, but I left the settings unchanged. For some reason, the Bardot skirt did not receive a collision modifier.
The top and skirt also have subsurf modifiers, but the simulation seems to work better if you delete them. This improved performance from 0.25 fps to 0.30 fps on my machine, and also made the end result better. Perhaps this happens because the Bardot skirt is already a high-poly mesh.
The simulation parameters can be tweaked in the physics tab. One important parameter is the pin group, which is deduced from the dynamics strength parameters in DAZ Studio.
Here is the pin group for the Bardot skirt. The blue region is fully affected by the simulation, the yellow region only slightly.
The next step is to load an animation. I used the file provided by Alessandro.
Here is a typical frame in the animation. The garments has some interesting movements, but in my opinion the wrinkles are too extreme. We need to smooth them out.
Before we do anything else, we need to bake the simulation. Otherwise it will be lost as soon as we change anything. So select the top and skirt, and in the physics tab press Current Cache to Bake (for each garment). The simulation is now baked.
There are several ways that we can smooth the animation. We can e.g. add a Smooth Corrective modifier after the Cloth modifier. The default values for the paremeters work well.
Alternatively, we can add a Smooth modifier and change the Repeat value to 5.
Here is the simulation at frame 80, without and with the smoothing modifiers.