Exploding a cloth in Maya 3D

Magda Odrowąż-Żelezik
Fink IT
Published in
10 min readFeb 6, 2020

This article is part of my series of ‘Learning 3D animation’, where I cover problems I’ve solved, learning materials I’ve used and buttons I’ve clicked. Feel welcome to join me.

Universal message

You will learn how to create an explosion of a model.

What I want to do

I’m relatively new to 3D editing software but I sure got ideas. For my project I’ve been aiming to create a sequence of garments morphing into one another. It turned out not to be so easy.

Tryouts

Using Marvelous Designer program I have prepared several dresses models, which I have then imported to Maya. In my mind I was prepared to simply morph seamlessly one into another using Maya morphing tool. As a newbie, little did I know that morphing tool can be used on on models with the exactly the same number of faces. It was not an option for me, since I have no control on the outcome of Marvelous Designer object. Reducing ad/or matching faces count by hand seemed like an impossibly tedious task that could probably fail to produce desired results.

Trying not to be desperate since my imaginary result was unachievable, I started googling for solutions. Most common answer was to use particles to distort the original model and then form them into next one. Seemed like a fine idea.

Except not.

I actually played with the effect and particles allow you to achieve amazing animations, very dynamic and powerful at a relatively low computation cost. I will prepare a separate article how to distort a model into particles and the other way around. For now, all I can say is — they’re awesome, but again impossible for me to use. My project was to be expanded to three.js website, where I was aiming to use pre-baked animations prepared in Maya. As it occurred, it is not possible to bake an animation of particles. Go render or go home.

I was sure I was missing something in the particles matter and I tried to solve the issue with my teacher, but he gave me a much better idea instead — which actually is a subject of this article. Why not just regularly destroy the garment as if something exploded inside it?

Workflow

The idea how to do it is simple and there is not magic Maya functions involved (almost):

  1. You choose the object to destroy
  2. You create a small object inside the first one
  3. You animate the size of the second object so that it gets waay bigger and eventually destroys the first one from the inside.

Simple. To actually achieve the spectacular destruction, we must refer to Maya physics engine and it’s options. Let’s add a little bit to that workflow:

  1. You choose the object to destroy
  2. You convert the object to nCloth object
  3. You create a small object inside the first one
  4. You convert the second object to passive collider and set it texture to transparent
  5. You animate the size of the second object so that it gets waay bigger and eventually destroys the first one from the inside.

Five step routine does not appear too complex, does it?

Step by step example

First I imported my prepared dress model into Maya. To be fair, the object doesn’t necessarily have to represent a cloth of any sort, it is just my example.

The dress was originaly created with Marvelous Designer thus the details and structure.

This garment is way too detailed for the effectiveness of this experiment. I needed to drastically reduce the number of faces.

To reduce faces choose Mesh->Reduce from the Modeling menu
Outcomes of reducing faces, left to right

The finished piece lost a lot from it’s original smoothness and polish, which is a bit painful, especially viewing from this close, but not that bothering at all:

  1. The viewer will be observing the scene from much further to gasp the whole effect of explosion.
  2. The garment will be floating slightly (in this case) to stress out it’s original character.

If you are using a simpler model or are working on a faster machine, probably you won’t have to reduce the faces that much. Just try first whatever works for you and what kind of compromises you are willing to make.

To smooth it out a little bit and of course add to the great outcome effect it is time to apply some texture. For this example I am applying a simple Lambert texture to profit from the matte effect as well as probably a hint of transparency.

Applying Lambert texture and modifying properties

If needed, one could play with the textures on the dress a bit more to loose this broken effect on the shirt in example. For my purposes, it is fine to leave it like this.

Next step is to convert the dress to nCloth object and focus on the properties here. To do that, I switch for FX menu. Having selected the dress, I choose from the menu nCloth -> Create

Be sure to select the dress first, otherwise Maya will prompt an error

Two new nodes have now appeared in the outliner, nucleus and nCloth, each having different options for us to play with. Nucleus, according to documentation is

the solver node, which carries all the attributes affecting the solver system, including internal forces.

What does that really mean? Nucleus node allows the other “physical” nodes to operate, providing physical space for them and taking responsibility for calculations. Let’s take a look what exemplary properties it has:

  1. Gravity — in this example set to 0, it comes with a default value of 9.8 (duh). This is the gravity force that is affecting our cloth.
  2. Air density — also affecting the cloth, you can play a little with it’s value to create more “slow motion” effect on the cloth movement
  3. Wind Speed — this is general wind in the environment. If set to a value 1 and above would probably blow out light cloth away. 0.3 will be sufficient for me to have a gentle floating on the skirt
  4. Wind noise — as you may imagine, to achieve a little bit more natural effects it may be necessary to add a little variation to the strength of wind in time.

There is also plenty of attributes to play with, some maybe less important for cloth animation, some more. To gather more info please visit Maya documentation.

