top of page

Introduction

This project was from April to July, 2022.

​

The aim of this project was to create an effective and reproducible pipeline for creating clothing for Metahumans in Unreal. Metahumans offer customizable high-fidelity humans, but (as of Unreal 5.0.3) limited customization in the clothing.

​

Metahumans have rapidly caught on with game designers, but there hasn’t been much response from technical artists. As such, there are very few demonstrations or tutorials of how an artist could create custom clothing for metahumans.

​

The pipeline I’ve outlined below is a solid approach to creating real-time cloth sim on Metahumans, using Unreal Engine, Marvelous Designer, Maya, and Substance Painter.

SU22_PRJ450_MBrunner_Sam_Beeman_Wk12_postprocessing_closeup (1).jpg

(caption: a screenshot with post-processing)

​

I started by developing a concept for the character. She’s an adventuress in the late Victorian era (think 1890s). Using fashion templates as a starting point, I researched historical clothing and did paint-overs in Photoshop.

​

The outfit is composed of a puff-sleeve shirtwaist and a ‘split skirt’ (historical terminology for culottes) with a corset-inspired waistline.

SU22_PRJ450_MBrunner_Sam_Beeman_Wk12_Concept_Art.jpg

(caption: concept sketches and a paint-over I made for this project, created in Adobe Photoshop 2022.)

​

Basic process:

To clothe a Metahuman, I put together a base mesh to model the clothes on, modeled the clothes, textured and skinned them to the Metahuman skeleton, and then applied cloth simulation in Unreal.

​

Project Setup

As I’m using Mixamo animations to demonstrate the simulations, I needed the UE4 SK Mannequin for retargeting. The simplest way to do this is to create a third-person project, but I actually started from a template.

 

Once the project is set up, the next step was to design and add a Metahuman to the project. To prevent clipping in their default clothes, Metahumans have hidden geometry on the main body skeletal mesh. Therefore, it's best to give the avatar default clothing that covers the same areas the final outfit will. For this project, I selected a long-sleeve shirt and pants that crop above the ankles.

 

Metahumans as a Marvelous Designer Avatar

TL:DR; Export the skeletal meshes as FBXs, open the FBXs in Maya to get them ready for Marvelous, export them as OBJs, then open them as avatars in Marvelous and set up the fitting suit.

 

In Unreal

Metahumans treat the face and body as two separate skeletal meshes, which are then combined in the blueprint. To get a single, watertight mesh to use as my avatar, I needed to find and export both of those (as well as the associated texture, although that wasn’t necessary).

 

Because Metahuman removes geometry from the body skeletal mesh to prevent clipping, the skeletal mesh inside the blueprint isn’t suitable for use in an avatar. But when downloading a Metahuman, you also receive a second version of the body skeletal mesh that is complete. It’s marked by a ‘_preview’ postfix, and it’s useful for both the Marvelous Designer avatar and for skinning the garments to the rig (see section ‘UV Editing and Skin Weights’).

 

In Maya

Metahumans have a lot of data that Marvelous Designer can’t handle. I had to do a lot of destructive actions to get the mesh ready for Marvelous, including separating the face and deleting all the hair cards and deleting the bones.

 

If you’re using a UE4 metahuman, there will be LODs. Choose LODs that match each other (look at the edges) and delete everything else.

 

When using a UE4 metahuman, there are LODs that need to be removed. It’s important that the LODs ‘match’ between the two objects, because otherwise merging the verts won’t work, but the labels don’t indicate whether the edge flow matches. Because the body mesh is two steps lower poly than the face mesh. If you’re using UE5, there won’t be LODs because of Nanite.

 

Once my pieces were set up, I combined the objects and then merged verts at the neck by a low distance. It’s important to just select verts around the neck, because otherwise there will be some decimation in the hands and feet. (Which doesn’t actually matter for Marvelous Designer, but it’s important to me.)

 

After combining the meshes, as I wanted them to have textures in Marvelous, I needed to apply a second material to the face’s UV shell. I converted the textures, which exported as TGAs into JPEGs. Then I applied the textures to the two materials and exported the mesh as an OBJ. There are two reasons why I chose an OBJ, one is that Marvelous likes OBJs more than FBXs, the other is that I had just applied textures and didn’t want to apply them again.

(caption: A screenshot of Maya, with a Metahuman in the perspective view)

​

In Marvelous

