#
Loading...
#

3D Cloth Modeling Tutorial Part 02:

How To Bridge The Gap Between
Marvelous Designer and ZBrush


#
You need to subscribe ONLY ONCE, the
PROJECT FILES of PART 01 are included in the package!

Let’s get started!

Welcome to Part 2 of my 3-part 3D cloth modeling series! (Part 1 can be found here). In this tutorial I will teach you all you need to know to export your designs from Marvelous Designer. We will bring them to ZBrush for sculpting and use 3DS Max to create a clean basemesh.

1. garment simulated in MD, 2. Basemesh created in 3ds max 3. reprojected details in ZBrush

You will learn:

  • how to prepare any Marvelous Designer projects for export,
  • how to adjust the MD export settings for different purposes,
  • how to quickly import clothes into ZBrush in only a few easy steps,
  • how to auto-retopologize complex garment in ZBrush and 3DS Max for clean topology,
  • and how to handle clothes in ZBrush in general.

I will continue with the garment created in part 1, prepare it for export as an OBJ, use ZBrush for auto-retopologizing, assemble the basemesh in 3DS Max and finish everything up using ZBrush once more.

finished garment from the 3d cloth modeling tutorial part 01

What topics are covered in this tutorial?

This tutorial is divided into four chapters, each of which builds upon the last. I will show you some of the most common MD pipeline issues first, and then we’ll dive deep into ZBrush and 3DS Max features to solve diverse problems:

Who is this tutorial for?

This workflow overview is addressed to every CG artist who is interested in refining garments created in Marvelous Designer and preparing the mesh for texturing, rigging or animation. Even though I will proceed with the jacket created in part 1, you can apply this process to any piece of clothing made in MD.

Technical requirements:

All recent versions of Marvelous Designer, ZBrush and 3DS Max are suitable for following the steps outlined in this tutorial. MD version 7.5 and ZBrush 2018.1 are required to open the project files. All files are available FOR FREE!

Subscribe to the 3DGladiator newsletter at the top of the page to receive an email with the download link. If you are already subscribed to 3DGladiator, please check your inbox, as I’ll have already sent you the email.

01
Common issues when exporting from MD Common issues when exporting from MD

Marvelous Designer allows us to simulate and create very complex cloths. However, due to the way MD calculates geometry, the resulting mesh is nothing but a rough foundation that needs further processing.

When you export garments from MD and bring them straight to ZBrush without any previous adjustments, you are usually confronted with the following problems:

simulated model consisting of triangles

Triangles: MD uses particles to simulate physical properties of cloth. Imagine these particles as dots. By connecting the dots, you get a simple, triangle mesh. Whenever you lower the particles distance in the “simulation properties” tab, you increase the amount of particles on a given surface defined by the size of the pattern you draw in the 2d window. Consequently, this also increases the number of triangles and, therewith the mesh density.

Randomly placed triangles are not very suitable for sculpting. A quadrupling function is available in MD, but for a logical and clean mesh topology, the feature is pretty much useless.

rough details even with low particle distance values

Mesh Resolution: In Marvelous Designer’s 3D window, objects get displayed as smooth surfaces, regardless of the particle distance. MD achieves this by averaging the surface normals at any point on the mesh; similar to applying smoothing groups in 3DS Max or Maya. If you open the mesh in ZBrush, you will notice that the geometry is not longer as smooth and detailed, due to the way ZBrush renders objects and deals with surface normals.

No matter how low you set the particle distance in Marvelous Designer, the mesh still lacks resolution. Fine details tend to be missing and surfaces will appear rough and incomplete.

holes occur where pattern meet or overlap each other

Holes and unwelded seams: Depending on the complexity of the garment and even if you set the export settings to “Single Object” and “Welded” in MD, patterns sometimes don’t merge into closed objects – especially when you export a cloth with thickness enabled (which I do not recommend!), even if you weld the points in ZBrush (Geometry/Modify Topology/Weld Points). As soon as you subdivide the mesh or smooth it, holes become visible.

For precise sculpting, the mesh needs to be clean and closed. At the very least you need to have complete control about how the geometry gets exported, so you can build a pipeline upon it.

complex drapery is impossible to retopo by hand

Complexity: MD allows us to create very realistic drapery. As a result, shapes become quite complex very quickly and retopologizing folds by hand can eventually become extremely time consuming or even impossible after all. Turning the mesh from triangles into quads in MD results in a consistent edge loop around the pattern’s borders, but it works according to the same principles as the triangulation does. Moreover, the mesh doesn’t consist entirely of quads in the end, because critical spots still comprise of triangles.

