More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Under Construction
How to make the “VirtaClothing” MetaHuman clothing Part 2

(This is Part 2. Check out Part 1 here.)

Second part of the process

In the previous video in this series, we made a simple shirt and pants for a MetaHuman inside Marvelous Designer. If you haven’t watched that video yet, there’s a link in the description below.

Okay so in this video, we’re going to finish that garment off in Maya, transfer it to Unreal Engine and add it to a MetaHuman.

Maya project

So following along from the first video, you should have the Marvelous Designer scene file open, called “m_med_nrw_BasicShirtPants05_CombineBoth”.

  • So go up to the FILE menu, SAVE AS, PROJECT.
  • And name it as “m_med_nrw_BasicShirtPants06_Prepareexport” then click SAVE.

Change pant fabric

Now we need to add a different pant material, just to make it easier to see them as two separate pieces of clothing.

  • So in the 2D window, marquee select all the pants patterns.
  • For the next step you need to use the Library tab. If you don’t have it open, you can go into the top Window menu, and click on Library.
  • So in the Library, at the top, double click Fabric. Then underneath there will be a list of fabrics. Find the one called “denim_lightweight”, then click and drag it over onto the 2d patterns. And the pants will turn blue.

Re-simulate at highest quality

Now we need to re-simulate the pants and the shirt at the highest possible quality before we export to Maya.

  • So in the 2D pattern window, marquee-select all of the patterns.
  • Then in the Property Editor, under Simulation Properties, set the Particle Distance to “5“.
  • Above the 3D Pattern window, all the way to the left, click the simulation dropdown icon, that looks like an arrow facing downward.
  • Choose the option on the bottom, which is the highest quality simulation.
  • Now press spacebar, and wait for it to finish simulating all the small details of your garments.
  • Once it looks like it’s stopped moving, press spacebar to stop the simulation.

Export as OBJ

Now to transfer the garment to Maya, we need to export it.

  • In the 2D pattern window, select all the shirt and pant patterns, and then go to the FILE menu, EXPORT, OBJ (SELECTED).
  • Name this as “m_med_nrw_BasicShirtPants_FromMD.obj“.
  • In the dialogue box, make sure its set set SINGLE OBJECT, and that it’s set set to THICK. And that the scale is set to centimeters. And then click ok.

Now go FILE, SAVE PROJECT.

And then we can switch to Maya.

Import into Maya

And you should have the Maya scene from the first video still open (“m_med_nrw_body_rig_cooper_y-up.ma”).

  • Now go to the FILE menu, import, and import the OBJ that we exported from Marvelous Designer.
  • Now go to the file menu again, save project as, and save this as “m_med_nrw_BasicShirtPants_V1.ma”.

Now we need to hide the body meshes that we don’t want to see.

  • In the outliner, twirl down the export geo object, and then click on the lod 1 mesh group and press H on the keyboard to hide it. Then do the same to hide the lod2 and lod3 groups.
  • Now in the outliner, inside the lod0 group, the combined object should be visible, but you need to click the flipflops and press H on the keyboard to hide it. And click the body and press H to hide that too.

Bind clothes to skin

Now we need to bind the clothes to our MetaHuman’s skeleton.

MAYA EXPERT USES DIFFERENT SETTINGS. SEE THIS VIDEO AT ABOUT 20 SECONDS IN. THESE ARE THEM:

  • Under the file menu, there’s a menu selection dropdown. Make sure that this is on Rigging.
  • We need to make a quick selection set. So at the top of the Outliner, click the root object – which has a purple icon and is hidden by default. But you can leave it hidden, just click on it. Then go to the SELECT menu and choose HIERARCHY.
  • Then right click, and go Sets, CREATE SET.
  • Double click the new selection set, and rename it to “Body_joints”
  • Now in the outliner right-click on “Body_joints“, and choose “Select set members“.
  • Hold down the control key, and then click the clothing mesh object.
  • Go up to the SKIN menu, and click the box next to BIND SKIN.
  • In the dialogue box that appears, go to the EDIT menu and choose “reset settings”.
  • Now change the BIND TO dropdown to “selected joints“.
  • Turn off  “Allow multiple bind poses“.
  • Then click BIND SKIN. 