The OBJ is then imported to Marvelous as an avatar and the coordinate systems and unit scale are verified, since Marvelous uses mm by default, which is problematic because Maya and Unreal use cm. The fitting suit is created next because it is very useful for rapidly resizing fitted garments.

​

Old problems:

In a few iterations of this pipeline, I decimated the geometry, even putting the model into Blender to use the better decimation tool. I’ve since stopped doing this, because Marvelous’ performance is impacted far more by the garment than by the avatar, to the point that the avatar’s geometry is almost negligible. Plus, high fidelity avatars ensure there won’t be any unexpected clipping later on.

​

In one iteration of the pipeline, I converted the skeletal meshes to static meshes to remove the rig and superfluous data. However, this turned out to be an entirely unnecessary step… it caused coordinate issues and it was faster to just delete the bones in Maya, especially as I still had to delete things in Maya because I haven’t found a way to export only a single LOD from Unreal Engine 4. The coordinate issues I mentioned are because UE uses Z up and Maya and Marvelous use Y up. Converting to static mesh flattened the asset’s internal hierarchy, freezing the coordinates. The coordinate problem didn’t occur again once I stopped doing this.

​

Importing a rigged mesh into Marvelous would seem like a good idea, as Marvelous can export geometry caches of high fidelity animation. However, metahumans, even exported as FBXs, have complex constraints and deformations, so this doesn’t work. I had the same problem trying to get Metahumans into Mixamo.

​

In one iteration of the pipeline, I downloaded two versions of my metahuman: one with no clothes, and one wearing clothing that covers skin where my outfit covers skin. I intended to use the skeletal mesh of the ‘nude’ metahuman for the Marvelous designer avatar and for the skin weighting of the clothes in Maya. This was unnecessary because Metahumans come with a ‘nude’ skeletal mesh, the ‘preview’ skeletal mesh.

​

When I first tried texturing my avatar in Marvelous, the texture didn’t display. This is because the texture acts as a multiply on the material color, and the avatar’s material color is black by default. So the fix was just to go into the material editor and change the avatar’s material color to white.

​

Creating The Garments

This pipeline places no special restrictions on the mesh for the garments, so I was able to model them using standard techniques. With the mesh ready, preparing them for exporting does present some concerns to work around.

 

Sim-Friendly Posing

Through trial-and-error, I’ve determined that cloth sim friendly posing is achievable with three tools.

  • Low or no gravity, especially on pleated areas, so the clothes export with full volume.

  • I used wind to push the front of the culottes closer to the legs, so they can be skinned and inherit the metahuman’s fancy leg deformations.

  • Strengthened patterns, to reduce the folds.

 

For the best results, I would set up the export pose with the garments in one project, then separate each piece into its own project and disable the avatar before exporting.

​

To prevent ‘buckling’ issues at folds, caused by the triangular geometry, I added parallel internal lines along the folds.

SU22_PRJ450_MBrunner_Sam_Beeman_Wk8_AvatarForMarv.PNG
SU22_PRJ450_MBrunner_Sam_Beeman_Wk11_optimized_pose.JPG

(caption: A screenshot of Marvelous, with the 3D viewport showing a garment ‘optimized’ for cloth sim in Unreal)

​

Exporting

Once you have an outfit put together in Marvelous, export everything as an FBX. For export settings, choose 'thin’, ‘single object’, and ‘unweld’. And don’t export the textures.

​

Old problems:

In previous iterations of the pipeline, I chose ‘welded’ on the export. Welding merges edges where there’s stitching between two patterns, which results in non-manifold geometry. It’s actually not bad, Unreal and Maya’s rigging tools aren’t bothered by non-manifold geometry. But non-manifold geometry is entirely incompatible with Maya’s UV editing tools. It’s best to layout the UVs and then weld verts and then rig.

​

Marvelous’ UV editing tools are… limited. Exporting a garment as a .OBJ and fixing the UVs in Maya seems like a good idea but MD is a one-way street. Too much data is lost exporting it to reimport it. I asked the Marvelous Designer discord forum and nobody had a solution for getting a garment back into Marvelous once exported.

​

When discarding Marvelous’ textures in favor of good UV layouts, some details are lost. In my project, the most notable example was buttonholes. The reason for this is that the buttonholes are textures on loose pieces of geometry, not actual geometry (like the topstitching is). This is no great loss, because Marvelous doesn’t handle hardware well in simulations (because it is not optimized for rigid body simulations, the buttons take a long time to settle down). It is better to place the buttons on a single layer of fabric and then to create the buttonholes in Substance Painter.