Because of very complex and overlapping shapes, retopologizing the mesh by hand is not an option. You need to apply an automated, or at least semi-automated retopologizing method to make it work.

Luckily, different workarounds exist for all the issues mentioned above. Continue reading and I will show you how to overcome these obstacles so you can use the meshes generated in MD as solid foundation for great looking 3D clothes.

02
How to prepare the MD project for export How to prepare the MD project for export

In this second chapter, we’ll take a look at the necessary steps you need to follow to prepare your MD project for export. These steps are crucial for both methods described in chapter 3 and 4. So, read them carefully!

Preparing the scene:

Download the project files and open 04_coat_final.Zprj in the MD_scenes folder. This is where we left off in the first part of this tutorial series. The model consists of a lot of different elements. Some of them are hidden underneath the top layer and serve for simulation purpose only; like the inner patterns of the sleeves.

outside and inside patterns laying on top of each other

What you need to know:

  • For exporting, we aim for clean, closed, connected, one-sided patterns with equal mesh density. The actual complexity of the drapery and overlapping shapes don’t have to be simplified and can remain as they are.
  • Not all elements that were necessary for simulation are relevant for sculpting. The outmost layer of fabric is usually the only part you need. Double-sided components like the inside of the jacket or the inside of the hood can be reconstructed later on. This is what the scene should look like at the end:
simplified jacket; only the outer shell remains

What you need to do:

  • First, hide the avatar (Shift + A) and delete all patterns that are not part of the top layer nor visible in the final version. For instance, delete the inside patterns of the jacket if your character wears it with front zipper closed.
  • In the 3D window, switch the viewport settings from Thick Textured Surface (Alt + 1) to Textured Surface (Alt +2). This let you to see the patterns as one-sided geometry. A dark color indicates triangles turned away from light and therefore represents the backside of a surface.If you encounter any surface normals that point in the wrong direction, right click on the pattern in the 3D window and select Flip Normal.
backside surfaces are displayed in dark colors, right-click, flip normals
  • If you’ve converted internal lines to holes for zipper or other design elements, delete those lines to close the openings. In doing so, you lose the zippers, but the simpler the patterns are constructed, the better auto-retopologizing works. Don’t worry if small surface bumps occur, we will fix them later.
simplify patterns by deleting holes created with internal lines
  • By deleting the patterns you don’t want to export, sewing lines are sometimes deleted too. This usually happens when you delete patterns that were created via the Layer Clone function. In this case the patterns aren’t connected properly anymore.Here it is necessary to restore the missing sewing lines and run Simulation (Spacebar) for a few seconds to sew the pieces together again.
restore sewing and simulate
  • In the 3D window, turn on the Mesh Preview (Alt + 5) to display the wireframe. Check the entire model and make sure all parts consist of equal mesh density. If you find a pattern which doesn’t fit to the rest, adjust its particle distance.
  • And last but not least, turn the mesh from triangles into quads. This is not necessary when you plan to retopologize the garment, but I recommend doing this if you plan on following the procedure described in chapter 3.Select all patterns in the 2D window or hit Ctrl + A, open the Miscellaneous tab at the bottom of the Properties window and change the mesh type from triangles to quads. Depending on the complexity of the scene, the conversion can take a few minutes.
triangulated mesh compared with a mesh that consists of quads

Export Settings in MD:

Once you’ve completed the previous steps, all you need to do now is export the model as an OBJ.

What you need to know:

  • To keep the ZBrush file organized, export main drapery, secondary elements and details like stitches and buttons as separate OBJs. In ZBrush you can import and easily combine them as subtools later on.
  • Exporting the garment with thickness may seem logical at first, but it will limit your options to define and vary the thickness in the next step. So, I suggest exporting the cloth as a thin, one-sided surface.If you decide to save the mesh with thickness anyway, you can adjust the thickness by selecting the corresponding fabric in the object browser and changing the Thickness Value in the Physical Properties tab at the very bottom.
changing the thickness value in the fabric properties

What you need to do:

  • Export the main drapery by selecting all big patterns first, then going to File/Export/ and selecting OBJ (Selected). Choose a filename and location and make sure the settings look like the ones in the screenshot below. Uncheck Select All Graphics and Trims to exclude buttons, zipper and stitches from being exported, and choose Single Object and Thin.
  • Depending on the method described in chapter 3 and 4, select Unweld or Weld respectively. The same goes for the UVs. If you decide to follow the method in the next chapter, no UVs are needed, and you can leave welded checked.
  • When using 3DS Max, I prefer to change the scale from millimeters (default) to centimeters. For ZBrush, the scaling is not relevant.

