DIY Explosions

The Basics

Let's start from the very beginning (indeed, it's a very good place to start). Before we can add fire and smoke and cool sound effects, we first need something to explode. Since we want something simple, lets make it a small, round bomb.

We start with a blank new scene. We usually get this right after we open Maya, but if for some reason, you don't have a blank scene on screen, go to File>New Scene.

00blank

The first thing we do is create a NURBS sphere. Click on Create>NURBS Primitives>Sphere.

01createsphere

Then, click and drag on screen to get a medium-sized sphere.

02dragsphere

Finally, we move the sphere so that it's sitting just above the horizon plane. Press 'w' on the keyboard, and then drag the sphere upward until it's bottom is right above the center marking.

03movesphere

If you want to do this precisely, you can click on the 'Four View' button on the left toolbar pane and adjust based on the front or side views.

04fourview

Now, if you switched to Four View, go back to Perspective View by clicking the button on top of Four View.

The next thing we want to do is to split up our sphere into pieces. First, select the sphere you just created. Then, change to the Dynamics toolbar set by changing the active item in the top left toolbox.

05dynamics

Go to Edit>Delete by Type>History. This will delete the construction history, and is an important step if we want to be able to properly render our animation later on. Next, go to Effects>Create Shatter and click on the small box beside 'Create Shatter' to bring up the options pop-up.

06createshatter

Finally, choose the Surface Shatter tab and set the parameters that we want. 'Shard Count' determines the number of pieces to split the sphere into, and a non-zero 'Extrude' value gives the pieces some thickness. The important options here are 'Post Operation', which we want to be set to 'Rigid bodies with collisions off', so that our shards get modeled as solid pieces; 'Smooth Shards', which should be unchecked; and 'Original Surface', which we want to be hidden.

07shattertool

Click on 'Create' when you're done. You should now see a solid-y looking green sphere on the screen.

The next thing for us to do is create a method for making these pieces explode outward from the center of the sphere. This can be done using a particle emitter. We make our particle emitter act like the force that pushes everything apart.

Go to Particles>Create Emitter, and again select the small box to bring up the options box.

08createemitter

Give your emitter a name, and enter values for 'Rate', 'Speed', and 'Speed Random'. Click on 'Create' when you're done.

09emitteroptions

At this point, your emitter will be centered at the bottom of the screen. Drag it upward until it is inside the shattered sphere.

Now, we need to set the interactions between the particles and the shards. Bring up the Outliner window by choosing Window>Outliner. The Outliner is a useful tool because it allows us to view and select the various elements that we have in our scene.

10outliner

In the Outliner, select the particles and one of the surfaceShatter shards. Then, click on Particles>Make Collide and again choose the small box to bring up the options.

11makecollide

In the options box, set the value for 'Resilience' to somewhere around 0.1 to 1. When you're done, click on Create.

12collideopts

Repeat the above steps for all of the shards. Once you've set the Make Collide options once, it stays the same for all your succeeding operations. Thus, a shortcut would be to use the 'Make Collide' button, found third from the left in the 'Dynamics' tab.

13collideall

After you're done setting the collision options for all your shards, the whole sphere should now appear pink.

Now it's time to set some other properties of the shards. Shift-select all the shards in the Outliner window, and then click on the 'Channel Box/Layer Editor' tab on the right side of the screen. Set 'Particle Collisions' to on, and increase the 'Mass' value.

14particleopts

If you step through the frames using the buttons in the bottom right playback box, you'll be able to see the effect of our particles on the shards that we created earlier.

15step

Now, currently, our particle emitter is set to emit points. Switching to the 'Rendering' tab and clicking on 'Render Current Frame' will reflect this setting: the shards are rendered, but our particles only act as the "force" that pushes them apart.

16render

The particles themselves aren't shown. This isn't really a problem, except that we can have a dual purpose for our particles: Not only can they serve as the explosive force, but we can also use them as dirt/debris from the explosion.

Choose your particles from the Outliner window, and in the Attribute Editor, select the particleShape tab. In the 'Render Attributes' section, change the Particle Render Type to 'Blobby Surface'. Click on 'Add Attributes for Current Render Type' and decrease the radius to about 0.25 or so.

17particles

Rendering with these settings produces blobs that are too big, so make the radius smaller until you're satisfied.

18nicerender

Next, notice that our particle emitter continuously emits particles. Since we're now using it as debris, this really isn't realistic. What we do is set keyframes so that we can change certain attributes through time.

Select the particle emitter and go to the Attribute Editor. Click on frame 4 in the bottom window. Change the 'Rate' to 0, right-click on 'Rate', and choose 'Set Key'.

19setkey1

Now, click on frame 5, set the rate back to 2000, right-click on 'Rate' and choose 'Set Key' again. Finally, go to frame 16 or so, and again set a keyframe for rate 0, just as we did previously. Red lines should appear on the timeline where you put your keyframes. With these settings, our particle emitter will start emitting at frame 5, and stop at frame 16.

Let's play around with the shading of our objects. Select the shards and switch to the 'Rendering' tab. Choose a Blinn material for our shards. You can adjust the colors of this in the Attribute Editor. Do the same for the particles.

20material

Finally, we change the background color to make everything more visible. Select the perspective (persp) camera from the Outliner, and switch to the perspShape tab in the Attribute Editor. Scroll down to 'Environment' and change the background color to white.

21whitebg

We're finally ready to render the complete animation. Switch to the 'Render' tab and open up 'Render Settings'. Change the file extension to 'Tif', and use the 'name.#.ext' format for naming your frames. Specify a value for the start and end frames, and then click 'Close'.

22rendersettings

Finally, click on the Batch Render button, and wait for Maya to render your animation. Maya will render it in individual frames, so you'll need a program to stitch the frames together. I use Adobe Premiere Pro, but there are open-source programs like Virtualdub that can be used as well.

Watch the rendered movie here

On to the second part!


2011-03-29 17:43