Animation: Unreal Engine 5.4, Chaos Cloth, DAZ Studio and Marvelous Designer

    Updated 21Nov 24



This is a quick record of how DarkAelf Studios is (November 2024) bringing cloth assets created by the 3D apparel designer Faezeh Najafi into Scarborough 1264 (one of the films DarkAelf is working on).  This area is changing fast - the information here will fall out of date fast.


Creating Chaos cloth (realistic cloth dynamics in animations) is a memory intensive process and it is still in its infancy. Crashes happen. Protect yourself before proceeding.  Don't leave actors hanging around on cinematic sets - if they crash, you may not be able to reload a level, particularly if they are impacted by Engine changes (eg, material substrate).

By way of simple comparison, the USD process (workflow A, below) is simple and holds out greater opportunities for accurate simulation. A test model resulted in a blueprint actor that shows a size of 850+Mb in memory.  The static mesh process  (workflow B, below) will generate nonfatal skinning errors, will take a lot more time to prepare (decimation and delays inside the cloth physics graph) but can be optimized inside the Engine. Under Workflow B, an equivalent model (optimized with a separated chaos cloth element and a follower element) resulted in a 490+Mb blueprint actor.  Both of these figures probably understate the real load on memory.  Workflow A produces a better visual outcome*. Workflow B might be necessary having regard to memory considerations (if you have a lot of actors on scene).   (*in recent tests, after preparing this article, we encountered weird displacement issues with some of the materials created by Unreal Engine in USD - if you suddenly find actors arms going through bodies - you may need to create simple material substitutes.)


The rest of this post considers the two different workflows:


WORKFLOW A: USD Workflow for DAZ Genesis 8/8.1 characters in Unreal Engine

USD is a file format used by recent versions of Marvelous Designer for apparel. It contains within it a range of information about the quality of cloth (stiffness/tension/surface structure) used in the apparel - and which can simulate the cloth during animation in Unreal Engine. 

1: Ensure that the USD file you want to convert into Chaos cloth was created using a DAS 8/8.1 skel AND was constructed using a rigged body which has the same rigging and shape as the actor you plan using it with. (Generally, this means the same shape as a base genesis actor). Organize your USD files into a handy permanent directory (if you move them downstream, things may break).

