Sunday, May 1, 2016

Disney Princess Ballgown Dress Advanced Stuff

So I ended the last blog post with a pretty basic, but realistic ncloth dress. If your dress looks like it's collapsing in on itself, you may need a cage underneath to hold it. That or just set the Initial State to a place where it's well settled.

Cage:
- To create the cage, copy the dress and delete faces so it only goes to mid thigh on your character:
 - Hide the dress in the Channel Box/Layer Editor and place the cage just below the dress's Dynamic Constraint; make sure the cage doesn't poke through the dress at all
- Make the cage an nCloth and a passive collider so the dress will react to it.
- Next, attach the cage to the body mesh (select top vertices, select body mesh, Point to Surface constraint. OR select top vertices and Transform Constraint)
- Rename your new ncloth in the outliner (ex. nClothCage)
- With the cage selected, open the Attribute Editor > Dynamic Properties> Raise rigidity to 1; this will stiffen the cloth and help hold the dress' shape as it moves and falls.
- You could also slightly raise the cage's thickness which thickens the cloth basically making it easier for other cloth to react to.

You'll have to play around with the settings in Attribute Editor from there. Like I said before, each dynamic simulation is different and I've had many instances where the cage either helped or hurt the simulation.

Initial State:
- To set an Initial state simply play the simulation with nothing keyed; only the dress should be moving
- Watch the dress settle. Give the cloth as many frames as possible to settle, sometimes even 100 frames isn't even enough.
- Try to pause the simulation when the cloth is almost settled and slightly flowing out.
- With the simulation paused where you want it to start, select the dress and go to Fields & Solvers in the FX Rollout > Initial State under Solvers > Set for Selected.
- Rewind the simulation and the dress should start from there.

You can also smooth the dress another subdivision or two and play with the Attribute Editor controls which I'll cover some of now.

So from my experience, the best way to learn the Attribute Editor is to start changing numbers and literally playing with the values. Some attributes might not be very clear though:


Input Mesh Attract:
Simply put, this attribute tries to set the cloth back to its original state. So if the dress looks weird or isn't settling well after animating a 360 turn, you may want to key the Input Mesh Attract.
Set a Key on an Attribute:
- Move the time slider to the frame you want to key
- Right click on the attribute you want to key; if it can be keyed 'Set Key' should be the second option.
Now more specifically,
Keying Input Mesh Attract:
- At fist frame right click Input Mesh Attract and Set Key 0.000 
- Move the slider to where the cloth isn't settling well
- If the cloth is going to move again after this (ex. another rotation), Set Key .300 or so.
- If the cloth isn't going to move again try .500; don't go too high though, .500 tends to be enough.

Hopefully your cloth will be moving smoother now.


nCloth Presets:
There are also presets of different kinds of cloth and other materials in Maya that you can use to make your cloth flow more realistically:
There are plenty of cloth types and other materials to choose from in the drop down menu including saving the current work on your cloth as a preset. When you hover the material of your choice, you also have the option to make the entire cloth that material or just a certain percentage. Towards the bottom you'll also see a Notes box for your nCloth. When you choose a preset it will tell you how that material flows and interacts with the environment within Maya. For example silk is lightweight and tends to fly up when it moves at a high speed; good for a sun dress, but maybe not great for a ballgown dress.

Painting Vertex Properties:
 You can also paint specific attributes onto your cloth. If you've ever skinned a rig before, it's the same process as painting skin weights (but maybe a little less annoying). 
