Vous êtes sur la page 1sur 32

Copyright 2010 Elsevier Inc. All rights reserved.

OHailey: Chapter 8 Bonus Materials













Opening titles from Quercus Venenum (Poison Tree), 2008, SCAD group project.
Crowds
Lecture Notes
So far we have concentrated on how one character might be put together. What happens
if you have lots of characters? Hundreds? Thousands? Having more characters in a scene
increases line mileage, complexity, and the like. Many techniques have been developed
to handle this situation.
A good way to create crowds is by using 3D geometry and particle generators or crowd
simulators. Tools such as these generate swarms of trackable points that can be replaced
with various 3D objects, animated or otherwise. Such systems are used in VSFX films
and include sophisticated artificial intelligence (AI) to make the task of animating these
characters less time consuming. The AI varies the rate and spread of animation, and it
uses a library of animation clips to keep the crowd from doing the same thing at the same
time. If you interested in that type of software, you can look up Massive software at
www.massivesoftware.com. Many of the visual effects houses use this software, and it is
very impressive. However, it is completely 3D and pretty expensive. If you arent lucky
enough to have access to it for your short film or student project or if you require
something that is 2D/3D, youll have to come up with other solutions.

Copyright 2010 Elsevier Inc. All rights reserved.
WHAT OTHER SOLUTIONS ARE THERE?
2D Compositing
You could use many layers of crowds in a 2D compositing system and use multiplane
techniques to separate the various levels of crowds. Figure 8.2 shows an example of
crowd characters drawn in Flash. These crowd members happen to be dead, but they are
crowd people nonetheless. They were placed on different levels in Flash and moved at
different rates in front of the camera to give the perception of space between them.
Because Flash uses symbols, it was easy to reuse the same drawing of a dead crowd
person and flip, skew, or adjust the symbols to look different. You can see the Flash
example of the file in the companion data PoisonTree_Scene_1.swf.
Figure 8.1














Using Flash symbols to create crowds.
If your shot is in flat or limited space, using a 2D compositing technique will allow you
to create crowds.
3D Sprites
What if you need to have a deep space shot? You have seen in After Effects how to move
the levels closer to the camera and create deep space. You have also seen how to texture
polygon planes in Maya to create a 3D multiplane scene. This same idea can be used to
generate crowds in that deep space shot.
Copyright 2010 Elsevier Inc. All rights reserved.
The main problem to resolve is that of how to place the crowd members in the scene in a
way that is not manual. We want to come up with a technique that allows the artist to
look at the crowd placement as a whole and not on the individual level. Well explore this
concept in both Maya and Houdini in the hands-on portion of this chapter.
Industry Examples
We could name dozens of examples. 3D crowds were made to look 2D in Disneys
Hunchback of Notre Dame and with the Hun charge in Mulan. The filmmakers used
proprietary software written by a two gentlemen from the Florida animation studios.
Dreamworks utilized a large number of 3D crowds (and 2D/3D for that matter) in its
earlier films Prince of Egypt, El Dorado, and Spirit.
In addition to 2D crowd people, 3D crowd members can also be prerendered and used to
populate a 3D space. This technique was used in the crowd scenes for Mulan. If you
watch the DVD extras, you can hear more about it. Pixar used the same technique in
Bugs Life. To save on rendering time, ant cycles were prerendered and applied as texture
maps to planes in the environment. To keep things visually mixed up, the filmmakers
added 3D characters amidst the prerendered fellows. Some of the prerendered crowd
members were not animated. You can see a spoof of that concept in one of the blooper
animations that were included with the film. Of course, other films have used this
technique as well: The Simpsons Movie has the camera move through a pitchfork-
carrying mob. Film Roman utilizes this technique in many of its Futurama movies. Now
that it has been brought to your attention, you will notice it in many films, old and new.
Hands-on Examples
Maya: Random Still Image Crowd
Well now go through how to use Mayas particle system and Sprite wizard to populate a
3D world with 2D animations. Well also add in a little bit of an expression (straight from
the Maya documentation) to add some randomness.
Our goal is to assign a series of still images randomly to a particles system. This would
be something you would do to fill in the gaps of a larger crowd system or use in a quick
shot where no one will notice that the characters arent moving. You could use it for
vegetation, rocks, trash, and so on. The sky is the limit. You can easily use this same
technique to bring in a sequence of images as well.



Copyright 2010 Elsevier Inc. All rights reserved.
Our Characters
We are going to use a quick bunch of smiley faces to populate our space with. Figure 8.2
shows the files that are in the companion data.
Figure 8.2