(It is worth having a look at what is happening in Marvelous Designer - long known for amazing clothing - it is exploding into amazing CG work. And it is an amazing tool to quickly do retarget/sizing draping of garments between radically different character rigs. However, for our purposes, note that the makers of Marvelous Designer suggest that their creators work with cloth models using a particle distance set at an average distance of 20mm (a little less than an inch).  However, they suggest that the finished cloth be finalized at 5mm (about 1/4 inch). A garment saved at 5mm is a beautiful thing - and it takes up a massive amount of space.  In exploring our options here, Faezeh helpfully produced test apparel at a number of different points - including 26mm and 18mm. 26mm produced tiny USD files that fly thru the chaos cloth process, but to my eye I wouldn't want to go above 18mm for any cinematic purposes that needs close in-focus camera work.)  (*in recent tests, after preparing this article, we have been able to bring assets produced at 12mm into the Engine with only the occasional crash).

2: Bring a base G8.1 male/female into UE 5.4+. (Image 1)  We bring the character in using David Vodhanel's Daz to Unreal Bridge with some guidance from Jay Versluis. We import the character 'Right Facing' which has implications in step 7 below. We remove all clothing/hair/shoes/items from the model (these are recombined in step 13 below using a Blueprint). Often time we will also modify a base actor to remove surface skin that will be hidden under clothes.

3: Right click the skeletal mesh in the content browser and press Create:PhysicsAsset:Create (Image 2) and then create a new Physics Asset using a "Single Convex Hull" as the primitive type (Image 3). Give the new asset a name you will remember.

Image 2


Image 3

4: Right click in the context browser and create a new Physics:Cloth Asset (Image 4).  Name it, and then open it. (Image 5).

Image 4


Image 5


5: Look at the bottom left of the graph and select the USDImport node. (Image 6). In the 'Level of Details' window you will see a place you can add the USD file we stored in step 1. (Image 7)  A message will flash up saying "Evaluating nodes".  If the USD file is too big, that message may never go away.  If the USD file is about 2Mb and you have plenty of memory, it should only take a couple of seconds. 


Image 6


Image 7


6. Dont touch anything!. Save All.

7: When loaded, you will see the dress pattern appear. (Image 8). 

Image 8

You can toggle the appearance here (Image 9 & 10). 

Image 9 - @ top right




Note the facing of the asset (here front facing right). Resist the urge to rotate around it! If you imported your base G8.1 character "right facing" we have to change the facing of the clothing. Click on the second node "TransformPositions" (Image 11) then go to the node details tab and make the 4 changes indicated (Image 12). Each change takes a little time. Save All. if you get a crash here, try again with the maximum amount of memory you can spare. If you keep crashing, try a smaller USD file :(  If you dont crash, you will see that the dress has changed orientation without you touching the camera. (Image 13) If is pointing a different direction - you changed the wrong parameter. Go back to the start of this instruction.

Image 11


Image 12 (tick Transform 3Dsi.. and Transform Render then add -90 in the two positions indicated.

Image 13

8: Click on the next node (Transfer Skin Weights NOT the preview mesh pane). Go to the Node Details and add your skel mesh (Image 14). There will be a delay as it evaluates. Save All.

Image 14


9: Now check we have everything in the right place.  Go to the preview tab and add your skel mesh to the Preview Pane. You may very gently back the camera out until the dress and figure come into view.  Add a simple anim to the pane and check the cloth is following the skel. (Image 15). Stop the animation - it causes crashes. If everything fits, great. If not, then theoretically you can use the 'TransformPositions" node to nudge/grow the clothes into place, but dont count on it.  (* note that if you cannot see the asset in the preview screen, the item may have been transfered at the wrong size.  Trying to resize inside the clothing graph is buggy and it may be better to retrace your export process from Marvelous Designer.)

Image 15 (showing the actor's foot in the preview pane)

Image 15 - Camera backed out a little. Note that an anim here might kick the actor and clothing into a different facing - that is not an issue - just make sure they are working together.



10: Now move along the Graph to a yellow blotch and a node called Set a Physics asset (Image16).  Add the physics asset we created in step 3 in Node Details.  You can crash here if you try creating a new one on the fly.  If you skipped step 3, dont risk it - use the default one and come back and change it when everything is finished and saved.


Image 16


11. Almost done. Go back to the node called "Addweightmap_MaxDistances". When you click it you get new panes to help you paint where the cloth should distort. (Image17)  Toggle the view option so you are looking at the dress plan. (Image18)  


Image 17


Image 18


Note that everything is black - black stuff doesnt move - white stuff does.  Here I want the bottom of the dress to move - slightly. Increase the brush size to '1'* - check the white draw brush that will appear when you mouse over the dress pattern (*the size of the draw brush can change from time to time - sometimes you will need to set it low, sometimes high - this may be dependent on the number of particles in the cloth you are working with). Reduce strength to '0.2'* (*ok - this is experimental and depends on the cloth you are working with - dont hesitate to go down low to get a balance between the shirring and creases in your cloth asset and distortion caused by movement - i am presently trying '0.05' with one cloth) .  These numbers might be different for you - this is a place you need to come back to experiment. Then paint the bottom of the dress so: Image18. Then Brush:Smooth between the black and the grey we just painted. Image19. (IN time you may come back and try a much more nuanced paint covering more (but not all) of the dress.) And Save All (we get crashes with this if someone three desks down sneezes.)  

It is worth playing around with the mesh visibility settings in this pane. With one recent asset we found cloth was surrounded by an attractive piece of cloth piping - asking the cloth to flap at the edge simply breaks the model. 

Another Image 18


Image 19 - note smoothing between black and white..


12. Press Accept and in your preview pane the dress will move slightly. Save and quit before it crashes. If you get to this point and save successfully, it will never crash again. Well, hardly ever.

13. Create a Blueprint actor. In the Component Tab, add your skeleton mesh to the DefaultSceneRoot, and then a Chaos cloth node to it. (I add optimized static mesh hair and shoes at this stage as well) 








WORKFLOW B: Static Mesh Workflows for any mesh


In Unreal Engine 5.4, Epic provides an alternative process for converting static mesh assets into chaos cloth.  This process is buggy (particularly if you are using dodgy mesh), takes far more time than the USD process, and will throw up annoying non-fatal skinning errors. Still, the results are pretty good and can be optimized within the Engine, so is worth considering.

We will give the example of a DAZ actor and compatible clothing - but this can be used for any mesh where you can separate actor and clothing - PROVIDING that the clothing fits the actor.  The proviso is important - as of 5.4 Unreal Engine only offers very basic tools for refitting imported clothing to actors with different shapes - and those basic tools will inevitably lead to poke throughs in animation use. This is not a workflow for creating clothing for an infinite number of  different shaped actors.

1. Create an actor in DAZ, and cloth it.  Many of the clothing assets of the 3D apparel designer Faezeh Najafi will fit the basic Genesis 8/8.1 male/female out of the box.  Some of her more recent models are designed to fit metahumans - but can be redraped to almost any character mesh (eg Gen 8) in the most recent versions of Marvelous Designer. If you parent the clothing to the base Genesis character and then save it as a clothing asset, DAZ will automatically reshape the clothing to a differently shaped DAZ character within that studio software.

2. Export ONLY the actor as a skeletal to Unreal Engine using  David Vodhanel's Daz to Unreal Bridge.  If you are new to this, take a moment to watch his guides - and you will also gain assistance from tutorials from Jay Versluis

3. Export the clothing to Unreal as a STATIC mesh (remember that the transferred actor and clothing must fit - there is no present workflow for accurate re-fitting inside Unreal). In its raw form, the static mesh will probably have too many vertices to be used in this alternate workflow to create chaos cloth so we will need to 'decimate' the clothing item to allow it to be used within this workflow.  

Before decimating, we sometimes use the modeling tools in Unreal to separate the clothing assets into individual items (Image 20)  - eg, a shirt and a dress - if we want to apply chaos cloth to one part of the apparel (usually the dress). Sometimes this process results in the individual items you want - sometimes you have to combine them into the pieces you want (this provides a second opportunity to optimize as well).

Image 20


4. Non chaos cloth "Follower Option"
Apparel items not needing the full chaos cloth treatment can be added to an actor as "follower clothing" (ie, the clothing follows the skeletal mesh, as would be the case if you transferred a model from DAZ with clothing attached)  using a subset of the instructions in A above (2,3,4) taking note of the import facing. Instead of 5, disconnect the USD Import option, right click the graph and add and connect a new node  "StaticMeshImport" and then add your static mesh to the graph.  If the item has a ton of vertices, you might wait a long time - if so, you may need to decimate.  Experimentation suggests that the present optimal position is about 10k vertices - we use up to 35-50k in some situations - but the system really starts to strain beyond. 

Note that  Jay Versluis has done a superb video on this workflow - you might want to go check that out.


Image 21


If you need to 'turn' your clothing item to fit it to your actor - you can use an alternative with static mesh item as an alternative to the process in step 6: eg, if you need to turn it 90 degrees, zero out location and rotation then turn it 90 degrees and bake that rotation into the item (Image 22).  This takes a fraction of the time of the graph process, particularly with high vertice items.

If you have a very dense item, you will need to decimate it using the tools in the engine (Image 23). Be warned, decimation is a trial and error process and can cruel your model.  Use the duplication command.


Image 23

Complete the process with steps (6,7,8,9). 


5. Chaos cloth Option
This process will probably require decimation (see above B4) and baking rotation before modifying the graph (see above B4).  Once the item is added to the graph, you can proceed as outlined in A.












Comments