NOTE: This step has created a new invisible map on the outfit called the “Skin Weight Map”. And the “Skin Weight Map” determines how much different parts of the clothing are attracted to the bones.  

COPY SKIN WEIGHTS

Ok now we need to copy the skin weights from the character’s human skin, because it’s a good starting point for our clothing.

  • So, in the Outliner, select the character’s combined lod0 mesh
  • Then hold down control and select the clothing mesh
  • And then go up to the SKIN menu, and choose choose “copy skin weights”.

Fix mesh breakage

Now we need to move the arms and legs around a bit, and fish any mesh breakage that we can see.

  • With the combined mesh selected, press the ISOLATE button that is just above the viewport, and looks like a mouse cursor pointing to a box with dotted lines.
  • So now the outfit is the only thing we can see in the Viewport.
  • So click on the character’s left leg, which is on the right side of the screen.
  • In the Channel Box/Layer editor, change Rotate XXX to XXXX.
  • Now we can see that the mesh around the groin area is breaking up.
  • So to fix that, we can use some simple Hammering.
  • So go up to the file menu and go SAVE SCENE, just to save the progress so far.

And then we need to fix the blah..

  • On the left side of the interface, double click on the selection arrow tool.
  • Then turn on SOFT SELECTION.
  • Also make sure that under Selection style marquee, you have CAMERA-BASED SELECTION enabled. (This will stop you accidentally selecting things you can’t see.)
  • OK you can close the tool settings dialogue box.
  • Now in the outliner, click on the clothing mesh.
  • Then above the viewport click on the “isolate select” button. (It looks like a green dotted rectangle with an arrow pointing to it.)
  • Now in the viewport, right click and hold on the outfit, then click on VERTEX.
  • Now marquee select on the problem area. You can hold SHIFT to add more to the selection. And you can also press shift period on the keyboard to expand the selection, or shift comma to shrink the selection.
  • Now go to the skin menu, and choose HAMMER. You can repeat this if you want an even stronger result. Ok now we need to copy those adjustments over to the other armpit of our character. So click to get out of isolate mode. Then in the viewport, right click and hold on the outfit, and choose object mode.  Now make sure your outfit is selected. Then go up into the skin menu, and choose “mirror skin weights”. In the dialogue box, change it to YZ. And then click “mirror”.

Select vertices. Soft selection. Hammer.

Okay now we can move the character’s leg back to its original position.

  • So in the viewport, make sure the left leg is selected.
  • Then in the Channel Box/Layer editor, change Rotate XXX to XXXX.

Okay, now we need to go around and do that same process for the other leg, and then for the arms.

And once that’s done, you’re ready to export the clothing to Unreal Engine.

Export to Unreal Engine

  • So in the Outliner, select XXXXX
  • Go up to the FILE menu, and choose export selection.
  • In the export dialogue box, make sure the dropdown at the bottom is set to FBX EXPORT.
  • Then under “File Type Specific Options” on the right hand side, look under Presets, change the current preset to Autodesk Media & Entertainment. And then just below that, under Include, click on the animation tab to twirl it down, then disable the checkbox next to animation.
  • Now name the file m_med_nrw_BasicShirtPants_FromMaya.fbxand click “Export Selection”. It’s going to come up with some warnings and errors, but just click close.
  • Then go up to the file menu and go SAVE SCENE, just to save the changes.

Create Unreal Project

  • Make a new Unreal Engine project, with the film and tv template, a blank scene, no starter content but raytracing on.
  • Once it loads up, open the built in version of Quixel Bridge
  • Now we need to make a version of Cooper that doesn’t have any clothing, so we can add

MOVE THIS TO ANOTHER TUTORIAL – ADD CLOTHING INSIDE UNREAL

Inside unreal engine, import your metahuman and your outfit. Add the metahuman to your scene.

IMPORTANT: You must go into MESH then click on all your fabrics and open them, then click “two sided” otherwise you will get strange artifacts.

 

CHYRON: Add the outfit to your metahuman’s blueprint.

In the outliner, click to edit your metahuman’s blueprint. In the components tab on the left, click on the green “add component” button and choose ‘Skeletal Mesh’. Rename it as “Garment”, and now drag it onto the body, so it becomes nested inside the body.