PRO TIP:

Even if the Select All Graphics and Trims box is unchecked, MD still exports these elements sometimes. To prevent this from happening, simply CHECK and UNCHECK the box before you click OK.

basic export settings for the method described in the next chapter
  • For this project, I prefer to export the secondary elements as a separate OBJ too. This way I can add and adjust the thickness independently from the main patterns in ZBrush. Select the pockets, pocket flaps, the flaps on the sleeves and the hood strings and export them with the same settings as before.
  • Next, export the tertiary elements as a separate file. Select all components and go to File/Export/OBJ (Selected). This time uncheck Select All Patterns, expand Select All Graphics and Trims and make sure only Button and Topstitch are ticked, also choose Single Object and Thick.
primary, secondary and tertiary elements exported as OBJs

This results in 3 OBJs. One contains the main patterns, the second one the pockets, flaps and strings, and the third one, the stitches and buttons.

03
The fastest way from MD to ZBrush The fastest way from MD to ZBrush

In this chapter I’ll show you how to start sculpting in ZBrush without worrying about any pipeline restriction. This method is perfectly suitable for creating quick concept sculptures or for garments that need to be 3D printed in the end.

The MD mesh as a starting point

In the previous chapter, we turned the mesh from triangles into quads. I want to make you aware of the advantages and drawbacks of this step before we combine the OBJs into subtools and start sculpting.

What you need to know:

  • Quads are much more suitable for sculpting, especially when you add subdivision levels. Triangles tend to result in spikes that are hard to smooth out.
  • By turning triangles into quads, Marvelous Designer creates a nice and consistent loop around the edges of every pattern, which prevents the cloth from fraying around the edges when you divide the mesh.
  • Exporting quadrangulated meshes generate smaller files as they consist of fewer polygons.
  • Unfortunately, unlike triangles, quads tend to smooth out fine details. The resulting mesh does not remain crisp.
  • MD tends to become super slow when dealing with quads. Synchronization after deleting patterns or saving the entire scene can take forever, at least on my workstation.
pros and cons of exporting the mesh with quads

What you need to do:

  • Import and combine all OBJs into one subtool.
  • As the mesh should be a closed surface consisting of connected patterns, check for holes and open seams right after importing. Turn on Dynamic Subdivisions by hitting the D key on your keyboard, or enabling Dynamic in the Geometry tab. If you encounter an error message, scroll down to the very end of the Geometry subpalette and click on Fix Mesh first.In case you come across any issues, go back to MD and check the sewing. If everything looks good, exit Dynamic Subdivision by pressing Shift+D.
turn on “Dynamic Subdivision” to check for holes
  • Select the subtool with the pockets and run the Auto Groups function, so you can select each piece individually. Do the same for the subtool with the buttons and stitches.
  • Next, let’s give the main parts of the jacket some thickness. We do that with the help of the Panel Loops feature as it allows precise control.In the Geometry subpalette, make sure the settings are set as follows: Loops = 1, Double = enabled, Polish = 0, Bevel = 0, and Elevation = -100.When pressing the Panel Loops button, ZBrush adds thickness to the inside of the mesh, with a clean loop between the inside and outside panel. Each element has its own polygroups. Repeat the steps for the pockets and pocket’s flaps and adjust the thickness values accordingly.
adding thickness with the Panel Loops function

How to handle meshes with thickness in ZBrush

Now some tips on how to adjust the tools and brushes in ZBrush for editing meshes with thickness easily. Of course, the tips do not only apply to this piece of clothing, but any thin, two-sided mesh.

What you need to do:

  • Sometimes it’s difficult to handle thin shapes; especially when you get close to the edges with the smooth brush. The smooth brush usually thins out the area between front and back panel. As a result, it’s very difficult to restore a clean and even border. Take a look at the GIF animation below.
sharp edges are difficult to control with the smooth brush
  • With the following work-around, we can prevent that from happening and keep the edges nice and clean. First, it is necessary to insert an additional edge to the loop.Select the ZModeler Brush, hover over the loop, press spacebar, choose Insert and Single Edge Loop from the dialog box and insert an edge. Repeat this process for all patterns that increased in thickness due to the Panel Loop function.
use ZModeler to insert additional loops on each side panel

PRO TIP:

Theoretically, you can insert this additional loop automatically by setting the Loops value to 2 before applying Panel Loops. In my case that somehow doesn’t has the same effect as inserting edges with the ZModeler brush and leads to undesired results in the next step.

  • Next, press and hold Shift to activate the smooth brush, open the brush palette, scroll down to the Smooth Brush Modifiers subpalette and set the Weighted Smooth Mode to 6.This way the brush still smooths the mesh, but respects the borders of the polygroups to maintain the line along it. The GIF animation below illustrates that effect.
