Master Rai and Student Jin
An Animation Project in Maya

Download:


Video

Maya Plugin

Overview:

The animation was produced with Maya 7, and the video was assembled with sound using Adobe Premiere 6.5. Most of the animation was done using forward kinematics exclusively. The additional technical component is an implementation of the method proposed in the paper Continuum Crowds by Treuille et al. in the form of a Maya plugin. The plugin was used to key the motion paths of the villagers in the background. Both the video and the plugin are available for download.

Development:

Story: The idea came about just by considering humorous names for the characters - and this established a theme that I hope is humorous to others. With this basis, a slew of kung-fu double entendres ensued. The bits of dialogue evolved and came together into the finished product seen here. The storyboard underwent a couple of iterations to get the gestures between the characters to emphasize their dialogue.

Music: I found a random MIDI file on the Internet that sounded light and had a very stereotypical "asian" sound to it. It had to be resampled and saved as WAV format to be compatible with Adobe Premiere.

Dialogue: The dialogue was recorded from start to finish in a single run. Master Rai was performed by me, and Student Jin was performed by the talented and even more beautiful Chloe Tejada. Thanks! To provide an affordance that a particular character is speaking, I deform their moustache and beard. Visually, the frequency of this deformation typically doesn't match the spoken dialogue - but perhaps this is just staying true to the kung-fu movie theme!

Technical Component - Continuum Crowds:

To use the plugin, it must be first be placed in the Maya installation directory /bin/plug-ins/ subfolder. It can then be loaded through the plugin manager, or by using the loadPlugin command in the Script Editor. Either way works:

The plugin contains a single command, CreatePotentialField. The following parameters exist:

-minXminimum X value for grid in world coordinates
-maxXmaximum X value for grid in world coordinates
-minYminimum Z value for grid in world coordinates (in Maya, movement occurs on XZ plane)
-maxYmaximum Z value for grid in world coordinates
-gIntervaldimensions of grid cell in world coordinates
-frameTimenumber of frames to process for (set this to your animation length)
-debug(optional) 0.0 shows nothing, 1.0 dumps grids to stdout, 2.0 dumps velocity vectors to stdout

Here is an example call to the command in the Script Editor (and the one I used to produce my animation). For each of the 1280 frames of the animation, key values are set for the translation and rotation attributes of the transform nodes corresponding to each crowd agent. This saved me from having to set keys for these attributes manually. To give the effect of locomotion, I set up a simple walk cycle which just repeats at pre and post-infinity.

Naming convention: CrowdAMember1, CrowdBMember3. To identify objects which are crowd agents from other scene objects, a specific naming convention is used. The first 5 characters of the name must be "Crowd". The CreatePotentialField command works by selecting all transform nodes whose names have this 5 character prefix. Additionally (and very ad-hoc now), the plugin supports two separate groups. To denote which group a crowd agent is part of, use "A" or "B" as the 6th character (after "Crowd"). The following image is of the Outliner and demonstrates the naming conventions used in my project:

Setting fields: The goal regions are the top and bottom rows of the grid (this corresponds to values of Z=-30,30 in Maya's world coordinate space). To prevent the crowd agents from passing between the two main characters or occluding the camera's view of them, I apply high values of discomfort to the region around them.

Setting characters: Aside from the naming convention, the crowd agents can be initially keyed at any location which lies within the grid. So the agents rotate correctly as they move (oriented in the direction they're travelling), I assume that all crowd agents have rotation initially keyed to the direction (X,Z)=(1,0).

Benefits: Not having to animate the villagers myself saves time, although in my animation there are only 10 crowd agents in total (I'd have used way more but Maya was getting bogged down with the rendering of each frame in the perspective window - detracting from the "real-timeness" of the whole approach). The animations produced exemplify some of the crowd phenomena outlined in the paper such as lane formation.

Limitations: In my implementation of the algorithm, the gradient of the potential field is not anisotropic. As a result, even though I use bilinear interpolation of velocity values, the characters sometimes experience "jitter" - they rotate back and forth slightly between frames - which is very unnatural looking. Fortunately, it wasn't a big deal to go through the Graph Editor and just delete those translation/rotation keys for the frames it happens in - and I still got the overall crowd dynamics in the end.