Smiley face crowd members from Happy.1Happy.8.tif.

Our Space
In Maya we will create a particle system, adjust it with deformers, and use the Sprite
wizard to attach our characters. You can recreate this technique in many particle systems,
surely. The thing you are looking for when creating your crowd is to have artistic control
over the placement of the crowd. You want to have it not look like a marching band
unless, of course, it is a marching band.
Creating Particles in Maya
In Maya you will want to create a crowd of particles. In this example, the particles will
stand still and the camera will move.
Lets play around with the particles first:
1. Select the option box for the particle tool under Dynamics: Particles > Particle Tool.
2. In the tool option box, turn on the sketch particles checkbox.
3. Set the number of particles to something small and the Sketch interval to a larger
number.
4. Then click and drag in the perspective window to paint particles.
In Figure 8.3, you can see that these options give you a speckling of particles where you
painted. This isnt what we would want for a crowd system (unless it was a crowd of
jellyfish), but that type of particle system would be great to put 2D water splashes,
fireworks, sparkles, smoke, clouds, and the like onto. Why didnt we cover this back in
Chapter 6? Im sorry, you didnt raise your hand. Next question.


Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.3


Using the Sketch option to paint particles.
The Crowd Particle System
That was fun, but lets work on our crowd. Create a new scene in Maya, and again select
the option box for the particle tool, found under Dynamics: Particles > Particle Tool.
1. Check on the Create Particle grid checkbox.
2. Adjust the Particle spacing to 2.
3. In the perspective window, click once for the upper left corner of the grid.
4. Then, click again for the bottom right corner of the grid.







Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.4

Using the Create Particle grid.
Hit Enter on the keyboard and the grid of particles will be completed.
In step 2, we adjusted the particle spacing. You cant adjust that after the creation of the
particle system. If you want a tighter packed crowd, create another particle system with
smaller particle spacing.
Figure 8.5











Completed particle grid.

Copyright 2010 Elsevier Inc. All rights reserved.
You might think this looks just like a marching band. It does, but wait, theres more. To
have some artistic control over the placement of these particles, we can use deformers. I
think this particular ability was added somewhere around Maya version 6.5 or possibly 7.
I know; you dont care. For those of us who have been with Maya since version alpha,
its a big deal.
1. Make sure the Particle system is selected. (It will be green.)
2. Go to the Animation area.
3. Select Create Deformers > Lattice.
4. In the inputs area of the channel box, you can adjust the divisions of the lattice to
have more selection points with which to adjust the particles.
Figure 8.6











Creating a lattice on top of a particle system.

1. Right-click on the lattice and choose Lattice Point from the contextual popup
window.
2. Use the move tool to move these points around. This will manipulate your particles.
In Figure 8.7, the movement of the lattice was done in the top window. This is to keep the
particle points all on an even axis with no addition of Y movement.



Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.7









Moving lattice points.
Figure 8.8


Lattice on particles seen from the Perspective view.

Applying Sprites
In later versions of Maya, a Sprite wizard was added to help automate the addition of
sprites. Sprite is a fancy word for a 2D images or 2D image sequences that are placed on
polygon planes. This is a common technique that can usually be duplicated in many types
of software.
You can continue with the scene you have been working on or open the example from the
companion data, Crowd_v1.mb. Were going to assign a random number to each
Copyright 2010 Elsevier Inc. All rights reserved.
particle. This is a little geeky, but youll do fine. This comes from reading the Maya
documentation:
1. Select the particle1 particle system in the outliner.
2. In the Attribute Editor, locate the particleShape1 tab or hit the down arrow key.
3. Open the drop-down menu for Add Dynamic Attributes.
4. Click General.
5. In the window that opens, select Sprite Num PP, and click OK.
6. This adds a field into the Per Particle [Array] Attributes area of the Attribute
Editor. The object itself is made of lots of particles. This is where we can get or
give attributes to those individual particles.
7. Right-click on the text field next to Sprite Num PP and select Creation
Expression. This opens up an expression window.
8. In that window, type in the following expression, then click Create:
9. particleShape1.spriteNumPP =rand(1,8)
What does that do? Well, it assigns a random number between 1 and 8 to each particle as
it is created. If you had more images, you would adjust the numbers accordingly.
Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.9





































