nCloth Bag of Marbles

 
 
 

This example will show you how to create a bag of marbles out of a single nCloth bag and a number of particles.

Create the marbles

You will begin by creating a number of nCloth marbles.

To generate a mesh for your marbles

  1. In the Polygons menu set, select Create > Polygon Primitives > Plane > .

    The Polygon Plane Options window appears.

  2. Select Edit > Reset Settings.
  3. Set the plane options as follows:
    • Width divisions: 2
    • Height divisions: 2
  4. Click Create.

    Maya creates a plane centered at the origin.

  5. Select Edit Mesh > Extrude.
  6. In the Attribute Editor, select the polyExtrudeFace1 tab and enter the following:
    • Divisions: 2
    • Local Translate: 0, 0, 1

    Maya generates a cube based on your original plane.

  7. Select Edit Mesh > Merge.
  8. -click the cube and select Object Mode.
  9. Select the cube.
  10. In the nDynamics menu set select nMesh > Create nCloth.
  11. Open the Attribute Editor.
  12. In the Collisions section, adjust the following attributes:
    • Thickness: 0.25
    • Solver Display: Collision Thickness
    • Collision Flag: Vertex
    • Self Collision Flag: Vertex

    The nCloth now appears as a number of colliding particles.

  13. In the Dynamic Properties section, adjust the following attributes:
    • Stretch Resistance: 0
    • Compression Resistance: 0
    • Bend Resistance: 0
    • Lift: 0.0
    • Tangential Drag: 1.0
  14. Select the nucleus1 tab and turn on Use Plane.
  15. In the scene view, select the nCloth and translate it above the ground plane. You may also rotate it if you desire.
  16. Playback the simulation.

    The cloth falls like a pile of marbles.

Creating the bag

To complete the simulation you need to hide the nCloth marbles and create a bag.

To hide the cloth mesh

  1. In the Attribute Editor, select the outputCloth1 tab.
  2. In the Render Stats section, adjust the attributes as follows:
    • Cast Shadows: off
    • Motion Blur: off
    • Primary Visibility: off
    • Visible in Reflections: off
    • Visible in Refractions: off
  3. In the Attribute Editor, select Object Display.
  4. In the Drawing Overrides section adjust the attributes as follows:
    • ObjectDisplay: Drawing Overrides
    • Enable Overrides: on
    • Level Of Detail: Bounding Box

    The nCloth marbles no longer appear in the scene view or render view.

To model the marble bag

  1. In the Polygons menu set select Create > Polygon Primitives > Platonic Solids > .

    The Polygon Platonic Solid Options window appears.

  2. Set the platonic type to Icosahedron and click Create.
  3. Select Mesh > Smooth.

    The icosahedron becomes more spherical.

  4. In the Attribute Editor, select the polySmoothface1 tab.
  5. Adjust the attributes as follows:
    • Method: Linear
    • DivisionLevels: 1
    • Divisions per Face: 10
    • Push Strength: 1.0
    • Roundness: 1.45
  6. In the Channel Box, adjust the channel values as follows:
    • TranslateY: 0.848
    • ScaleX: 1.5
    • ScaleY: 1.5
    • ScaleZ: 1.5
  7. In the nDynamics menu set select nMesh > Create nCloth.
  8. Playback the simulation.

    The bag of marbles falls to the ground.

Constraining the Bag

In order to keep the bag suspended you need to constrain its position.

To constrain the bag

  1. -click the bag and select Vertex from the marking menu that appears.
  2. Select a number of vertices at the top of the bag.
  3. Select nConstraint > Transform.
  4. Playback the simulation.

    The top of the bag now stays in place while the marbles weigh the bottom down.

Adjusting the pressure of the bag

When you render this scene, you may want the marbles to show through the bag more prominently. You can do this by adjusting the pressure setting of the bag.

To enhance the marbles displayed through the bag

  1. Select the bag.
  2. In the Attribute Editor, select the nClothShape2 tab.
  3. In the Pressure section, set Pressure to -0.5.
  4. Playback the simulation.

    The air is sucked out of the bag as the marbles fall which allows the marbles to show through the bag more clearly.

To animate the bag at full speed

  1. Go to the beginning of the playback range.
  2. Select the bag and then select nCache > Create New Cache.

    Maya automatically plays back the nCloth simulation and saves it to disk as a cache.

  3. Playback the simulation.

    The simulation plays at full speed.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License