Now, select the “Garment” component, and on the right side, under Skeletal Mesh, click the dropdown and choose your imported outfit.

In the viewport of the editor, you may need to slightly move the garment up or down to correctly fit onto the metahuman’s body.

CHYRON:Adjust the outfit’s blueprint settings.

Ok now go to your content browser and open up your outfit, and on the left change the LOD to be 0, and make it just one level of LOD. Now change the Default Animation Rig, to Metahuman Control rig. Now change the Post Anim Blueprint, to be the one for your Metahuman body type. Now click Save.

CHYRON: Add clothing data section.

Unreal needs you to create something called a clothing data section inside your outfit. The clothing data section is what you add a physics asset to, and it’s also where you adjust the “cloth configuration”, such as making it behave like silk, or like rubber, or like other types of physical material.

****YOU NEED TWO CLOTHING SECTIONS – ONE FOR THE INNER clothing mesh AND ONE FOR THE OUTER; BUT MAYBE YOU SHOULD REBUILD IT IN MARVELOUS DESIGNER SO IT DOESNT HAVE TWO LAYERS*******

So to get started creating your clothing data section, again go into the content browser, open up your outfit. Click on the mesh tab, and now click “Section Selection” in the top ribbon. Select the outfit in the viewport, and then right click and choose “Create Clothing Data from Section”. Just leave the default settings and click CREATE. Now right click again on the outfit in the viewport and choose “Apply Clothing Data” and choose your newly created clothing data asset.

Ok now change the physics assets that is being used for the clothing data section. It is currently the one created by default, which is named after the clothing outfit. But in this case it’s better to change this to the one that Epic included, which is named after your metahuman’s body type. So go to the physics asset dropdown for your clothing data section, and find the physics asset that is named after your metahuman’s body type. Now, click on the Physics tab, and you’ll see that the physics capsules are in place. Using this default physics asset can be dangerous m if you have multiple characters in your scene with the same body type. Because you will make adjustments to it. and those adjustments will then be copied to all the characters with the same physics asset. But in this case it’s fine.

***MAYBE HIDE THE OUTER LAYER? JUST USE THE INNER LAYER?****

CHYRON:Paint the areas of your outfit that should be simulated, using Cloth Paint.

You need to now tell Unreal which sections of the outfit should be driven by the bones, and which sections should just be driven by physics. You also want to make the falloff between those extremes really smooth.

To get started with this, click “Activate Cloth Paint”. By default, the outfit will be all pink which means there’s no physics at all. Ok so set the brush radius to 12, and now paint on the sections of the outfit that should be purely physics. Those sections will go white. Now change the cloth painting tool to “Smooth”, and change the strength to “0.8” then click the ‘Smooth Mesh’ button three times to smooth out the transition between the bone driven and physics driven areas.

CHYRON:Create a sequence and play the clothing simulation.

Ok now create a new sequence and add your metahuman to it. Delete the control rigs for the outfit and body. Add in your animation. Press ALT-S to enable physics in the main viewport.

Is it flapping around too much? Is there too much gravity, or not enough? Make a note of how you’d like the clothing simulation to change.

CHYRON:Adjust the cloth configuration settings for your clothing data section.

Unreal is just using a default type of fabric simulation, so you’ll need to change that. Press ALT-S to stop the simulation. Once again in the content browser open up your outfit. Click on the mesh button, and click on your clothing section. Then on the left, scroll down until you can see “Cloth Config”. Change the clothing wind method to Accurate. Change self collision radius to “5.0”. Change self collision stiffness to “10”. Change self collision cull scale to “1.0”. Change each damping setting to “0.2”. Change the friction to “2.0”. Zero out the linear drag and angular drag. Set the solver frequency to “300”. Set the Gravity scale to “2.0”. Now save everything and return to your scene.

CHYRON:Watch your final clothing simulation.

Activate simulation with ALT-S and check out the movement of your outfit.

This is the end of this  process for improving your clothing simulation.

The result may be a little disappointing, because it’s very difficult to get accurate, realistic clothing simulation inside unreal using their built in clothing system.

So where should you go from here?

Well, you can adjust the physics capsules to try to avoid the clothing penetrating the skin. If you’re seeing the skin of the character break through your outfit, you can also try hiding sections of your character’s body mesh. This is a trick that a lot of people use to avoid the problems that unreal clothing always seem to have.