Creating a Radom number per particle.
Copyright 2010 Elsevier Inc. All rights reserved.
J ust a note about expressions on particles: You my have noticed that there were other
options when, in step 6, you right-clicked on the Sprite Num PP attribute. Three types of
expressions can be written. One that runs when the particles are created, one that happens
at runtime before any dynamics (wind, force, gravity, etc.) happens, and one that runs
after the dynamics are calculated. We chose to create one to run before particle creation.
Geek notice: You can actually bypass the expression portion discussed previously. In the
Sprite wizard that you will soon learn about, you can click the Random button. It does the
same thing. You wont know it is working until you render, which is why this author
found a workaround with the expressiona great case of user error.
Now that portion is done, we can assign sprites to the particles. Continue with the file you
have been working on or open the file included in the companion data, Crowd_v2.mb.
1. Select the particle1 system. The particles will turn green.
2. In the Dynamics area of Maya, select Particles > Sprite Wizard.
Figure 8.10













Opening the Sprite wizard.
3. Click Browse for the Sprite file.
4. Select the first image of your sequence. In our example it is Happy.1.tif.
5. Warning: According to the documentation, sprites do not recognize number
paddingHappy.0001.tif, for example.
Copyright 2010 Elsevier Inc. All rights reserved.
6. Click Continue.
7. In the next area, Image Assignment, choose No Animation. This will assign one
image per particle. If you are doing an EFX cycle (water splash, etc.) or an
animated sequence, you would choose cycle.
8. Click Continue.
9. This next area, Initial Sprite Assignment, choose the radio button for Use each
particles particleID value. That is the number we applied the random
expression to.
10. Note: You can experiment with Random or Ramp, as explained in the geek note
presented earlier. However, you will not see the results until you render!
11. Click Continue.
12. The window will display a summary of what it did. Click Apply.
Figure 8.11













Result of using the Sprite wizard.
Figure 8.11 shows the result of using the Sprite wizard. The images have been randomly
applied to the particles, and there is a bonus: move the camera around. Go ahead. Move
the camera. All of the sprites continue to face the camera. In fact, you could use this
technique for the multisphere example that we did in the previous chapter. Instead of
using constraints, we could have just painted one particle and used the Sprite wizard.
Copyright 2010 Elsevier Inc. All rights reserved.
We could stop here, but there is something you need to know about particles and
rendering them. They default to render with hardware shading. That could be a gotcha.

Figure 8.12


Oops. Particles default to the hardware render.

In newer versions of Maya, you can use Mental Ray to render particles, as well. Except
that we cant use Mental Ray with the technique we just used. It is impossible. Really,
heres a quote from the help documentation:
spriteNumPP is unsupported; therefore, assigning different sprites on a per-particle basis
is impossible. Mental Ray and Maya Hardware may render particles slightly differently.
I didnt believe it, so tried to render them with software anyway. Ill skip to the end and
say it wont work. Ill show you the steps; it will work for other sprite techniques that do
not use spriteNum PP.
Continue with the file you have been working on or open the file included in the
companion data, Crowd_v3.mb.
1. Select the particle system in the outliner; ours is named particle1.
2. Locate the tab for Render Attributes.
3. Change the Particle Render Type to Sprites.
Copyright 2010 Elsevier Inc. All rights reserved.
4. Render using Mental Ray.
5. Feel sad. You can see in Figure 8.13 that we have all yellow happy faces because
Mental Ray cannot read the per particle ID number.
Figure 8.13

















Oops. Mental Ray cant listen to our randomness based on spriteNum PP.
Instead well have to use a hardware render and composite the particles over any other
objects that were in the scene. Change step 4, above, to rendering with Hardware
Render and skip step 5, since you do not have to feel sad.











Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.14













Hardware Render reads our expression.
Houdini
What you do not know is that I do not know Houdini. With the help of Professor Clarke
Stallworth (SCAD, Atlanta) and the Houdini documentation, I was able to take a crash
course for your benefit. I include it here, because I told my students that I would. In the
spirit of learning new methods and trying untested waters, I present to you, how to use
Houdini for crowds.
Now, this technique is a little beyond just doing a base particle system. I proposed to
Clarke that I wanted to create a crowd population based on an artists input and then put
the crowd on a terrain, just for fun. This is what we came up with. (I mean we as in I
reverse-engineered Clarkes files enough so that I could re-create the technique and talk
about it.)
The Animated Character Sequence
Included in the companion data for this chapter is a quick animation of a lollipop-
wielding baby in the style of Don Hertzfelt: CrowdGuy.psd. It was created in a simple
fashion in Photoshop and exported as a mov file with animation compression so that it
would include an alpha channel. The movie file was taken into After Effects, and an
image sequence was exported. The result is a series of images titled CrowdGuy_000[1-
Copyright 2010 Elsevier Inc. All rights reserved.
30].tif. Figure 8.15 shows that in order to get frame padding out of After Effects, you
have to include it in the base name when you save.
Figure 8.15















