Animating the Dolphin In this section, we're going to look at three basic approaches to animating the dolphin.First, we'll just make the dolphin a rigid body, totally under reactor's control; we won't create any keyframes for it ourselves. This is very simple but doesn't happen to be capable of producing the trajectory we want for the dolphin in this scene. (It could work well, for instance, if we just wanted to simulate a ball dropping, because in that case the force of reactor's gravity alone could provide all the required movement for the ball. In this case, though, we want the dolphin to jump out of the water; there's no reactor force that's going to accomplish that.)Then we'll move on to hand-animation of a rigid body, in which we do create keyframes for the dolphinor, more precisely, for the dolphin's top-level control object. We'll try creating all the keyframes ourselves, as well as combining our manually created keyframes with reactor's automatically generated ones. By creating our own keyframes, we can directly determine the dolphin's initial motion, rather than leaving that entirely to reactor forces.Hand-animation of a rigid body turns out to be a good solution for us, but it does have some limitations, the major one being that the simulation cannot take into account sub-object animation of the mesh. So we'll also look at using the dolphin as a deforming mesh, which does allow sub-object animation to be taken into account in the simulation. This results in a much more accurate simulation, but also puts an excessive load on the processor, which cannot easily handle a complex mesh like the dolphin. We'll see a technique for lightening that load, at least during the test phase.Let Reactor Do It All For a first simple approximation of what we want, we'll just place the dolphin above the ice chunks and let it fall under the influence of reactor's gravity, eventually hitting and shattering the ice.Open Dolphin&Rider_03.max from the DVD or continue with my_Dolphin&Rider_03.max.Note | In Dolphin&Rider_03.max (or my_Dolphin&Rider_03.max), the dolphin is a skinned figure, designed to be moved and animated by using its control objects (their names all start with ctrl_), not by transforming the dolphin01 mesh itself directly. | Here's the procedure:
1. | Select RBCollection01, and add dolphin01 to it by clicking Add in the RB Collection Properties rollout in the Modify panel and selecting dolphin01 in the Select rigid bodies dialog (Figure 16.33).Figure 16.33. Adding dolphin01 to RBCollection01. [View full size image] | 2. | With Select Object (not any of the transform tools, such as Move, Rotate, or Scale) selected on the Main toolbar, choose dolphin01, click the Open Property Editor button on the reactor toolbar, and in the Rigid Body Properties dialog, set Mass to 1000. (We are suggesting that you avoid using the transform tools so that you do not accidentally transform the dolphin01 mesh.) | 3. | Select ctrl_dolphin_all and move it to (100,0,275). | 4. | Click Preview Animation and press P. The dolphin falls and the ice chunks fragment (Figure 16.34).Figure 16.34. The dolphin falls and the ice chunks fragment. (Dolphin created with Poser 5, Curious Labs.)
 | 5. | Save your work as my_Dolphin&Rider_04.max. |
That's encouraging, but a couple of issues are evident right away:- The dolphin bounces off the platform and then continues to interact with the fragments. We'd get a more realistic impression of what will happen with water if the dolphin went through the platform.
- We don't want the dolphin to just drop out of the sky. The dolphin first has to jump up into the air and then come down on the ice.
There are a number of ways to address these problems. One possible approach is hand-animation of a rigid body.Hand-Animating a Rigid Body Now we'll create a hand-animated rigid body, entirely controlled by hand-animated keyframes. reactor-controlled rigid bodies will react to the hand-animated rigid body, but the hand-animated rigid body will not, in turn, be affected by them.The basic workflow is simple:
1. | Select the object that you want to hand-animate. | 2. | Click the Open Property Editor button on the reactor toolbar, and in the Rigid Body Properties dialog, check the Unyielding box. reactor does not create keyframes for an unyielding object. That's what we want in this case, because we're going to create the keyframes for the object ourselves. (There's no need to give the object any mass, since it's not involved in the simulation anyway.) | 3. | Add the object that you want to hand-animate to a rigid body collection. | 4. | Animate the object. |
First, we'll do an exercise with a box, to see how hand-animation works in a simple case. Then we'll apply what we've learned to the dolphin mesh.Hand-Animating a Box Continue with my_Dolphin&Rider_04.max from the previous exercise, or open Dolphin&Rider_04.max in the files for this chapter on the DVD.
1. | In the Top viewport, create a box with a length of 80, a width of 50, and a height of 150. Position it at (250,0,100). Name it dolphin_proxy.Tip | Don't overlook the minus signs! |
| 2. | With dolphin_proxy still selected, click Open Property Editor on the reactor toolbar. In the Rigid Body Properties dialog, check the Unyielding box. Note that we are not giving the box any mass. | 3. | Select RBCollection01. Go to the Modify panel and click Add and select dolphin_ proxy, adding it to the rigid body collection. Also, delete dolphin01 from RBCollection01: Select dolphin01 in the list of objects in the collection, and click Delete to remove dolphin01 from the collection. | 4. | Turn on Auto Key Select dolphin_proxy, go to frame 25, and move the box to (0,25,250). | 5. | Go to frame 50 and move dolphin_proxy to (100,25,150). | 6. | Turn off Auto Key. | 7. | Click Preview Animation and press P. The dolphin_proxy shatters the ice. | 8. | Save your work as my_Dolphin&Rider_05.max. To see a finished version of this exercise, open Dolphin&Rider_05.max in the files on the DVD. |
That was very straightforward and worked nicely. Let's see if we can substitute dolphin01 for the dolphin_proxy box.Hand-Animating the Dolphin Mesh If you want to continue with the file you created in the previous exercise, clean up by removing dolphin_proxy from RBCollection01. Select RBCollection01. In the Modify panel, select dolphin_proxy in the list of objects in the collection, and click Delete to remove dolphin_proxy from the collection. Finally, hide or delete dolphin_proxy.Alternatively, open Dolphin&Rider_06.max on the DVD.Our goal here is to use dolphin01 to break the ice. This is a skinned and rigged mesh, so we don't want to animate the mesh directly. We want to animate control objects, which affect bones, which in turn affect the mesh.Now, the hand-animated body must be added to RBCollection01, as in step 3 in the exercise above. So, which one do we add: the control object or dolphin01?To try adding ctrl_dolphin_all to the rigid body collection, follow this procedure:
1. | Select RBCollection01. It should contain only the four "ice chunk" objects and the platform. Click Add and select ctrl_dolphin_all. The control object is added to the rigid body collection. | 2. | Now let's try to assign the Unyielding property to the control object. Whoops! Everything in the Rigid Body Properties dialog is grayed out, making it impossible to assign the Unyielding property (Figure 16.35).Figure 16.35. The Rigid Body Properties dialog, grayed out.
 | 3. | Click the Analyze World button on the toolbar. You get a message, "All vertices in mesh are coplanar, please use Concave Mesh." This is a fatal error, not just a warning. If you try to preview the animation, you'll find that you can't. | 4. | Clean up by deleting ctrl_dolphin_all from RBCollection01. |