​

​

UV Editing, Merging, Skin Weights, and Texturing

 

Then UV layout the garments. I just do the auto layout. The default layout tool shouldn’t rotate your UV shells, which is good because they should already be rotated correctly because Marvelous matches the UV rotation to the 2D pattern window, and the 2D pattern window is how cloth would actually be cut.

​

I also deleted faces that were hidden by layering. As long as the area is fitted to the body, this has no effects.

Once the UVs were good, I selected all the verts and merged to a distance of .001, which is the lowest. This distance is good because the verts along the sewn edges have no distance between them.

​

For the piping, I used the target weld tool to clean it up.

Topstitching, which looks really cool, isn’t compatible with UE cloth sim tools. So it’s best to save off a ‘high poly’ version, remove the topstitching (it’s easy with mesh -> separate) and then use Substance to add the ‘high poly’ stitching to the normal map.

​

Old problems:

I used to export ‘welded’ from Marvelous. Box pleats cause nonmanifold geometry.  Fixing this (prompt occurs when trying to layout UVs) causes a ton of single-face loose pieces. To prevent this, export the garments ‘unwelded’, layout the UVs, then merge verts at a low distance.

​

With 'welded' exports, I had a workflow like this: Select the geometry around the loose triangles. The default distance threshold is too high, so reduce it to .001. Then select the edges of loose triangles that resulted from cleaning up the nonmanifold geometry. These, so far in my experience, have been the result of pleating and piping in Marvelous. Use Shift+> and the stitch together tool to get multi stitching. (Multi-stitching is great but takes a lot of RAM.) When stitching, it’s best not to include a UV shell that already has a lot of geometry. The reason for this is that the stitching tool needs to think through the entire shell, not just the edges selected. The sewing tool doesn’t have this problem, and can be used with any size of shell.

 

Skin Weighting

Unreal Engine needs clothing to be skinned to the Metahuman base skeleton. To do this quickly, I just added the ‘_preview’ FBX to my maya scene, bound the garment to the skeleton, and then used the copy skin weights tool to get the weights from the ‘_preview’ mesh.

​

The resulting weights would be good enough for a fitted outfit, but my outfit is fairly loose, so I had to clean up the skin weighting.

​

Since the culottes are very long, the fronts were skin weighted to the tops of the feet, which resulted in the clothes appearing to be caught on the feet, even after cloth sim was applied. This could be fixed by hammering skin weights.

​

Another problem area was under the sleeves, near the ribs. Since the clothing here was closer to body preview’s ribs than its arms, the underside of the sleeves were weighted to the spine. Even enabling UE5’s geodesic [image name] setting in the cloth configs, it looked odd. This couldn’t be fixed by just hammering verts, I needed to actually open Maya’s paint skin weights tool and flood weight the verts to the correct bone. Same process with the inner thighs.

​

I also used the paint skin weights tool on the collar. Since the shirtwaist has a high collar, it extends higher than the body preview mesh that I copied skin weights from.  Unfortunately, because Metahuman necks have odd bones, this gave me imperfect results. The shirtwaist’s collar clipped into the neck until I made some extreme adjustments to the physics asset. (I tried combining the face skeletal mesh with the body and then copying the shirtwaist’s skin weights from that, but it didn’t work.)

​

For hardware (ex: buttons), I just selected a vertex near where the item connects to the fabric (ex: the middle of a button), copied skin weights and then selected the whole item and pasted skin weights. This prevents the solid pieces from stretching when the bones move.

​

The cleanup looks like it would be time consuming, but once I got it working correctly once, I could instantly copy skin weights from the cleaned up version to any new iterations of the garment. In the entire project, I probably only spent three hours skin weighting.

 

Old Problems:

A something that repeatedly tripped me up was that UE can’t handle groups within FBXs. The reason is that UE interprets groups as bones in skeletal meshes (which makes sense. They’re both just positions and places in the hierarchy). Since importing an FBX into Maya (such as the ‘_preview’ skeletal mesh that I was copying weights from) results in the FBX’s contents being automatically grouped, the resulting skeletal mesh didn’t match the default skeleton anymore and couldn’t be imported. It’s an easy fix.

​