Let’s now take a look at another node that was created in the last operation, which is nCloth shape. We are going to play a little bit with it’s dynamic properties that determine how the cloth will behave when interacting with another physical object.

For this project, I mostly used:

  1. Stretch resistance — I wanted my cloth to get destroyed more glass-like than textile-like, so I increased this value for easier tear.
  2. Bend and shear resistance — depending on the force applied it could be fun to play with this two values for more or less rigid effect on textile.
  3. Rigidity and deform resistance — prevent the object from loosing it’s original form. Be vary of these two. Setting a small value to rigidity (like 0.003) can give you a nice swirly movement effect if a great force is applied to explosion itself, but larger will prevent it from being torn at all.
  4. Mass — obviously, with combination with solvers wind and air density and later explosion force you can use mass to control the blow range in example.

Fantastic. Last but not least we need to set seams for the cloth to be torn in the blow up. Since I want it to explode to tiny pieces, I would like it to be all the edges of the faces. Let’s select them all and create a Tearable Surface:

Having selected the dress choose Tearable Surface from FX menu -> nConstraint.

Tip: there’s no need to select specifically edges. If you select the whole object, tearable surface will be applied only to edges anyway.

We can now see all the tearable seams visible on the dress object and constraint node in the outliner.

The dynamic constraint node has it’s own important properties. You are welcome to play with them all, but for this effect the most important are two:

  1. Strength — this is the seam strength. Setting it to 0 makes seams very fragile and prone to tear at a slightest force applied. This is exactly what we want.
  2. Force- a very powerful property. Setting it to even a really low value would drastically increase the power of your tear-up. Let’s leave it blank for now.

And that concludes the presets for the material! Let’s now create the actual “bomb”.

This part begins very easy. All we need to do is to create a polygon primitive, can be a sphere or a cone, I’m making an attempt with a cylinder. I’m making the cylinder a high as the dress object, but thinner in radius. I’m setting it’s texture to be completely transparent, as we are not supposed to see it at all.

It is important that the inner object does not cut through the outer object. In example, if the dress has a much thinner waist, we would have to adjust the cylinder accordingly, even if it meant making it look almost like a stick.

Tip: when adjusting the sizes turn the environment around and take a look at all angles.

The only thing left now to conclude our preparations is making the cylinder an actual physical object. To do that, we need to select it and then from the FX menu choose nCloth and create passive collider.

Now the cylinder can actually interfere with the dress. We can use that to finally create the explosion. Let’s begin animating!

Explosion

In the timeline at the bottom of the window select the frame in which you would like the explosion to start. In my opinion it is best not to start at frame 1 since you could want to show the viewer the entire object first. I choose it to be frame 21.

I navigate to pCylinder properties and right-click on the Scale name. Then I select Set key.

This operation will set the current scale values to stay the same from the beginning of the clip up to frame 21, where I am now.

You should see the whole row to be highlighted bright red now.

Now choose a frame where you would like the explosion to end. Not definitively, just the destruction part. The shorter the time, the more violent it would be. I choose around frame 60. Having less than 40 frames difference will make my explosion take less than a second.

Now select the pCylinder again and scale it way up to completely outgrow the dress and beyond. You can use arrows or the scale values, does not matter. When you are satisfied with the result, navigate to Scale and choose Set Key again from the right-click menu.

Let’s create a preview now. You can simply press play button, but since it’s a quite complex animation it will calculate very slowly. It would be best to preload it first, so we would take a look on it real time.

To do that, let’s use nCache property. From the FX menu choose nCache and create from object. This works for physical objects, so be mindful to select nCloth first in the Outliner.

Wait a few minutes so your animation is calculated and stored in cache for you to preview.

Be sure to select nCloth first before create new nCache

After the whole process is finished you may preview your animation pressing play button next to timeline:

Middle of tearing animation
Clip from Chernobyl series from Tenor

Not quite the effect I wanted. Let’s see what we can do about it.

In the Outliner I select the dynamic constraint node. Remember when I wrote that increasing force to a really low value could cause the drama?

Well, I really need the drama now. Let’s add 0.001 unit of The Force to our animation.

To see the adjustments made you need to run nCache again.

E voila!

Now this looks exactly how I wanted it to. Cloth explodes to little pieces, keeping only little from it’s original texture.

Conclusion

Play with it. Destroy it. Keep saving it since sometimes you can create too much and Maya won’t handle it (or your machine rather). Choose different primitives for explosions. Create this perfect explosion.

Of course you could enhance this with some wind or some other distortion nodes like swirls or force fields. Stay creative.

Hope this helps :)

This article is based on a part of my engineer thesis. All the screenshot belong to me and depict my original work.

I use Maya 2018 Student Version.

--

--

Magda Odrowąż-Żelezik
Fink IT
Editor for

Creative front end developer, currently excited about learning 3D graphics. Visit magdazelezik.com