Explosions

In this example we will set up a simple simulation where a sphere explodes after a certain period of time.

1. Create a sphere. Animate it as you like, for example define a velocity value for it.

2. The sphere still selected, go to the Simulation tab of the toolbar and click the Explode tool. A new Explosion modifier appears to the hierachy.

3. The tool control bar shows the properties of the explosion modifier. Set Type to Cubes, Part Density to 10 and Explode Time to frame 50.

Explosion options

4. Play the animation. Sphere will explode after 50 frames.

This effect breaks the exploding object to a number of pieces. The number of explosion parts can be controlled through the Part Density field.

The Life Time field can be used for controlling how long the exploded parts remain alive.

Exploding sphere

Explode at impact

In addition to a specified time, objects can be exploded by collisions. For example, you can create a gun, which shoots exploding bullets.

To create a simulation where a bullet explodes its target object:

1. Create two spheres: one representing a bullet and one representing a target.

2. Use the Simulation/Velocity tool to define an initial velocity for the bullet so that it will finally hit the target sphere.

3. Select both spheres and activate the Collision tool in the Simulation tooltab. The default options are suitable, so simply click Accept.

4. Select the target and apply the Explode tool.

5. The toolbar shows the option of the Explode modifier. Set Explode Time to zero to switch off time based explosion. Activate the Explode on Impact option. Then play the animation.

Explode at a specified time

Explosion is controlled by an Explode attribute. As soon as this attribute is set, the object explodes. Explode Time and Explode on Impact options simply set this attribute when a certain time is elapsed or when a collision is detected.

The Explode attribute can be animated in a way similar to animating other attributes. For example, if you want a sphere to explode at frame 30:

1. Create a sphere and make it choreographable by applying the menu Make Choreographable from the select window's popup.

2. Open the Choreography window. In the Time Lines tab, select the Sphere.Init0 choreography. Then select New/Keyframer from the popup menu. Open the sub structure of the Init choreography to see the inserted keyframe object. Click the keyframer object to select it.

3. Go to the Animateable Attributes tab. Select the Explode attribute and set the Animated option.

4. In the Properties tab, open the keyframer object and click on the Explode attribute under it. Right click in the graph window and select Set Minimum and maximum values from the popup menu. Make sure that Min x and Max x values match the length of your animation: Min X=0, : Max X = the number of frames in the animation. Make sure that the maximum value for Y = 1.

5. Select Create predefined curve/Constant curve from the popup menu. Add one point to the created curve by dragging the curve. Because the type of the Explode attribute is Boolean, also the type of the created curve is Boolean. Drag the added point to the value 1.0 at frame 30 (X = 30).

6. The sphere selected, create an Explode modifier. Set its Explode Time to zero to eliminate the basic modifier control. A target specific value, defined by the keyframer, will be used instead.

7. Play the animation. Now, when time reaches frame 30, the explode attribute value goes up to 1 and the sphere explodes.

Explode at other events

As you already know, the animation system allows you to animate 'anything as a function of anything'. This is also true for explosions. However, it usually does not make much sense to key frame the explode attribute, because as soon as the explode key frame curve goes up, the object dies taking all the key frame curves with it.

There are numerous cases where the explode option should be controlled by another object attribute. For example, you might want to explode an object as soon as its speed exceeds a certain limit. To achieve this, animate Explode as a function of Speed. Or, you might want to explode an object as soon as its 'y' coordinate reaches a certain upper limit. In this case, animate the Explode attribute by the Translation.Y attribute.

Let's create an animation where an object explodes as soon as it moves below the ground plane, in other words, when its y coordinate gets smaller than zero. The Explode attribute will not be animated in time but by the y coordinate of the object.

1. Create a sphere and apply Make Choreographable to it from the select window's popup.

2. Open the Choreography window and select the sphere's base choreography 'sphere.init0'.

3. Select New/Keyframer from the popup menu of the choreography list. Open the sub structure of the Sphere.init0 choreography and activate the new keyframer choreography.

4. Go to the Input tab of the choreography window. Drag the sphere object from the select window and drop it on the keyframer object in the choreography window. This instructs the choreography to use one of the sphere's attributes for input. Select Center.y from the Attribute list.

We are now ready to animate the Explode attribute as a function of the sphere's y coordinate.

5. Go to the Animateable Attributes tab. Set the Animated option for the Explode property. Then go to the Properties tab and click on the Explode attribute under the Keyframer choreography.

6. Now select Create predefined curve/Constant curve from the curve gadget's popup menu at the right side of the Choreography window. Select Set Minimum and Maximum values from the curve gadget's popup. Define 'Min X' = -1, 'Max X' = 1 (this is the input parameter range i.e. the y coordinate of the sphere center). Define 'Min Y' = 0, 'Max Y' = 1. The vertical Y-axis controls the state of Explode attribute. Check the Rescale box and close the scaling dialog from the OK button. Then define the curve shown below.

7. Use the Simulation/Velocity tool to define an initial velocity for the sphere, making it fall downwards.

8. Add an Explode modifier controlling the sphere. Set its Explode Time to zero.

Play the animation. The sphere moves down and when it reaches the ground plane, it explodes.

Explode is 1 when Center.y is below 0
[Note] Note
Explode modifier should usually be the last choreography applied to an object, so that explosion takes all motions and animation details into account. So, if you add new animation effects after setting an object to explode, remember to move explosion to the end of the choreography list.