smooth brush “Weighted Mode” set to 6
  • You can now not only keep the border quite consistent while smoothing, you can also use the Inflate Brush to increase the thickness, and the Pinch Brush to decrease it. To return to the standard smooth brush, simply set the Weighted Smooth Mode back to 0.
using the inflate and pinch brush to control the thickness

PRO TIP:

The maintain groups feature does not only work on borders of double-sided meshes, but also on polygroups in general. To smooth the transition between one polygroup and another, set the mode to 6 and start smoothing. Doing this carefully will end up giving you a perfectly smooth polyline.

using the Maintain Groups Feature on internal polygroups
  • When you work with thin, two-sided geometrical shape, enable backface masking for all brushes. This function is located in the brush palette under Auto Masking and prevents the brush from affecting the backside of the model.
  • When you smooth a surface consisting of triangles with the smooth brush, you’ll notice that it creates small bumps sometimes, no matter how long or how intensely you apply the smoothing.Whenever you are dealing with this issue, Shift click to activate the smooth brush and release Shift while continuing smoothing. That forces ZBrush to switch to another smoothing algorithm that deals with the bumps differently and usually produce better results.
release Shift to activate an alternative smoothing algorithm

Now you are ready to subdivide and mesh and start sculpting.

04
The MD to 3DS Max to ZBrush pipeline The MD to 3DS Max to ZBrush pipeline

In this fourth chapter we’ll look at the fastest way to create a clean basemesh. You’ll learn how to auto-retopologize flat patterns in ZBrush, how to warp the retopologized mesh around simulated drapery in 3DS max and how to re-project details in ZBrush. Don’t worry, it sounds much more complicated than it actually is!

Auto-Retopologizing in ZBrush

To visualize the procedure more clearly, I will demonstrate the workflow on the main parts of the jacket only. It works the same way for all the other parts of course.

What you need to know:

  • As opposed to the previous method, we do not only need to export the simulated garment, but also a flattened version of the pattern, or more precisely, the actual flat pattern from the 2D window.All in all, the following procedure builds on 3 meshes: the flat, 2dimensional pattern, the simulated drapery we receive from the 2dimensional pattern when simulating in MD and a retopologized version of the 2dimensional pattern that we have as of yet to create.
three meshes are needed to build the basemesh
  • We do not only use the flat, 2-dimensional pattern as a basis for the ZRemesher function in ZBrush, but also as a basis to morph the retopologized mesh into the shape of our simulated original. That makes more sense in a second!

What you need to do:

  • In Marvelous Designer, convert the mesh back to triangles in case you’ve changed the setting to quads in the Properties Editor under Miscellaneous.
  • First, select the simulated cloth and export it as an OBJ with the following settings: single object, unweld, thin and with Unified UV Coordinates.
Marvelous Designer export settings
  • Next, right-click the simulated cloth in the 3D viewport and choose Reset 2D Arrangement (Selected). This turns the simulated pattern into its pre-simulated state. It also positions the pattern in the exact same place in the 3D viewport, as it is drawn in the 2D viewport. Export this flat version with the same settings as before.

PRO TIP:

I also want you to take notice of Internal Lines and how they affect the triangulation (or the way quads are arranged if you use quads instead). Switch to the Mesh View in the 3D viewport (Alt+5). It’s probably hard to see, but MD generates smooth polylines that perfectly represent internal lines.

It’s not necessary to work with internal lines, but keep in mind that you can use them as retopology guidelines in combination with ZRemesher in the next step.

use internal lines to create polygroups in ZBrush
  • Now, fire up ZBrush, import the flat pattern and turn on polyframe (Shift+F). If you have drawn internal lines in MD, you should be able to identify these polylines. In this case, choose SelectLasso, hide parts of the mesh along the polylines and assign a new polygroups to the remaining parts (Polygroups/Group Visible).
  • With the entire mesh visible, go to the Stroke palette, scroll down to Frame Mesh, and make sure Border and Polygroups are enabled before you click the button. This action frames the mesh and its polygroups with ZRemesher guidelines.
"Frame Mesh" adds ZRemesher guidelines around each border and polygroup
  • You can further add ZRemesher guidelines manually by selecting the ZRemesher Guidelines Brush and drawing straight lines across the surface.Avoid too many intersections, as ZRemesher tends to produce messy results and enable As Line in the Stroke palette to draw straight lines. It doesn’t matter if you extend the lines beyond the mesh borders.