CrowdGuy.psd saved as a movie file and used to create an image sequence with alpha
channels.
Houdini
Now for the new software, which for all of us will probably be Houdini. Go ahead and
open it. This book is using version 9.5. A new interface was added at version 9. So
anything prior to that will look different from the way it appears in this book. Lets look
at Figure 8.16 for a quick view of the landscape that we will be working in.
Houdini is node based and there are many sections of Houdini to work on those nodes. At
the top of the screen, there are tabs to use for creating objects, much like shelves in Maya.
On the left is the main Scene View; you can see the tab in Figure 8.16. In that same area
is a Composite View that we will use. On the right-hand side of the screen, you see a tab
for Parameters. This is like the Attribute Editor in Maya. Lastly, at the bottom right is
the obj, Scene tab, much like Mayas Hypergraph (hierarchy and connection) editor.

Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.16




















Houdinis interface.
Okay, one last word before we jump in: Houdini is a very powerful program. It is the tool
to blow things up with and is utilized by many industry studios. It also has some
interesting rigging features for character setup. So Houdini isnt for VSFX people alone,
animators can use it too. Now, lets jump in.
1. In the top shelf section, select Create > Grid. Click and place a grid in the Scene
area. You will note a grid node appears in the obj view (the Houdini Hypergraph).
2. Double-click on the Grid node. To see the points, make sure the Display Points
button is depressed (Figure 8.17). (You are welcome. That took me 30 minutes to
find. The first exploits into a new software program take patience and coffee.)





Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.17


















Create a grid.

3. Next, locate the following and click Deform > Mountain. Youll note that a
mountain node is created and is hooked up to the output of your grid node. If it
prompts you to select geometry, select all of the points on the grid and hit Enter.
This was a fun step. We didnt actually have to make our grid mountainous, but I
couldnt resist.








Copyright 2010 Elsevier Inc. All rights reserved.

Figure 8.18

















Mountain deformer added to the grid.

4. First click on the Grid Node, then create UVs by locating and clicking on the
Texture >Texture UV Texture button. If your grid is not selected, you may have
to select all of the faces and hit Enter. (J ust a note: UVing in Houdini is quite
useful. You might consider using Houdini to UV your Maya models. Honest, Im
not receiving a commission, just noting where things fit into my pipeline.)






Copyright 2010 Elsevier Inc. All rights reserved.

Figure 8.19


Adding UVs to the grid.

5. We only need the UVs to apply the texture that well use to scatter the crowd
with, so we dont need it to be attached to the mountain. Drag the texture node to
the side and connect the grid to the mountain. The texture should not connect to
the mountain (Figure 8.20).
Figure 8.20









Disconnect the UV from the mountain node.
Copyright 2010 Elsevier Inc. All rights reserved.

6. Select the Texture node, then hit the TAB key on the keyboard. This brings up a
secret menu to create more nodes. Select Manipulate > Point. If the point node
does not come connected, connect the texture node to the point1 node.
Figure 8.21
























Create a point node.

7. Well load in a texture that will be used to scatter the particles. In the area of the
scene view, click on the Composite View tab.
8. This will open a blank composite window, and youll note that a new node view
has opened with a Comp1 node. Double-click on the comp1 node.
Copyright 2010 Elsevier Inc. All rights reserved.
9. When you double-click on the comp1 node, the tab area goes blank. The
difference is that the top of the tab tells you that you are inside the node:
img/comp1. In this blank area, right-click and select Add > Add File Operator.
10. Select an image that describes where the crowd will be placed: black =no crowd,
white =crowd. Well use the file gradientTest.tif. Youll note that a node has
been added to the img/comp1 window.
Figure 8.22

















Loading an image into the comp viewer.

11. Return to the Scene view, and select the Point node. In the Parameter window,
change Keep Color to Add Color.
12. Well add an expression into all three of the fields (for R, G, B). Place your cursor
into the text field for Color R and hit ALT + E on the keyboard. This opens the
Expression Editor and you will see the following expression:
pic(/img/comp1/gradientTest_tif, $MAPU, $MAPV, D_CLUM)
Copyright 2010 Elsevier Inc. All rights reserved.
13. The image path is to the image we loaded into the comp editor back in steps 9 and
10. This expression will read the red green and blue values of the texture and
average them into one number, basically the luminance. The pic function is
slightly slow, according to the documentation.
14. Once youve completed the expressions, render the output of the point node by
clicking on the right side of the point node. You should see the gradient applied to
the grid (Figure 8.23).
Figure 8.23






