The error message in step 3 above suggests that we make the control object a Concave Mesh using the radio button in the Rigid Body Properties dialog. As we just saw in step 2, that's impossible, because the whole dialog is grayed out.Putting this control object into a rigid body collection just doesn't seem to work. So let's try putting the dolphin mesh itself into the rigid body collection.
1. | Select RBCollection01, if it isn't selected already. It should contain only the four "ice chunk" objects and the platform. Click Add and select dolphin01. The dolphin mesh is added to the rigid body collection. | 2. | Select dolphin01. Click Open Property Editor on the reactor toolbar, and in the Rigid Body Properties dialog, check the Unyielding box. So far so good. No need to give the dolphin any mass; it already has a mass of 1000. | 3. | Click the Analyze World button. You should see the message, "World Analysis gave no warnings." | 4. | With the Time Slider on frame 0, select ctrl_dolphin_all and position it at (30,150,100). | 5. | Turn on Auto Key. Select ctrl_dolphin_all, if necessary. Go to frame 25 and position ctrl_dolphin_all at (50,0,250). Go to frame 50 and position ctrl_dolphin_all at (100,0,150). You will see the dolphin move as you apply the animation, and also if you scrub the Time Slider afterward. | 6. | In addition, at frame 50, in the Front viewport, with Auto Key still on, select the Rotate tool and use the Screen handle (the outer gray circle) to rotate ctrl_dolphin_all about 90 degrees clockwise, so that the dolphin is facing more downward (Figure 16.36).Figure 16.36. Use the Screen handle (the outer gray circle) to rotate ctrl_dolphin_all.
 | 7. | Turn Auto Key off. | 8. | Click Preview Animation and press P. The dolphin doesn't move because it is a deforming mesh, meaning that its vertices have been keyframed (in this case, by skinning). This differentiates it from the box in the "Hand-Animating a Box" exercise above, where the animation is applied to the whole box, not to sub-objects such as vertices. The animation of the dolphin's vertices is not taken into account in the hand-animated simulation. | 9. | Clean up by removing dolphin01 from RBCollection01. | 10. | Save your work as my_Dolphin&Rider_07.max. |