adding additional guidelines with the ZRemesher brush
  • Go to the Geometry palette, scroll down to ZRemesher, set the Curve Strength to 100, the Target Polygon Count to something low like 2 or 3 and hit the ZRemesher button. You should get a relatively clean topology and an edge-flow that follows the predefined guidelines.
retopologized patterns after applying ZRemesher
  • Export the mesh without texture and polygroups as an OBJ.

Wrapping it up in 3DS Max and reprojection in ZBrush

In this last step, we will import all parts in 3DS Max and morph the retopologized mesh into the shape of the original cloth to build the basemesh.

What you need to know:

  • You have two options here: you can do the steps described below manually, or you can run the 3DS Max script I’ve created. It basically automates the entire procedure and saves you a lot of time. Before you run the script, I suggest you take a quick look at the description to get a better understanding of how it works.

Gladiator Tools: MD to 3DS Script

The script does nothing fancy. It simply combines a series of steps you can also do manually in 3DS max. This little helper allows you to do the following at light speed though:

  • to split an object consisting of multiple elements into single objects, with centered pivot points and random object colors,
  • attach a retopologized mesh to its reference pattern and morph both into the shape of the simulated pattern,
  • and transfer the UVs from the flat pattern to the retopologized mesh

The script is located in the project folder (Chapter_04/3dsmax_script/). Copy/Paste and unzip the file to the 3DS Max scripts folder. It is usually located under

“C:\Program Files\Autodesk\3ds Max (your version)\scripts\”

In 3ds Max, select Script/Run Script and open GladiatorTools_MDto3DS.ms
If you copy the tool in the Startup folder, it runs automatically every time you start 3DS Max. I also made a very short video tutorial to show you what you need to do:

loading...
short workflow description of how to use the 3ds max script

What you need to do:

The following steps are only necessary if you don’t use the script!

  • Import the simulated drapery, the original flat pattern and the previously retopologized mesh to 3ds max. In the import dialog box, set the normals from Import from file to From SM group.Detach all elements of the three meshes into separate objects. Then center-align both, the original flat one and the retopologized one (Alt+A)
flat pattern and retopologized mesh laying on top of each other
  • If you want to transfer the UVs from the flat pattern to the retopologized one, select the flat pattern, add a projection modifier to the stack, select the retopologized mesh as Reference Geometry, add a new Project Mapping in the Projection tab and click Project all.
setup for projecting the UVs

This transfers the UVs from the original to the new one as well as it can. You can check the UVs by adding a Unwrap UV modifier to the stack of the retopologized mesh.

  • If you prefer to create a fresh set of UVs, just apply an Unwrap UV modifier to the stack of the retopologized mesh, select all polygons, open the UV editor and choose Flatten Mapping..
  • Next, we need to bind the retopologized mesh to the original flat one, so it follows when we morph the original pattern into the simulated drapery.Select the retopologized mesh and add a Skin Wrap modifier to the stack. Add the original flat one as reference geometry and lower the Falloff to 0,001.
binding the retopologized mesh to the original flat one
  • Now select the original flat pattern, add a Morph modifier, place the simulated mesh in the first, empty slot and the setup is complete. All you need to do now is to move the morph value from 0 to 100 and watch how the retopologized mesh takes the shape of the simulated original.
the retopologized mesh takes the shape of the simulated original

If you repeat the exact same process for every part of the jacket, you will receive a relatively clean basemesh.

  • As we unfortunately cannot control the exact outcome of ZRemesher, you will have to finalize the topology by hand and add or remove edge loops on patterns that need to be welded before you can bring the whole thing to ZBrush. With some quick extra work, this is what I ended up with:
finished basemesh in 3ds Max
  • Finally, import the simulated cloth to ZBrush, combine the retopologized and simulated version as a subtool, choose Crease Polygroup Border for the basemesh to keep the borders consistent when subdividing, and reproject details from the original mesh one by one.
re-projecting details to the basemesh in ZBrush

Conclusion

Congrats if you made it to the end of this long and fairly technical part! With all the topics covered, you should be able now to handle any model created in Marvelous Designer and be able to prepare it for further processing.

We are still not done with the project. In the next part, I will teach you how to refine the model in ZBrush and then finalize it in Substance Painter.

If you have not done so already, go to the top of this page, and subscribe to download the project files for all parts of the tutorial, as well as to receive my email notification once the third part is online. If you have any further questions, please feel free to leave a comment below. I will try to answer every query as quickly as possible!

final mesh with re-projected details, ready for sculpting