Top stitching needs to be baked to texture, not persist as geometry. This is because they’re loose pieces, they don’t actually share any geometry with the main garment. By default, they’re exported in a single object with the garment, with the same material applied. Trying to create cloth from a mesh that has multiple loose pieces results in Unreal hanging. Even applying cloth data created on another piece of geometry won’t work.

​

Cloth Sim on Metahumans

Since my metahuman came with a default shirt and pants, I was able to replace those nodes in the Metahuman blueprint with my own assets. Doing this early in the process gave me a way to quickly see the cloth simulation in context.

​

Creating Clothing Data

My final cloth assets (the best results I had) were actually created from ‘low poly’ versions. I took the finished FBXs of the skinned and textured clothes, put them in Blender, and decimated the vertices by around half (the default Blender decimate tool doesn’t cause ‘shrinking’, so it’s better for preventing clipping). Then I put the decimated version in Unreal and created clothing data from selection. I stayed on the decimated version while I did the first pass cloth painting and parameters, and then added the clothing data to my original (not decimated) clothing. Using decimated versions for the first pass cloth simulation is better because it loads faster and almost never crashes. It’s best for quick feedback while making large changes, but it’s not useful for fine-tuning.

​

Physics asset

In my experience, about 30% of what I thought at first were cloth parameter problems were easily fixed by adjusting the physics asset. The cuffs of the sleeve look lumpy? Scale down the Y axis on the forearms. The neck is clipping with the shirt? Scale up and adjust the positions of the physics bodies for the neck, head, and clavicles.

(Caption: My final physics asset. It’s not ugly if it works!)

​

Cloth Painting

I used standard techniques for cloth painting.

UE5’s cloth method is different from UE4’s. In UE4, you could set cloth parameters globally without painting. For UE5, you need to paint where you intend to paint every parameter you intend to use. At the minimum, I painted the masks for ‘max distance’, ‘anim drive stiffness’, and ‘backstop distance’.

​

Parameters

In the metahuman blueprint, there’s a parameter that is extremely useful for adjusting the look of the cloth simulation, but doesn’t appear within the skeletal mesh asset details window. This is the ‘cloth max distance scale’ within the  asset details for the skeletal mesh within the metahuman blueprint. For the shirtwaist, where the garment fairly similar to the simulation, I set this to 0.04. For the culottes, where the garment is posed with wind blowing it back, it needed to be higher. I had good results at 0.3.

screenshot_physics_asset.jpg
screenshot_params_culottes.jpg
screenshot_params_shirtwaist.jpg

(caption: two images of the Metahuman blueprint editor, with simulation running. On the right, you can see the asset details for the culottes and the shirtwaist, respectively, with max distance scale set.)

​

Since my final product wasn’t a real-time render, I also adjusted the shared sim configs, turning both iterations and subdivisions up from 1 to 10.

​

Old problems:

I initially had no idea what a ‘good’ physics asset was. To get very good results on cloth sim, the physics asset need to look a bit odd. In my first custom physics asset, I tried to make the bodies align with the preview skeletal mesh, which instead of giving me quality results that showed the effort, just made the cloth look puffy and lumpy. It also caused Unreal to crash a lot.

​​

(Caption: a gallery of screenshots, some with post-processing)

​

In Conclusion

 

Thank you for reading this recap of this project! I enjoyed the challenges of this new process and learning to use the UE5 cloth tool.

 

Software Versions:

  • Unreal Engine 5.0.3 – I used this for the final cloth sim and rendering

  • Unreal Engine 4.27.2 – I experimented with cloth sim in UE4, but didn’t end up using it in the final product.

  • Marvelous Designer 11 – I used this for modeling the clothes.

  • Maya 2019 – I used this for combining meshes, merging verts, cleaning up geometry, UV layouts, and skinning. I also used this for all the hard surface modeling (the shirtwaist’s buttons and the studio backdrop)

  • Adobe Substance 3D Painter – I used this for texturing the clothing.

  • Blender 3.1.2 – I used the decimate tool.

  • Adobe Mixamo – I used this for sourcing skeletal animations to demonstrate the cloth sim.

  • Adobe Photoshop 2022 – I used this for making concept illustrations and for adjusting some of the beauty renders.

 

Credits:

  • The character I used, including the body, face, hair, and shoes, is a Metahuman.

  • All environment assets are from Quixel Megascans, except the plain studio backdrop. Didn’t use in the final renders.

  • The buttons on the pants are from Marvelous Designer.

  • All animations are from Mixamo.

  • Cloth modeling, simulation, and texturing is by me.

bottom of page