The bottom line is that it will always be more accurate to do your clothing simulation outside of unreal. The best way to do it is in marvelous designer, and then bake the animated clothing as an allembic file, then import it back into unreal. But as far as real-time clothing in Unreal, I hope this video has been useful for you.

 

 

 

 

 

 

 

 

 

 

 

 

 

====================================================

====================================================

==================================================

 

 

 

(Optional) Add example body animation in Maya

If you want to add an example body animation to the MetaHuman body in Maya, here’s how to do it:

  • Make sure the metahuman is in a tpose.
  • In the viewport, click the brown vertical line between the character’s legs, which is the root joint.
  • Now we need to use the human ik tab, and if you dont have that open, you can go XXX.
  • At the top theres a dropbox called character. Change that to none.
  • Now click on “create character definition”
  • and click on blue button and choose rename cahracter
  • mh_m_med_nrw”. then click ok.
  • Now click brown root again
  • Click the blue button, “Edit character definition”, “load character definition template”.
  • And I’ve already imported the definition that I want – so I want to use “MetaHumanUE5_V1“. And if you don’t already have that, there’s a link to download it in the description below.
  • Now select “Match all bones with prefix‘, and delete everthing in this text box, thats really important. Then click ok.
  • So the bones will all turn green and you’ll get a big green check mark. If you don’t get that, something is definitely wrong so go back and make sure you’re still on track.
  • Ok so now go up to the padlock up here and click it.
  • Then at the top of the human ik window, change the source dropdown to “Control Rig”. And in the outliner, you’ll see that a control rig has been made.
  • Okay so for the animation timeline, what we want to have is the T pose at the beginning and then have the body moving around so that we can see if the clothing works ok with a moving body.
  • So to do that, in the outliner, click the the item with the green star at the front which is the HIK rig, then go up to the SELECT menu, and choose HIERARCHY.
  • Then on the timeline, go to the first frame, which is frame 0. And then press S on the keyboard to set a keyframe.
  • Then we go along to frame 34 and press S again on the keyboard to set a keyframe.
  • Now in the human IK tab, go up to the Character dropdown and change it to none.
  • Then click on “Import Animation Example”.
  • Then change the character dropdown to “dummy_fight” – which is the animnation we imported
  • Then in the outliner, click on”fight:dummy_fight”
  • Then in the top menu go to Select, and click Hierarchy.
  • So the dummy fight animation starts at frame zero but we need it to start later. So let’s select all the animation frames.
  • So go to frame 174, hold down shift, and click-drag back to zero.
  • Then middle mouse click and drag to the right so the red frames start at about frame 80.
  • And so now on our animation timeline, its a t-pose up to a certain point, and then it starts moving.
  • Click on Fight:Dummy fight in the outliner and press H to hide it.
  • Now in the Human IK tab, make sure source is on Dummy Fight.
  • Then click the big blue button, and go BAKE, then click the box next to BAKE TO CONTROL RIG.
  • A dialogue box will appear. The time range should be set to Start/End, and if it isn’t click on that. Then it should be set to about frames 75 to 250. If not, type those values in. Then click BAKE.
  • Now cjhange the timeline to be 300 frames long, just so its a bit longer.
  • Now if you go to frame 0 and go Alt V to play through the animation, it should work fine.
  • Go to the file menu and save the project.

 

 

OLD STUFF

 

MAKE CHARACTER INTO T-POSE

Now because of something we’re going to be doing later on, we need the character to be in a T-Pose, so to do that:

  • In the Viewport, click on the character’s bright pink upper right arm bone here and change the “Rotate Y” to “-55
  • Then click on the same bone on his left arm, and change “Rotate Y” to “-55“.
  • Click on the right lower arm bone, which is bright orange, and change the “Rotate Z” to “36“.
  • Now click on his left lower arm bone, and change the “Rotate Z” to “36“.

Okay, so he’s now in a T-Pose.





LATEST UPDATES






© Seabridge Films 2024. No warranties are made for the accuracy of content on this website. For educational purposes only. Please do not reproduce, in whole or in part, any resources in this website without express written permission.

Use of code from this website, including scripts and Python-based plugins, is at your own risk.