Reading image luminance at every point on the grid.
Copyright 2010 Elsevier Inc. All rights reserved.

15. We need to take that luminance number back out and make it useful. Select the
point1 node, and hit the Tab key. From the popup menu, select Attribute >
AttribTransfer. It will come in unconnected.
16. Connect the output of the point1 node to the attribtransfer1 node (right side).
17. Connect the output of the mountain into the left side of the attribtransfer1 node.
18. In the attribute node, change the Points to read from Cd. Cd stands for color. In this
case it does not stand for change directory, my unix/linux fiends.
Figure 8.24





















Using an AttributeTransfer node to take the texture color information.
Copyright 2010 Elsevier Inc. All rights reserved.
20. 19. With the attribtransfer1 node selected, create a Model >Scatter node.
Figure 8.25














Scatter node added.

20. Click on the right side of the scatter1 node to see the render of the points across the
scatter surface.
21. Change Alternate Attribute to Cd (color).
22. Change the Attribute Bias to 1. Watch the dots skitter to match the gradient texture.
How cool is that? Now you have ultimate artistic control over how the particles/crowd is
scattered.
23. Bring the number of Points down to 400.







Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.26



























Points scattered based on the texture.

Copyright 2010 Elsevier Inc. All rights reserved.
Well, that was an interesting tour of the software. How did you do? You can view the
completed file in the companion data, Crowd_Scatter.hip. If this was your first time
using Houdini, you might have had to redo a few steps to figure out where things were. It
took me about 10 times until I was able get a feel for the interface. Once you get over that
hurdle, it will be natural for you to move around in the interface. It even starts to make
sense.
Now lets add that baby animation to the particles. First well need to load in the baby.
To create a Sprite material, youll have to locate the Shop Editor. Giggle to yourself just a
little. I think of drill presses and welding torches, but that is a different shop. Have I
mentioned that I do not know how to weld? I think it is holding me back in life. Daddy
never taught me. Though I watched him weld all of the time. We might be getting off
topic. Back to the Houdini Shop Editor. You can locate it by clicking on the pull-down
menu in the object tab. You will note that you can switch between all sorts of panels.
Choose the Shop Editor. (Actually, it is probably called a Shop Panel, or Shop for short.)
Figure 8.27








The Shop Editor.
1. Go to Shop.
2. Click on the Tab key and create a VEX Decal node.
3. In the parameter, click on the VEX Decal nodes Texture Map attribute to load in
CrowdGuy_0-30.tif.





Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.28



Loading in the image sequence as a VEX Decal Material.

Now to apply that to the points we have created, well need to create a particle system to
hold the sprites:
1. Return to the Scene view, select the scatter1 node.
2. Hit the Tab key on the keyboard and select a Particle > Pop Network from the
popup menu.
3. Connect the Scatter1 output to the popnet1 input 1.






Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.29
















Pop Network added to the Scatter node.

4. Double-click on the popnet1 node. This takes you inside of that node where we
can add the sprites.
5. Inside this empty particle node, create a source by clicking Tab on the keyboard
and selecting Create > Source.
6. In the parameters of the source1 node, click on the box icon next to SOP, select
the scatter1 node, and click Accept.







Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.30





















Creating a particle source.

7. With the source1 node selected, create a Drive Particles > Sprite Node, located
in a top menu. Sprites will appear in your scene view.
8. In the parameter panel, click Enable Sprite SHOP.
9. Click the icon next to Sprite SHOP, and load in the v_decal1 node.
10. Change the Source Birth tab to have an impulse birth rate of 500 (the number of
points we had) and a constant birth rate of 0. Now you have static particles.

Copyright 2010 Elsevier Inc. All rights reserved.
Figure 8.31








Enabling Sprite Shop.

Well, that seems to be it, except that there is still one more thing. If you look in your
scene view, youll note that you do not see those sprites. Where could they be? A little
looking around in the documentation will reveal this little thing you should know, the d
key.
In the scene window, hit the d key to access the display options window. Click on the
particles tab, and change to Display Particles as Sprites. Now your baby animation
shows up in the scene view. You will not see the sprite animation until you render.
Figure 8.32










Seeing Sprites in the scene view.

Copyright 2010 Elsevier Inc. All rights reserved.
If you want to dig deeper, there is plenty of learning to do in this software. For example,
you could write an expression to randomize the playing of the baby animation as well.
See examples in the companion data for more detailed versions of randomness and uses
of sprites.
Student Contributors
Clair Almon
Faculty Contributors
Clarke Stallworth