Select the cloth and in the FX rollout go to nCloth > under Maps Paint Vertex Properties and choose the attribute you want to start with (I always switch attributes by accident somehow so make sure you're always painting with the correct attribute).
So as you can see from the picture above, I've already painted a light layer of rigidity at the waistline of the dress. I did that so the dress won't bunch up when Sam twirls. If you find it easier to work in color as opposed to black and white, you can select Use Color Ramp under Paint Attributes. So to paint rigidity I selected the second brush, selected Replace, dropped my value to about .0600, and painted gray (or light bluish green for color) where I wanted the dress to be rigid. When I covered the area I wanted to be rigid I then selected smooth to ease the rigidity away. To resize the brush hold down b, left click, and drag.

I also painted some stretch from the waistline down a few edge loops to help twirls.

Caching:
Once you have the cloth flowing like how you want it to with all the above settings, it's time to cache it. Caching saves the object or cloth and reduces the amount of calculating Maya has to do which makes the scene run better overall. To cache the dress or any cloth simply select that geometry and go to Cache > Geometry Cache > Create New Cache; if you want to save it somewhere specific, check the box. Maya will take a while to run through the simulation, but once it's done the simulation should play much smoother. Other objects and effects can be cached in your scene as well. For non-geometry you can also use nCache > Create New Cache.

In closing, I'm very happy with how this simulation turned out and look forward to perfecting it for a future portfolio piece.

Below is an excerpt of my final piece. The trees were made using Paint Effects within Maya and the leaves made into nCloth. The lighter plane the girl is standing on is a 3D Fluid container.







Saturday, April 30, 2016

Disney Princess Ballgown Dress

Hello! I'm a college student studying Game Art Design in Massachusetts.

This semester I took Visual Effects; a class I quickly took interest in and now love. For my final we had to work with nCloth by making some sort of clothing to a rig of our choosing, animate that, and add some effects like fire on top. I decided to make Belle's dress from Beauty and the Beast, but found it hard to find tutorials or any additional help online on how to make a big nCloth project like a ballgown dress so I decided to write this blog as I progress.

Before I get started, here's some notes:
I'm using Maya 2016
I'm using the Sam rig from CreativeCrash; the rig is good, but unlocking the mesh in annoying.
It's actually better to build the nCloth without the rig in the scene; I didn't know that when I started
To build the cloth without the rig in your scene first import it, shape the cloth to the rig's waistline, then remove the rig from your scene.
If you keep the rig in your scene, your view port will most likely chug
With that being said, SAVE OFTEN!! Maya crashes a lot... -_-
My animation settings are set to Play Every Frame and Real Time 24fps

Ok, so let's get started!


- Start the dress with a cylinder; it's much easier to work with rather than a sphere.
- Place the cylinder over the rig's waist where you want the top of the dress to sit. Make the subdivision caps 0 and shape the top face to closely fit the waistline. Leave some room between the edge of the cylinder and the waist.
- Next, select the bottom face, widen it to the width of the dress, then pull it down to the length of the dress (I dragged mine down just above her ankles; leave space for the dress to hit the floor).
- Ballgown dresses are big and heavy, but not every dress is like that. If aiming for a ballgown dress, yours should look something like this:
- Delete the top and bottom faces.
- In the modeling roll out Mesh > Smooth the object about 2 subdivisions and further adjust the edge loops to shape the dress you want.
- Name the object dress in the outliner (Windows > Outliner); leave the outliner up.
- Once shaped, make the dress an nCloth in the FX rollout > nCloth > Create nCloth
- A nucleus should now pop up in your outliner, click on that and open in the Attribute Editor (Ctrl + A)
- With nucleus1 open in the Attribute editor scroll to Ground Plane and check the Use Plane box:
- (Notice the nCloth Tshirt icon in the outliner; we'll come back to that soon)

- Make sure your render settings are set to Play Every frame and Real Time 24fps
- If you press play now the dress should fall, but it'll be very stiff. The reason it's stiff is because it doesn't have enough edge loops to read like a cloth.
- So make sure the dress is shaped to your liking
- Then in the Modeling rollout Mesh > Smooth your dress again 1 additional subdivision:
- The dress should fall better now, but if not don't worry; nCloth is finicky and I get different results every time. 
So if you decided to use the Sam rig like me, we have to unlock the mesh like I mentioned in the notes section earlier.So to do that:
- Go to the outliner and open sam_animateME_2013_v2_11:all_anim
- Next open sam_animateME_2013_v2_11:geo_grp
- Then open sam_animateME_2013_v2_11:skinning_geo_grp
- And finally select sam_animateME_2013_v2_11:body_geo
- In the Attribute Editor under sam_animateME_2013_v2_11:body_geo open Display > Drawing Overrides > and select Enable Overrides.
- Now you should be able to select Sam's body in the view port. (Do the same for head and hair if you want).

- Now that we can select the body mesh, I suggest placing that on a separate layer in the Channel Box/Layer Editor
- Select the body mesh, go to nCloth in the FX rollout, and Make it a Passive Collider; this prevents the cloth from passing through the mesh and instead reacting to it.
- I also suggest renaming the nCloth in the outliner to DressnCloth if you plan on doing multiple cloth objects and placing that on a layer as well.
- Now select the dress and highlight the top row of vertices; it's time to attach the dress to the body (or constrain it if you're not using a rig)
- With the top vertices selected, shift + click the body mesh and go to nConstraint > Point to Surface Constraint
- (WITHOUT RIG) With the top vertices selected go to nConstraint > Transform Constraint
- The top of the cloth should be constrained at the top now, and flowing down at the bottom for both options. Also notice there is now a Dynamic Constraint in the outliner; I also recommend renaming that. Mine is dynamicDressConstraint1:
 - To test the dynamic flow of the dress try animating the character or using an Interactive Playback.
- To use Interactive Playback select the desired control, then go to Fields & Solvers in the FX roll out, and select Interactive Playback under Solvers.
- The timeline will begin to play; move whatever control you would like to test the limits of the cloth
- When done testing stop the animation, rewind the timeline, and Ctrl + Z until the control is back in it's original position

So, that's the basics of making a big dress like this. However, this is far from perfect and while animating or moving the rig around you'll most likely see tension or breaking in the cloth. Making the dress perfect is something I'm still trying to master, but so far I can tell you it's a bit more advanced and requires a lot of tweaking in the Attribute Editor and testing via Playblasts. And everyone's dress will most likely be different in some way, so I can only tell you hat worked for me and some other techniques I picked up along the way. But, I'll save that for another post; hoped this helped!

Questions?
Comment below!