Tdw78 t Cloth

download Tdw78 t Cloth

of 4

Transcript of Tdw78 t Cloth

  • 7/28/2019 Tdw78 t Cloth

    1/4

    here are a handful of visual phenomena that are

    devilishly difficult to simulate with a computer.

    Fluids, hair, fur and cloth are notorious for

    requiring complex and expensive software,

    talented artistry and powerful computing. But these effects,

    while feared by digital artists, are able to lend a sense of

    realism to CG work not easily achieved by any other means.

    While the topic of this tutorial is cloth, all of these effects

    share a common trait: extreme complexity. You dont have to l ook

    any further than your own shirt to witness the breadth of chaos

    exhibited by a simple piece of cloth. The cascading folds of material

    on a typical T-shirt would be enough to send any polygon modeller

    screaming for help.

    Fortunately, help isnt far away. This tutorial is meant to

    introduce you to a typical workflow for animating cloth with

    Maya Cloth. This is a powerful toolset which, in my opinion,

    deserves some serious attention. Its not the easiest thing in the

    world to use, but its reliable. Novice users are often confused by

    its somewhat odd workflow, mistaking its steep learning curve

    for a weakness. The truth is that Maya Cloth can be hard to learn,

    but its difficulty is proportional to its flexibility. I want to mention

    that many people prefer the SyFlexplug-in for serious cloth work.

    In my experience, SyFlexhas definitely been somewhat easier to

    work with and perhaps less prone to instability. The SyFlexsolver

    seems to adaptively adjust itself where Maya Cloth requires a little

    babysitting from time to time. The bottom line: if you have the

    money, get SyFlex. However, Maya Cloth is still a capable solver.

    This tutorial will provide an overview of a production-worthy

    workflow for creating believable cloth animation. Well follow

    the creation of a cloth garment for the Minx character from the

    upcoming The Art of Rigging Vol iii. In the textbook, youll find

    every detail of this fascinating topic, including the creation of our

    characters hair/fur, cloth and much more.

    Kiaran Ritchie is an author on The Art of Riggingseries from

    CG Toolkit. Hes currently working on a number of PS3 projects

    at Factor 5 in San Rafael, California

    www.cgtoolkit.com

    T

    066 | 3D WORLD3D WORLD June 2006

    FACTFILE

    FOR

    Maya Unlimited 7+

    DIFFICULTY

    Intermediate

    TIME TAKEN

    10-30 minutes

    ON THE CD

    Full-size screenshots

    Mayascene files

    Character turntable

    movie

    Playblast movies

    ALSO REQUIRED

    N/A

    Creating realistic animated cloth is a notoriously difficult process, but this tailor-made tutorialshould help you get even the most misshapen characters clad with ease BY KIARAN RITCHIESackcloth and gashes

    MAYAMAYA

    TUTORIALS |Cloth simulation

    TDW78.t_cloth 066TDW78.t_cloth 066 7/4/06 1:50:35 pm7/4/06 1:50:35 pm

  • 7/28/2019 Tdw78 t Cloth

    2/4

    June 2006 3D WORLD3D WORLD | 067

    To model a garment with Maya Cloth, we must start

    with a pattern. This pattern represents the various

    pieces of cloth (panels) that will eventually be sewn

    together to form the finished garment. A panel is constructed

    from three or more planar NURBS curves that form a closed

    loop. A typical garment may comprise several panels that are

    sewn together to create a polygonal mesh.

    Creating garment patterns is beyond the scope of

    this tutorial, but you shouldnt have to look further

    than your local fabric store for numerous examples

    of various patterns for common garments. For the Minxs

    robe, I constructed the panels without a set pattern, but for

    a more humanoid character, it would be easier to use a pre-

    made pattern. The Minxs robe uses 18 separate panels.

    03

    STAGE ONE |Drawing the panels

    Open stage01.mb from the CD. This scene file

    contains the Minx character. Unlike most cloth

    software, Maya Cloth provides a method of

    both animating and modelling clothing. This is an often

    misunderstood feature that, when used correctly, can create

    excellently constructed garments with ease, using a real-

    world pattern/panel/sewing paradigm.

    01 02

    Start by selecting each set of panel curves from the

    Hypergraph. With a complete panel selected, choose

    Cloth > Create Panel. This will create a shirt icon

    in the middle of the panel. Go through the Hypergraph and

    make a panel for each group of curves. Now were ready to

    create the garment. Select a panel icon (the shirt) and chooseCloth > Create Garment. This creates a polygon mesh.

    07

    To draw a panel, select the EP Curve Tool and trace

    the pattern. Create a new curve for each segment

    of the pattern. Use the [c] key to snap the start CV

    of each new curve to the end CV of the last curve. Make sure

    you create the curves in an orthographic viewport in order to

    keep them planar. The size of a panel determines the surface

    area of the resulting cloth.

    04

    You can now group the panel curves and position

    them around the character. This stage usually

    involves lots of trial and error. The panels must be

    sized to give the garment enough cloth so that it drapes

    properly. You may find yourself returning to this step several

    times to fine-tune the fit of the clothing. Remember, a larger

    panel creates more cloth, which results in baggier clothing.

    05

    Now open stage02.mb. This contains the finished

    panel curves, ready to be sewn together into a

    garment. This process involves three steps: first, we

    must turn each set of panel curves into a panel. Second, we

    create a garment from one of the panels. Finally, we sew the

    neighbouring panels together, automatically creating the restof the garment as each new panel is sewn together.

    06

    Cloth simulation| TUTORIALS

    Now lets begin sewing everything together. Start

    with the panel that was turned into a garment and

    sew it to all of the neighbouring panels. To do this,

    select two panel curves and execute Cloth > Create Seam.

    This will add the new panel to the garment and extend the

    polygon mesh into the new panel. Work your way through therest of the garment, sewing all the seams together.

    08

    EXPERT TIP

    Streamlined sewingThe process of creating panels,

    sewing them together, draping,

    fitting, adjusting and resizing can be

    quite time consuming. To streamline

    the process, we can create an

    instanced duplicate of the cloth

    curves to use for resizing, while

    the sewn garment updates in real

    time. To do this, create an instanced

    duplicate of the panel curves before

    turning them into panels. You now

    need to create the garment from

    the duplicates and sew it together.

    From here, you can simply adjust theshape of the panel curves to quickly

    tailor the garment.

    i

    STAGE TWO |Creating the garment

    TDW78.t_cloth 067TDW78.t_cloth 067 7/4/06 1:50:38 pm7/4/06 1:50:38 pm

  • 7/28/2019 Tdw78 t Cloth

    3/4

    068 | 3D WORLD3D WORLD June 2006

    Open stage03.mb to see the fully sewn garment.

    Now select the garment and find the cpStitcher1

    node in the Channel Box. Set the Base Resolution

    attribute to a value of 600. This will create more polygons for

    the solver to use when creating folds and collisions. Higher

    resolutions yield more realistic folding, but at the cost of

    longer simulation times.

    09

    For a more accurate simulation (especially with

    collisions), increment the Frame Samples attribute

    until any interpenetrations or glitches are remedied.

    The Relax Frame Length attribute is used to drape the

    garment onto the character. It applies a rubbery material to

    the cloth to help it pull together smoothly. Set this to 0 after

    draping the garment.

    11

    Open stage05.mb. Having seen how to create and

    drape a garment, lets apply these principles to an

    animation. This scene file contains a more refined

    version of the garment thats draped onto the Minx. This

    time, the character has been animated and so we need to set

    up the simulation so that the cloth flops around as the Minxjumps up and down.

    15

    Note that the scene file doesnt contain any curves,

    panels or seams. This garment was created using

    the same method described earlier, except that,

    after draping, I duplicated the mesh to create the cloth

    object. Theres no need to keep the construction history

    (panels) for the cloth garment after its draped. Also note thatholes have been cut into the mesh at the base of the spikes.

    16

    Run the simulation again and youll notice that the

    garment now collides with the characters skin.

    Unfortunately, it gets stuck on the spikes. We want

    the collision to ignore the faces on the spikes. To do this,select all of the faces (use the Quick Select Set) and choose

    Cloth > Collision Cloth Set > Create. Uncheck Enable Rigid

    Collisions on the Cloth Set in the Attribute Editor.

    13

    Open stage04.mb. Play back the scene (use Play

    Every Frame) to run the simulation. At this point, the

    garment crumples into a ball during the relaxation

    phase (first five frames) and then falls due to gravity. Wewant it to hang from the character. To do this, select the

    Minxs mesh and choose Cloth > Create Collision Object. Set

    the Collision Depth and Collision Offset to a value of 0.1.

    12

    Because Maya Clothuses a pseudo physically based

    simulation engine, the scale of the solver must be

    set in order to produce realistic results. This is

    computed by taking the real-world size of the garment

    (80cm) and dividing it by the scene size (8cm). Set the Solver

    Scale attribute on the cpSolver node to a value of 10 (80/8).

    Leave the rest of the solver attributes at their default values.

    10

    Now we need to set up the cloth again. Select the

    garment mesh and choose Cloth > Create Cloth

    Object. On the solver node, set the Start Time to

    -10 and the Solver Scale to 10. Because the garment is

    already draped, set the Relax Frame Length to 0. Make the

    Minxs mesh a collision object and set the Collision Offset andCollision Depth to 0.1.

    17

    TUTORIALS | Cloth simulation

    Run the simulation and you should now notice that

    the garment passes right through the spikes. Well

    cut holes in the garment, but for now we just want

    the solver to ignore the spikes. Collision sets are useful forcheating the solver and can help you prevent glitches and

    pinches in the cloth. This concludes the set-up of the cloth, so

    lets take a look at simulation.

    14

    STAGE THREE |Adjusting the Cloth solver and adding collisions

    STAGE FOUR |Simulating the cloth

    TDW78.t_cloth 068TDW78.t_cloth 068 7/4/06 1:50:42 pm7/4/06 1:50:42 pm

  • 7/28/2019 Tdw78 t Cloth

    4/4

    June 2006 3D WORLD3D WORLD | 069

    Cloth simulation| TUTORIALS

    You may notice that the cloth doesnt have any

    thickness. Actually, it lacks any detail that would be

    superfluous to its motion. Unhide the render cloth

    layer to see a thickened version of the cloth. This copy has

    been extruded and quadrangulated (for better smoothing),

    and it will be wrap-deformed to the simulation garment, so

    that it deforms along with that garment.

    21

    Its rare that a cloth simulation will be perfect the

    first time. This usually requires quite a bit of trial

    and error, various adjustments and elbow grease.

    Even if the simulation goes well, there are usually small

    imperfections, popping vertices or interpenetrations. Its not

    always easy (or even possible) to fix these by adjusting thesimulation. Sometimes you need to just dig in and manually

    model the fixes. To do this, scrub to the offending frame and

    model the correction. When youre happy with how it looks,

    select the mesh and choose Simulation > Update Cloth State.

    The cache file will be updated to include the new changes.

    This kind of cheating is referred to as shot sculpting. Once

    the animation is looking good, simply hide the simulationgarment, smooth the render garment and youre ready.

    23

    STAGE FOUR (Continued) |Simulating the cloth

    Now play the scene. You should notice that the

    cloth begins to crumple and misbehave around

    frames 3-5. This is when the Minx springs upwards

    at the base of the jump. During extremely fast motion, its

    not uncommon to have to tweak the solver to help it solve.

    Increase the Frame Samples from 1 to 5.

    18

    Rewind the scene and choose Simulation > Delete

    Cache. Each time the simulation is run, Mayasaves

    a cloth cache file (MCC). Subsequent playback will

    read the cloth vertex positions from this cache data. In order

    to resimulate the cloth, you must first delete the old cache.

    If no cache is found for the current frame, the solver will

    automatically recalculate it.

    19

    With the cache deleted, replay the simulation. A

    modest workstation may take several minutes to

    compute the 50-frame cloth animation. When the

    simulation is finished, you can scrub through the timeline

    to view the animation stored in the cache file. If the cloth

    encounters a problem, you can truncate the cache from the

    problem frame, adjust some parameters and resimulate.

    20

    STAGE FIVE |The finishing touches

    Select the thick cloth, [Shift]-select the simulation

    cloth and choose Deform > Create Wrap. Set the Max

    Distance to 0.2 and Influence Type to Points. Now

    the thick cloth is animated along with the simulation cloth.

    The render garment can contain any extra details and should

    be smoothed before being rendered. Also make sure to lay

    out the UVs of the render garment before wrap-deforming it.

    22

    TDW78.t_cloth 069TDW78.t_cloth 069 7/4/06 1:50:45 pm7/4/06 1:50:45 pm