Coplanar and Control Objects We haven't obtained satisfactory results by putting either the control object or the dolphin01 mesh into the rigid body collection. This might seem like a dead end, but it's not. The "coplanar" error message gives us the clue we need to find a solution.As we've seen, reactor will not really accept a coplanar object as a rigid body. It will put the coplanar object in the rigid body collection, but it won't allow us to give it any mass or assign the Unyielding property to it.A circle is obviously coplanar. But what if we extruded it? It would no longer be coplanar, and perhaps we could successfully use it as a rigid body. Let's try it.Open Dolphin&Rider_07.max from the DVD or continue with my_Dolphin&Rider_07.max.
1. | Select ctrl_dolphin_all and add an Extrude modifier to it. Set Amount to 25. The circle becomes a cylinder (Figure 16.37).Figure 16.37. The control object becomes a cylinder. [View full size image] | 2. | Select RBCollection01. It should contain only the four "ice chunk" objects and the platform. Click Add and select ctrl_dolphin_all. The control object is added to the rigid body collection. | 3. | Assign the Unyielding property to the control object. (The Rigid Body Properties dialog is no longer grayed out, so there's no problem with this now.) | 4. | Click Preview Animation and press P. The control object moves, breaking the fracture. | 5. | Click the Create Animation button and scrub the Time Slider. Dolphin and rider move with ctrl_dolphin_all. |
This is a rough approximation of what we want, and it indicates that this approach is workable, but we still have a problem: The fracture is affected by the control object, not by the dolphin, so the impact is all wrong. In fact, since the control object is so much wider than the dolphin, it actually hits the fragments on the way up, rather than on the way down.This is not a showstopper, however. All we need to do is reshape the control object to conform to the shape of the dolphin. Here's one way of doing that:
1. | Select ctrl_dolphin_all. Go to frame 35. Since this is close to the frame where the dolphin will hit the ice, this is where it's most important to have the control object match the dolphin mesh. | 2. | In the Modify panel, select Circle in the modifier stack and set the radius to 30 in the Parameters rollout (Figure 16.38).Figure 16.38. Set the ctrl_dolphin_all Radius value to 30 in the Parameters rollout.
 | 3. | Select the Extrude modifier, and increase Amount to 90 in the Parameters rollout. This should just cover the dolphin's nose. If you preview the animation now, you'll see that it's already looking pretty good. Given the power of the modifier stack, however, there's no reason not to try to improve it. | 4. | Add a Squeeze modifier to ctrl_dolphin_all. In the Parameters rollout, in the Radial Squeeze section, set Amount to 0.11 (Figure 16.39). This tapers the control object a bit in front.Figure 16.39. Add a Squeeze modifier to ctrl_dolphin_all to taper it.
 | 5. | Add a Mirror modifier to ctrl_dolphin_all. In the Parameters rollout, select Z for the Mirror Axis, set Offset to 2.64, and check the Copy box. This mirrors the control object front to back (Figure 16.40).Figure 16.40. Add a Mirror modifier to ctrl_dolphin_all to mirror it front to back. [View full size image] | 6. | Create animation. The ice chunks react at the right time to give the illusion that it's the dolphin that's breaking them up. |
Invisibility All that remains to perfect the illusion is to make the control object invisible. Invisibility is a common requirement in reactor scenes, so you may find it convenient to keep an "invisible" material handy that you can apply to any object in one click. Here's how to create an invisible material and apply it to the control object:
1. | Select ctrl_dolphin_all. | 2. | Press the M key to bring up the Material Editor. | 3. | Select an unused slot in the Material Editor, and in the Blinn Basic Parameters rollout, set Opacity to 0. | 4. | Click the Assign Material to Selection button (third from the left in the Material Editor) (Figure 16.41). The control object becomes invisible. It shows up "ghosted" in viewports (and as a gizmo, when selected) and not at all on renders. (Preview Animation still shows the control object.) The most important point is that only the dolphin is visible in the final rendered output.Figure 16.41. The Assign Material to Selection button in the Material Editor.
 |
Note | If you are using the Software video driver, the control object may not be ghosted. |
Keyframing the Dolphin Notice that the rest of the dolphin rigging, which has not been brought into the reactor universe in any way, continues to work! Let's take advantage of this to arch the dolphin's spine and point his flippers downward when he gets to the top of his jump. Then as he dives we'll straighten him out and spread his flippers out to the side again.Note | All dolphin controls except ctrl_dolphin_all should be manipulated using custom attributes in the Modify panel. |
1. | Turn on Auto Key and go to frame 25. | 2. | Select ctrl_backbone_back. In the Modify panel, set the arch attribute (the only attribute in the Custom Attributes rollout) to 9.2 (Figure 16.42).Figure 16.42. The arch custom attribute for ctrl_backbone_back.
 | 3. | Select ctrl_backbone_front. In the Modify panel, set the arch attribute to 9.2. | 4. | Select ctrl_flipL. In the Modify panel, set the flip attribute to 35. | 5. | Select ctrl_flipR. Set the flip attribute to 35. | 6. | Go to frame 50. | 7. | Select ctrl_backbone_back. Set the arch attribute to 0. | 8. | Select ctrl_backbone_front. Set arch to 0. | 9. | Select ctrl_flipL. Set the flip attribute to 20. | 10. | Select ctrl_flipR. Set flip to 20. | 11. | Turn off Auto Key. | 12. | Scrub the Time Slider to see the animation you just created. It adds a subtle but important "aliveness" to the dolphin. | 13. | Save your work as my_Dolphin&Rider_08.max. |
For a finished version of the animation described above, open Dolphin&Rider_08.max on the DVD.For our purposes, totally hand-animating the dolphin turns out to be an excellent solution. At this point, we could well just decide to move on to adding water to our scene.However, hand-animation does have some limitations. For instance, the hand-animated object cannot be affected by other objects. It's always a cause, never an effect. In the next section, we'll see how we can work within this limitation and still combine our own hand-animation with reactor's automatically generated keyframes.Using Start Frame and End Frame In any frame where reactor creates keyframes for a rigid body, any previously existing keyframes are destroyed. One common way to work within this limitation is to divide a scene into frames in which we are in control and frames in which reactor is in control. We'll do this here by manually taking the dolphin to a certain position and then "letting go" of it and allowing reactor to take over.Open Dolphin&Rider_08.max from the files for this chapter on the DVD, or continue with my_Dolphin&Rider_08.max from the previous section.Here's the procedure:
1. | Select ctrl_dolphin_all and click the Open Property Editor button on the reactor toolbar. | 2. | In the Rigid Body Properties dialog, set Mass to 100. Objects that have no mass do not fall under the influence of gravity and cannot be affected by other objects. | 3. | Also in the Rigid Body Properties dialog, deselect Unyielding. reactor does not create keyframes for unyielding objects. | 4. | In Utilities > reactor > Preview & Animation, set the Start Frame parameter (the very top one) to 25 (Figure 16.43). reactor will start creating keyframes at frame 25, not before.Figure 16.43. In Utilities > reactor > Preview & Animation, set Start Frame to 25.
 | 5. | Preview animation. It starts at frame 25. You don't see the initial hand-animation in the preview. | 6. | Create animation. reactor creates keyframes for ctrl_dolphin_all starting at frame 25. | 7. | Scrub the Time Slider along the timeline from 0 to 100. In the first 25 frames, you see the hand-animation. After that, you see reactor's automatically generated animation. You see the same thing if you render the scene. |
The animation of the flippers and the backbone is preserved. The control objects for flippers and backbone were never a part of the simulation, so reactor never affected them in any way.Notice that there is also a Utilities > reactor > Preview & Animation > End Frame (100 in this case), where you can start hand-animating again. If you want to start hand-animating at frame 75, go to Utilities > reactor > Preview & Animation, and set the End Frame parameter to 75. Try this:
1. | Delete the existing keyframes from frames 75 to 100. If you delete a few keyframes earlier than 75, it won't do any harm, but be sure not to delete keyframes preceding frame 25. | 2. | Create animation. reactor creates keyframes from frame 25 to 75, and the dolphin stops moving at frame 75. | 3. | You can start hand-animating at that point. |
The dolphin no longer passes through the platform, as it did before. This can be easily corrected by disabling collisions between ctrl_dolphin_all and the platform, using reactor's Define Collision Pairs capability. Here's the procedure:
1. | In Utilities > reactor > Collisions > Global Collisions, click Define Collision Pairs (Figure 16.44).Figure 16.44. Define Collision Pairs in Utilities > reactor > Collisions > Global Collisions.
 | 2. | In the Define Collisions window, select ctrl_dolphin_all at the top of the Entities column on the left. | 3. | In the middle column, Enabled Collisions, select "platform <-> ctrl_dolphin_all" and then click the right-facing arrow between the second and third columns, at the very top. The collision pair is transferred to the Disabled Collisions column (Figure 16.45).Figure 16.45. The Define Collisions window. [View full size image] | 4. | Click OK. | 5. | If you preview or create animation, the dolphin passes through the platform. | 6. | Save your work as my_Dolphin&Rider_09.max. |
For a finished version of the animation described above, open Dolphin&Rider_09.max on the DVD.Reducing Keyframes In the context of combining manual animation with reactor's automatically generated animation, we should also mention reducing keyframes. In Utilities > reactor > Utils > Key Management, the Reduce Now button deletes "unnecessary" keyframes for all the rigid bodies in the scene (Figure 16.46). Reduce Keys in the Selection section (Figure 16.46) does the same for any selected objects.Figure 16.46. The Reduce Keys button deletes "unnecessary" keyframes for selected rigid bodies.
"Unnecessary" means that the animation won't appear to change very much if the keyframes are eliminated. The Reduction Threshold parameter determines whether the process is biased toward faithfully preserving the animation or ruthlessly getting rid of keyframes. (The lower the Reduction Threshold number, the greater the fidelity.) If you can reduce keyframes to a manageable number, you may be able to manually edit the keyframes that reactor creates. Then you will most likely want to remove the objects from the reactor simulation (by deleting the objects from any reactor collections, for instance), so that reactor will not overwrite your manually edited keyframes. This is another way of combining your animation with reactor's automatically generated animation.In the previous sections on hand-animation, the dolphin mesh (dolphin01) was not included in the simulation, while the control object (ctrl_dolphin_all) was included. In the next section we're going to reverse that.A Deforming Mesh We've already seen an important limitation of working with hand-animation, namely that if you try to work directly with a deforming mesh like dolphin01, the vertex-level animation of the mesh is not taken into account in the simulation. All animation applied through skinning is vertex-level animation, even if it moves every vertex in the character, as is the case when ctrl_dolphin_all moves dolphin01. That is why, when we added dolphin01 to the rigid body collection, reactor ignored all the animation applied to dolphin01, so that dolphin01 didn't move at all. (See "Hand-Animating the Dolphin Mesh," earlier in the chapter.)We've seen that you can work around this limitation by hand-animating the control object, which is not animated at the vertex level. You can make the control object conform to the dolphin's shape. We did this working with an existing rig, proceeding on the assumption that we wanted to be able to restore the control object to its original state. Thus, we added modifiers to the control object, which we could later remove or disable. Alternatively, you could create a new control object that would conform perfectly to the dolphin's shape, even using an optimized copy of the dolphin itself as a control object.What you can't do with hand-animation is animate the control object at the vertex level and get reactor to take that vertex-level animation into account in the simulation. That means that as far as reactor is concerned, the control object keeps the same shape throughout the animation. So there's no way for the control object to replicate subtleties such as the arching of the spine and the flipping of the flippers.However, there is a way to make reactor take a deforming mesh itself, with all its glorious vertex-level animation, into account in the simulation. This approach is based on the deforming mesh collection.Creating a deforming mesh collection is very simple, as we'll see in a moment. However, before we do that, there are two tasks we need to take care of:
1. | Set reactor start and end frames | 2. | Re-animate the control object (ctrl_dolphin_all) |
Open Dolphin&Rider_09.max on the DVD, or continue with my_Dolphin&Rider_ 09.max from the previous section.Note | We now want reactor to create keyframes throughout the animation, from frame 0 to frame 100. reactor may not be configured properly to achieve this, if you did the exercise above in "Using Start Frame and End Frame." If you are using your own file, go to Utilities > reactor > Preview & Animation, and make sure that Start Frame is 0 and End Frame is 100. |
Re-animating the Control Object In the hand-animations described above, it was the control object (ctrl_dolphin_all) that collided with the ice. In this section, the dolphin mesh (dolphin01) collides with the ice. The control object is removed from the simulation. It still has a very significant effect on the simulation, because it controls dolphin01.In "Using Start Frame and End Frame" earlier, we let reactor create keyframes for the control object after frame 25. We could keep all the keyframes for the control object now and use them even after removing the control object from the simulation. Instead, we will delete those keyframes and re-animate the control object. (This allows you to keep working with your own file, even if you did not do the "Using Start Frame and End Frame" exercise.)
1. | First, remove the control object from the simulation. Select RBCollection01. In the Modify panel, select ctrl_dolphin_all in the list of objects in the collection, and click Delete to remove it from the collection. Note that the keyframes created for ctrl_dolphin_all remain and would continue to determine the movement of dolphin01 if we didn't delete them. | 2. | Now delete the existing animation for the control object. Go to frame 0. Select ctrl_dolphin_all. In the main menu, choose Animation > Delete Selected Animation (the last choice on the menu). All existing animation for ctrl_dolphin_all is destroyed. The control object takes its position from the current frame, frame 0. | 3. | Finally, re-animate the control object. Turn on Auto Key and move ctrl_dolphin_all to the following positions:- Frame 0 = (50, 150, 100)
- Frame 25 = (10, 0, 250)
- Frame 50 = (40, 0, 150)
| 4. | Turn off Auto Key. |
Creating the Deforming Mesh Collection Configuring reactor to recognize the dolphin mesh as a deforming mesh is a two-click process:
1. | Select dolphin01. | 2. | On the reactor toolbar, click the Create Deforming Mesh Collection button (fifth from the top) (Figure 16.47). A deforming mesh collection is created, and dolphin01 is added to it.Figure 16.47. Creating a deforming mesh collection.
 |
Click the Analyze World button. You get a warning that dolphin01 and platform are interpenetrating. In this particular case, the interpenetration has no effect, because the dolphin mesh is unyielding and the platform has no mass. In this configuration, the dolphin mesh will simply pass through the platform without affecting it or being affected by it. To eliminate the warning message, disable collisions between these two objects using Define Collision Pairs, as described in the following section.Disable Dolphin-Platform Collisions When we hand-animated, we disabled collisions between the control object (ctrl_dolphin_all) and the platform. Now we will do the same for the dolphin mesh (dolphin01) and the platform. This will eliminate the error message encountered in the previous section. Here's the procedure:
1. | In Utilities > reactor > Collisions > Global Collisions, click Define Collision Pairs. | 2. | In the Define Collisions window, select dolphin01. | 3. | In the middle column, Enabled Collisions, select "platform <-> dolphin01" and then click the right-facing arrow between the second and third columns, at the very top. The collision pair is transferred to the Disabled Collisions column. | 4. | Click OK. |
Stuck in a Time Warp When we put our deforming mesh (dolphin01) into a deforming mesh collection, reactor tracked vertex-level animation at each simulation time step, so we got a very accurate simulation. However, all that accuracy doesn't come free. The price you pay is in processing time. Analyzing the world, previewing animation, and creating keyframes all take longer. How much longer depends primarily on how many vertices our deforming mesh has. In the case of dolphin01, it has 8434. That's enough to slow things down to a crawl, even on a fast machine. Luckily, there is an easy way to speed things up during the testing phase. It reduces accuracy, but you can easily reverse it when you're ready for the final output.To experience for yourself the performance degradation that can result from using a deforming mesh collection, follow the steps below. If you prefer to avoid that stuck-in-a-time-warp feeling, skip down to "Getting Unstuck."
1. | Make sure no objects are selected. Having an object selected while simulating can increase simulation time. We haven't worried about this before. But now that we're using a deforming mesh, which is processor-intensive, we're going to do everything possible to decrease the processor load. | 2. | Click the Analyze World button. After a wait, you get the "no warnings" message. | 3. | Click the Preview Animation button. After a wait, the Real-Time Preview window appears. | 4. | Press P. The dolphin falls much more slowly than in previous previews. When the dolphin gets near the ice chunks, things get very slow and may appear to stop. If you get tired of waiting, press Esc. It may not appear to do anything for a while, but unless your computer has crashed, you will eventually exit the Real-Time Preview window. Don't be too quick to assume that your computer has crashed. Even if you go to the Windows Task Manager (Control-Alt-Delete) and it says that the application is not responding, if you wait a while, it may come around. |
Getting Unstuck To speed things up:
1. | Select dolphin01. | 2. | In the Modify panel, select Editable Mesh in the modifier stack. | 3. | Add an Optimize modifier between the Editable Mesh and the Skin modifier. Set the Face Threshold parameter to 90 (Figure 16.48). The dolphin loses a lot of his rounded curves and becomes quite blocky.Figure 16.48. The Optimize modifier between the Editable Mesh and the Skin modifier.
 | 4. | Perform the steps described above in "Stuck in a Time Warp." Everything goes much faster with the radically optimized deforming mesh, though still noticeably slower than with a rigid body.Extreme optimization makes the dolphin look pretty weird (Figure 16.49). However, when it comes time for final output, just turn optimization off by clicking the lightbulb button to the left of the Optimize modifier. The lightbulb turns gray, and everything is back to normal: pretty-looking but very sl-o-ow. You can turn off optimization either before creating animation (increasing simulation accuracy but taking longer to create keyframes) or before rendering (making the mesh look pretty in the render). In this case, you would probably turn optimization off only before rendering, since the decrease in simulation accuracy due to optimization will probably not be noticed.Figure 16.49. The radically optimized dolphin, viewed from above.
 | 5. | Save your work as my_Dolphin&Rider_10.max. |
For a finished version of the animation described above, open Dolphin&Rider_10.max on the DVD.In addition to rigid bodies and deforming meshes, the other major category of reactor object is deformable bodies. In the next section we'll use a soft body to take the stiffness out of the dolphin rider's hair and allow it to react to her movements.Attaching a Deformable Body You may want to attach a reactor deformable body (Cloth, Rope, or Soft Body) to a deforming mesh or rigid body. (For an introduction to deformable bodies in 3ds max 7 see Help > Tutorials > Using reactor and Flex for Simulation > Deformable Bodies Tutorial.) For instance, you may want to create clothes for your character using a reactor Cloth object, hair using a reactor Rope object or Soft Body, or wobbly antennas using a reactor Soft Body. This is easy to do using an Attach to DefMesh or Attach to Rigid Body constraint. We'll try this out using the back portion of the dolphin rider's hair, dolphin_rider_hair_SB. (The "SB" stands for "Soft Body." I named it knowing that we were going to use it as a soft body eventually.)The following procedure resets the start frame, creates a Soft Body object (the back portion of the dolphin rider's hair), and then attaches the Soft Body to the rider's hair band.Open Dolphin&Rider_10.max on the DVD, or continue with my_Dolphin&Rider_ 10.max from the previous section.
1. | Select RBCollection01 and add dolphin_rider_hair_band to the collection. The hair band is the rigid body to which we will attach the hair. | 2. | Select dolphin_rider_hair_band. | 3. | Click the Open Property Editor button on the reactor toolbar, and click Disable All Collisions in the Rigid Body Properties window. You are just using the hair band as an attachment point for the hair. You don't want it to participate in the simulation beyond that. | 4. | Also set the Unyielding property for dolphin_rider_hair_band, if it is not already checked on. Its movements are controlled by ctrl_dolphin_all. You don't want reactor to create keyframes for it. | 5. | Select dolphin_rider_hair_SB, and click the Apply Soft Body Modifier button on the reactor toolbar (sixth from the bottom). A reactor SoftBody modifier is added to dolphin_rider_hair_SB (Figure 16.50).Figure 16.50. A reactor SoftBody modifier applied to dolphin_rider_hair_SB. [View full size image] | 6. | Click the Create Soft Body Collection button on the reactor toolbar (third from the top). A soft body collection is created, and dolphin_rider_hair_SB is added to it (Figure 16.51).Figure 16.51. Creating a soft body collection. [View full size image] | 7. | Select the dolphin_rider_hair_SB object. In the Modify panel, go to the Vertex sub-object level in the reactor SoftBody modifier (Figure 16.52). This will allow you to select vertices in the Soft Body.Figure 16.52. The Vertex sub-object level of the reactor SoftBody modifier.
 | 8. | Click Attach To Rigid Body in the Constraints rollout (Figure 16.53). An Attach To RigidBody constraint appears in the Constraints list, and the Attach To RigidBody rollout appears.Figure 16.53. Creating an Attach To RigidBody constraint.
 | 9. | Select the Attach To RigidBody constraint in the Constraints list. | 10. | In the Attach To RigidBody rollout, click the Rigid Body button (which currently says None) (Figure 16.54). The button turns yellow.Figure 16.54. Click the Rigid Body button, which currently says None.
 | 11. | Select dolphin_rider_hair_band (by clicking the hair band in the viewport or by pressing H and selecting dolphin_rider_hair_band from the Pick Object dialog). | 12. | Right-click in the active viewport and choose Hide Unselected. This hides everything but the hair, making it easier to select vertices of the hair. With the Front viewport active, click Zoom Extents, then select the loop of vertices closest to the hair band. This will be easier if the viewport is in Wireframe display mode (Figure 16.55). During simulation, dolphin_rider_hair_SB will remain attached to the hair band by these vertices.Figure 16.55. Select the loop of hair vertices closest to the hair band.
 | 13. | Click the reactor SoftBody modifier to deselect the Vertex sub-object, to make sure you don't inadvertently change your vertex selection. | 14. | Right-click in the active viewport and choose Unhide All. | 15. | Preview Animation. The hair stretches and flops around but stays attached to the hair band (Figure 16.56).Figure 16.56. dolphin_rider_hair_SB distorts but stays attached to the hair band.
The same basic technique can be used to attach the Soft Body to a deforming mesh, using an Attach To DefMesh constraint. | 16. | Save your work as my_Dolphin&Rider_11.max. |
For a finished version of the animation described above, open Dolphin&Rider_11.max on the DVD. Your file will only match the DVD's file if you create the animation.All right! We have our ice, and we have experimented with several ways of animating our dolphin. Let's get into the water!Just Add Water In this section, we'll go back to hand-animation, add water to our simulation, stabilize the fragments in the water, and see if we can get the dolphin to break the ice in the water the way it did before on the platform.Open Dolphin&Rider_11.max from the DVD, or continue with my_Dolphin&Rider_ 11.max from the previous section.Back to Hand-Animation Since using a deforming mesh doesn't do much for this animation except increase the processor load, let's go back to hand-animation. First, do this:
1. | Select and delete DMCollection01. | 2. | Select dolphin01. In the Modify panel, if the lightbulb by the Optimize modifier indicates that the modifier is enabled (not grayed), click it to turn it off (grayed). We no longer need to optimize the mesh, since reactor no longer includes it in the simulation as a deforming mesh. | 3. | Add ctrl_dolphin_all to RBCollection01. | 4. | Select ctrl_dolphin_all. Click the Open Property Editor button on the reactor toolbar, and in the Rigid Body Properties dialog, check the Unyielding box. |
All right! We're ready to add water!Adding Water Adding water to the reactor simulation is a simple click-and-drag operation, just like creating a plane. Note, however, that reactor water is a space warp: It doesn't show up in renders but can affect objects that do show up in renders. We'll use a plane ("water plane") as the renderable object.Here's the procedure for adding water:
1. | Select "platform" and delete it. | 2. | Click the Create Water button on the reactor toolbar (just below the Fracture button). In the Top viewport, click and drag to create the water. | 3. | In the Modify panel, set both Size X and Size Y to 1000 (Figure 16.57).Figure 16.57. Setting properties for reactor water.
 | 4. | Position the water at (12,2,10). | 5. | Preview Animation. |
The water tosses the ice around significantly at the beginning of the animation, but the ice doesn't appear to fragment until the dolphin hits it. You can confirm this by creating animation and looking at stored collisions. The first collision is between ctrl_dolphin_all and one of the ice chunks. That indicates no breakage before the control object hits the ice.Nevertheless, the ice is tossed clear out of the water at the beginning of the animationnot the effect we're looking for. Since the ice is not breaking up of its own accord, it looks as if it might eventually find its own equilibrium if we could just prevent the control object from shattering it. Let's give it a try.Stabilizing the Ice To stabilize the ice in the water, we'll use Update MAX in the Real-Time Preview window, as we did to stabilize the ice on the platform. However, getting the ice to "settle down" will be a little more involved.
1. | Update MAX will create new keys at frame 0 for all objects in the simulation. We want to create new keys just for the ice chunks, in a more stable position. So the first thing we'll do is temporarily remove other objects from the simulation. Start by deleting ctrl_dolphin_all and dolphin_rider_hair_band from RBCollection01. We'll put them back in again when we're through stabilizing the ice. | 2. | Select SBCollection01. In the Modify panel, check the Disabled box in the Properties rollout (Figure 16.58). We'll enable it again when we're through stabilizing the ice.Figure 16.58. Disabling SBCollection01 in the Modify panel.
 | 3. | Preview Animation. Only the ice remains in the simulation. The ice keeps moving under the influence of the water. It never comes to rest. We can also see now that the ice is bouncing right on the surface of the water, whereas we'd like it to be somewhat submerged. | 4. | If we make the ice heavier, it will move less and submerge more. Exit Real-Time Preview. Select Object01 and Object02 (the bottom two ice chunks), open the Rigid Body Properties dialog, and change the Mass parameter to 300. For Object03 and Object04 (the top two ice chunks), set the Mass parameter to 250. (Increasing Mass more for the bottom two chunks makes the iceberg less likely to flip over.) Preview Animation. The ice sits lower in the water but is still tossed around forcefully and keeps moving under the influence of the water. | 5. | We haven't been very successful at stabilizing the ice by changing the ice. Let's try changing the water. Select the water (Water01) and go to the Modify panel. After noting their initial values so that you can reset them later, set Wave Speed, Min Ripple, and Max Ripple to 1. Set Viscosity to 100. Preview Animation again. The ice has calmed down significantly. Due to the high viscosity, the ice is now interacting with something more like sludge or heavy oil than water. The wave action is also much milder. | 6. | When the ice seems stable, select MAX > Update MAX in the Real-Time Preview window, assigning the more stable position to the fragments in the first frame of the animation. Exit Real-Time Preview. | 7. | Set the water parameters back to their initial values, and Preview Animation again. There is much less initial movement of the ice in the water. | 8. | Add ctrl_dolphin_all and dolphin_rider_hair_band back into RBCollection01. | 9. | Select SBCollection01. In the Modify panel, uncheck the Disabled box in the Properties rollout, to re-enable the soft body collection. | 10. | Preview Animation. |
The ice is now stabilized and fracturing the way we want it to. However, the water is still not renderable. We'll take care of that in the next section.Making the Water Renderable Here is a procedure for completing the reactor water setup so that water will appear in renders:
1. | Select Water01, and in the Modify panel, change Subdivisions X and Subdivisions Y to 30. This increases the subdivisions of the reactor water (Water01) to match the subdivisions of the plane that will provide the renderable water surface (the "water plane") In general, the more subdivisions you have, the more realistic your water will be. However, increasing the subdivisions of the reactor water beyond the subdivisions of the renderable surface is not useful. Increasing subdivisions also increases the processing load. | 2. | With "water plane" selected, click the Bind to Space Warp button (Figure 16.59) and select Water01. A reactor Water (WSM) modifier is added to "water plane" (Figure 16.60). (WSM stands for "world space modifier".) The plane will now provide the visible manifestation of the water.Figure 16.59. Use Bind to Space Warp to bind "water plane" to Water01.
 Figure 16.60. A reactor Water (WSM) modifier on "water plane."
 | 3. | Save your work as my_Dolphin&Rider_12.max. |
For a finished version of the animation described above, open Dolphin&Rider_12.max on the DVD.Our work with reactor is now done. However, the scene still needs two important finishing touches, which we'll take care of in the next section.Finishing Touches In this section we add a texture and a splash to our scene.
1. | Our iceberg still looks more like a party hat than like ice. Press M to bring up the Material Editor, and find the Ice material. Apply the Ice material to Object01, Object02, Object03, and Object04. | 2. | To put some splash to the scene, add a SuperSpray object in the Top viewport. You'll find it in the Create panel, in the Geometry section, under Particle Systems. Just click and drag in the Perspective viewport to create the SuperSpray. Go to the frame where you want the splashing to start, and position the SuperSpray at the point where the splash should originate. Rotate the SuperSpray so that its arrow points in the direction of the splash (Figure 16.61). You can also animate the position and rotation of the SuperSpray.Figure 16.61. The SuperSpray arrow points in the direction of the splash. Some additional dolphin animation has been added to this scene.
 | 3. | With the SuperSpray still selected, go to the Modify panel to set the time when the splash starts. In the Particle Generation rollout, set the Emit Start parameter to coincide with the frame where the splash should begin. Set Emit Stop to 30 or so frames after that. Set Life to 20 and Variation to 10. At the top of the rollout, set Particle Quantity > Use Rate to 100 (Figure 16.62).Figure 16.62. Setting SuperSpray Particle Generation parameters in the Modify panel.
 | 4. | Go to the next rollout, Particle Type, and select the Facing type in the Standard Particles section (Figure 16.63).Figure 16.63. Setting SuperSpray Particle Type parameters in the Modify panel.
 | 5. | You should now see the particles appearing as ticks (plus signs) in the viewport in the appropriate frames. However, they are just coming out in a straight line. Scroll back up to the Basic Parameters rollout and play with the parameters in the Particle Formation section, to distribute the particles in a somewhat more spread-out fashion. We left Off Axis at 0, and set the first Spread to 21, Off Plane to 26, and the second Spread to 61 (Figure 16.64).Figure 16.64. Setting SuperSpray Basic Parameters in the Modify panel.
All of the above represents just one possible configuration of the SuperSpray. There are many other configurations that will work fine, and you can also add more SuperSprays. | 6. | Save your work as my_Dolphin&Rider_13.max. |
For a finished version of the animation described above, open Dolphin&Rider_13.max on the DVD.That's it! Try rendering a few select frames, to make sure everything is to your liking, and then go ahead and render the animation. We recommend the mental ray renderer for this project.A rendered version of this project is available as Dolphin&Rider.avi on the DVD.Summing Up In this chapter, you learned how to animate using reactor, replacing your own hand-animation or in addition to it. You gained insight into the strengths and weaknesses of reactor. You saw how it can save production time by automatically creating realistic animation for complex scenes, including hard-to-animate effects such as water. On the other hand, you also saw thatas Mickey Mouse discovered as the Sorcerer's Apprentice in Fantasiait's often easier to get the magic going than to direct it or stop it. Once you have visualized your scene or prepared your storyboard, you have to be ready to spend time tweaking simulation parameters and experimenting in order to get reactor to produce the effects you envision.When using a deforming mesh collection, you saw the huge benefits in efficiency that can result from simplifying the objects in your scene. At the same time, you saw that it is often possible to make objects look simpler to reactor than they really are. With reactor, you are often called upon to make a judgment about the degree of simulation accuracy required by your scene versus the processing cycles you can afford to devote to simulating it.It can be unsettling to give your creations "minds of their own." On the other hand, there is great power in the ability to create worlds that can act intelligently according to laws you set down, without having to be told what to do at every step.Ideas for further experimentation:- Continue to animate ctrl_dolphin_all. For example, you may want to rotate it so that the dolphin is facing towards the water when it hits. Or you may want to work with the position of the dolphin so that it stays entirely in view during its whole trajectory. An example, Dolphin&Rider_14.max, is included on the DVD. A rendered version of this scene is available as Dolphin&Rider_14.avi.
- In the Modify panel, play with soft body properties such as Stiffness, Friction, and Damping, to change the behavior of the hair.
- Replace the hair with reactor Rope.
- Give the rider a cape of reactor Cloth.
- Add reactor Wind to the scene.
- reactor can be a good way to create natural-looking arrangements of static props. Try dropping a group of objects onto the flat iceberg. Make a snapshot of them (Tools > Snapshot) and then delete the originals, leaving only the newly created snapshot objects.
- Use a reactor Spring to keep pulling one of the lower ice chunks back to its original position.
- Use Skin Wrap to control a high-poly dolphin with a low-poly dolphin. Use the low-poly dolphin as a deforming mesh.
In the next chapter, you'll dive more deeply into the world of particles with max's Particle Flow. |