Sybex - Maya. Secrets of the Pros

April 13, 2017 | Author: petar | Category: N/A
Share Embed Donate


Short Description

Download Sybex - Maya. Secrets of the Pros...

Description

Here's What You Will Find Inside Maya: Secrets of the Pros: Peter Lee of Storydale Inc. rides the power of Maya Unlimited's Sub-Division Surfaces to build a better horse. And now you can too. Page 35

Eric Kunzendorf of Atlanta College of Art challenges you to fire up your senses and visualize your character's actions as you model and texture for efficient animation. Page3

Mark Jennings Smith of Digital Drama brings you "Organix," simple geometric shapes and Paint Effects brush strokes are transformed into complex naturallooking objects that are then brought to life. Page 51

Robin Akin and Remington Scott of Weta Digital combine motion-capture data with keyframed animation in three powerful tutorials to help you master the integration of these two types of animation. Page 85

Keep your characters from mouthing off as Dariush Derakhshani of Sight Effects and John Kundert-Gibbs and Rebecca Johnson of Clemson University show some economical and flexible methods for matching your model's lip motion to your audio track. Page 119

Continued on the inside back cover

Associate Publisher: Dan Brodnitz Acquisitions and Developmental Editor: Mariann Barsolo Editor: Pat Coleman Production Editor: Elizabeth Campbell Technical Editors: Remington Scott, Mark Bamforth, Eric Kunzendorf, Keith Reicher, Joshua E. Tomlinson Production Manager: Amy Changar Cover, Text Design, and Composition: Mark Ong, Side By Side Studios Technical Illustrations: Eric Houts, epic Proofreaders: Laura Ryan, Nancy Riddiough, Dave Nash, Laurie O'Connell Indexer: Lynnzee Elze CD Coordinator: Dan Mummert CD Technician: Kevin Ly Copyright © 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94.501. World rights reserved. No part ofthis publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photograph, magnetic, or other record, without the prior agreement and written permission o f t he publisher. LibraryofCongressCardNumber:2002103171 ISBN:0-7821-4055-6 SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the United States and/or other countries. Secrets of the Pros is a trademark of SYBEX Inc. Screen reproductions produced with FullShot 99. FullShot 99 © 1991-1999 Inbit Incorporated. All rights reserved. FullShot is a trademark of Inbit Incorporated. Star Wars: Episode 1—The Phantom Menace still courtesy of Lucasfilm Ltd. Copyright 1999 Lucas film Ltd. & TM. All rights reserved. Used under authorization. Unauthorized duplication is a violation of applicable law. Stills from The Perfect Storm used with permission. Copyright 2002 Warner Bros., a division of Time Warner Entertainment Company, L.P. All rights reserved. Cover images: Pinos Mellaceonus—© MarkJennings Smith, Cathedral/Dinosaur/Room images © 2002 Clemson University Digital Production Arts, Horse image—© Storydale Inc., CG Boat image—© ILM, Crowd image—© Emanuele D'Arrigo TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer. The author and publisher have made their best efforts to prepare this book, and the content is based upon final release software whenever possible. Portions of the manuscript may be based upon pre-release versions supplied by software manufacturer(s). The author and the publisher make no representation or warranties of any kind with regard to the completeness or accuracy of the contents herein and accept no liability of any kind including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or alleged to be caused directly or indirectly from this book.

The Software compilation is the property of SYBEX unless otherwise indicated and is protected by copyright to SYBEX or other copyright owner(s) as indicated in the media files (the "Owner(s)"). You are hereby granted a single-user license to use the Software for your personal, noncommercial use only. You may not reproduce, sell, distribute, publish, circulate, or commercially exploit the Software, or any portion thereof, without the written consent of SYBEX and the specific copyright owner(s) of any component software included on this media. In the event that the Software or components include specific license requirements or end-user agreements, statements of condition, disclaimers, limitations or warranties ("End-User License"), those End-User Licenses supersede the terms and conditions herein as to that particular Software component. Your purchase, acceptance, or use of the Software will constitute your acceptance of such End-User Licenses. By purchase, use or acceptance of the Software you further agree to comply with all export laws and regulations of the United States as such laws and regulations may exist from time to time. Reusable Code in This Book The author(s) created reusable codc in this publication expressly for reuse by readers. Sybex grants readers limited permission to reuse the code found in this publication or its accompanying CD-ROM so long as the author(s) are attributed in any application containing the reusable code and the code itself is never distributed, posted online by electronic transmission, sold, or commercially exploited as a stand-alone product. Software Support Components of the supplemental Software and any offers associated with them may be supported by the specific Owner(s) of that material, but they are not supported by SYBEX. Information regarding any available support may be obtained from the Owner(s) using the information provided in the appropriate read.me files or listed elsewhere on the media. Should the manufacturer(s) or other Owner(s) cease to offer support or decline to honor any offer, SYBEX bears no responsibility. This notice concerning support for the Software is provided for your information only. SYBEX is not the agent or principal of the Owner(s), and SYBEX is in no way responsible for providing any support for the Software, nor is it liable or responsible for any support provided, or not provided, by the Owner(s). Warranty SYBEX warrants the enclosed media to be free of physical defects for a period of ninety (90) days after purchase. The Software is not available from SYBEX in any other form or media than that enclosed herein or posted to www.sybex.com. If you discover a defect in the media during this warranty period, you may obtain a replacement of identical format at no charge by sending the defective media, postage prepaid, with proof of purchase to: SYBEX Inc.

Product Support Department 1151 Marina Village Parkway Alameda,CA94501 Web: http://www.sybex.com After the 90-day period, you can obtain replacement media of identical format by sending us the defective disk, proof of purchase, and a check or money order for $10, payable to SYBEX. Disclaimer SYBEX makes no warranty or representation, either expressed or implied, with respect to the Software or its contents, quality, performance, merchantability, or fitness for a particular purpose. In no event will SYBEX, its distributors, or dealers be liable to you or any other party for direct, indirect, special, incidental, consequential, or other damages arising out of the use of or inability to use the Software or its contents even if advised of the possibility of such damage. In the event that the Software includes an online update feature, SYBEX further disclaims any obligation to provide this feature for any specific duration other than the initial posting. The exclusion of implied warranties is not permitted by some states. Therefore, the above exclusion may not apply to you. This warranty provides you with specific legal rights; there may be other rights that you may have that vary from state to state. The pricing of the book with the Software by SYBEX reflects the allocation of risk and limitations on liability contained in this agreement ofTerms and Conditions.

Software License Agreement: Terms and Conditions

Shareware Distribution This Software may contain various programs that are distributed as shareware. Copyright laws apply to both shareware and ordinary commercial software, and the copyright Owner(s) retains all rights. If you try a shareware program and continue using it, you are expected to register it. Individual programs differ on details of trial periods, registration, and payment. Please observe the requirements stated in appropriate files.

The media and/or any online materials accompanying this book that are available now or in the future contain programs and/or text files (the "Software") to be used in connection with the book. SYBEX hereby grants to you a license to use the Software, subject to the terms that follow. Your purchase, acceptance, or use of the Software will constitute your acceptance of such terms.

Copy Protection The Software in whole or in part may or may not be copy-protected or encrypted. However, in all cases, reselling or redistributing these files without authorization is expressly forbidden except as specifically provided for by the Owner(s) therein.

Manufactured in the United States of America 10987654321

To all our family, friends, and colleagues. And to Kristin, Joshua, and Kenlee. —John Kundert-Gibbs

Acknowledgments Florian Fernandez Charles LeGuen Miles Perkins, ILM Jacklyn Pomales, Warner Brothers Chris Holm, Lucasfilm Ltd. At Clemson University: James Barker, Doris Helms, Bonnie Holaday, Mark McKnew, Robert Geist, and Mike Westall At Sybex: Acquisitions and Developmental Editor Mariann Barsolo, Production Editor Elizabeth Campbell, Editor Pat Coleman, Production Manager Amy Changar, and Designer Mark Ong Chapter 4, Robin Akin and Remington Scott: Florian Fernandez, for providing the animation model, setup, and accompanying MEL script for the tutorials on the CD that accompanies the book. You can visit his web page at www.flo3d.com. Spectrum Studios, for providing the motion capture data used in the tutorial. Chapter 6, Emanuele D'Arrigo: John KundertGibbs, our coordinator, for his friendliness and constant encouragement. Robin Akin, for involving me in this project with so many incredibly experienced professionals. Munich Animation and its 3D supervisor Hartmut Engel, for allowing me to use their technical

resources. Chris Faber, one of the most amazingly talended and complete 3D artists, for his extremely precious lGB of RAM. Thomas Hain, thanks again for your hints. Simone Bruschi, who gave me the first suggestions on how to do CGI professionally. Franco Valenziano, who left me in front of Softimage on an SGI, with three tutorials to do in one hour. Carlo Alfano, to whom I dedicate my chapter. I am grateful for the chance that he gave me many years ago, offering an internship with the crew of Locomotion and kick-starting my happy career. Chapter 8, Habib Zargarpour: The incredible ILM crew of 120 artists who worked on The Perfect Storm, for their dedication and perseverance in what is likely to be the most difficult show they have worked on. VFX supervisor Stefen Fangmeier kept a consistent vision throughout the project, and ILM producer Ginger Thieson put up with my endless requests for reference! Many people contributed to this show, and in particular 1 would like to acknowledge John Anderson for his experience and knowledge of fluid dynamics and physics; we benefited greatly from his wisdom. My R&D team of technical directors: Joakim Arnesson, Pat Conran, Niel Herzinger, Chris Horvath, Erik Krumrey, Masi Oka, and Mayur Patelm. They all made amazing contributions and made it seem like anything was possible.

in

iv

About the Authors

About the Authors John Kundert-Gibbs, lead author John Kundert-Gibbs is director of the Digital Production Arts program at Clemson University, which is preparing the technical directors of the future. Author of a number of publications on Maya, computer graphics, and dramatic literature, he directs students in producing animated shorts, creates effects for live action projects, and designs electronic media for theatrical productions. He is co-author of Mastering Maya 3 and Mastering Maya Complete 2 and has a Bachelor of Arts degree in physics from Princeton University and a Ph.D. in dramatic literature frorn Ohio State University.

Robin Akin Robin Akin has been an animation supervisor for a CG/live-action television docu-drama and an animator and digital artist on feature films, commercials, and television series. Currently, Robin is working at Weta Digital on The Lord ofthe Rings: The Two Towers, the second film of the Tolkien trilogy. She has also worked for Digital Domain and SquareUSA, among other studios. Her animation credits include the feature films Titanic and Final Fantasy: The Spirits Within and Clio Award-winning commercials for clients such as Jeep and Coca-Cola.

Emanuele D'Arrigo Emanuele D'Arrigo began working in computer graphics in \ 995 in Italy before relocating to Munich to work as a freelance artist on various projects, such as the full-length animated feature Help! I'm a Fish!, a Danish-German coproduction, and the pilot episode for the science-fiction TV series Ice Planet, produced by H5B5. Professionally born on Softimage, he's now a TD mainly working with Maya, specialized in scripting, crowds, and effects. At the time of the writing, he's still based in Munich but has plans to move to England and eventually to San Francisco. His motto is: "Believe in your team, believe in your dreams."

Timothy A. Davis Timothy A. Davis is currently an Assistant Professor in the Computer Science Department at Clemson University and has played an active role in developing the interdisciplinary master's program in Digital Arts Production, which trains students to produce special effects for entertainment and commercial projects. His teaching and research interests include parallel/distributed rendering, ray tracing, spatio-temporal coherence, and non-photorealistic rendering. He received his Ph.D. from North Carolina State University in 1998 and has worked in technical positions for the Environmental Protection Agency and NASA Goddard Space Flight Center.

Dariush Derakhshani Dariush Derakhshani is a senior CGI effects animator with Sight Effects in Venice, CA, working on awardwinning national television commercials. He has won the Bronze Plaque from the Columbus Film Festival and has shared honors from the AICP and London International Advertising Awards. He has worked as a CGI animator and compositor on a variety of projects from films to television and was a Supervising Technical Director for the South Park television series. Dariush also enjoys splitting his time consulting and teaching at a variety of schools, including USC Film School's MFA Animation program and writing as frequently as he can. His works have appeared on thescratchpost.com and various sites of the digitalmedianet.com, and he is the Senior Editor of taintmagazine .com. He is the author of an upcoming book on Maya. Dariush has a Bachelor of Arts in architecture and in theater from Lehigh University and a Master of Fine Arts in animation from USC Film School. He is bald and has flat feet.

Eric Kunzendorf Eric Kunzendorf is co-chairman of Electronic Arts in the areas of animation, multimedia, and digital art at The Atlanta College of Art and has been teaching computer graphics and animation at the college level for the past nine years. His animations, Final Project Assignment and Mime In A Box, have made appearances at the SIGGRAPH Computer Animation Festival

About the Authors

in 1999 and 2000, respectively. He holds a Bachelor of Arts in art history from Columbia University and a Masters of Fine Arts in drawing and painting from the University of Georgia and has exhibited computer-generated prints nationally.

Peter Lee Peter Lee is director at Storydale Inc. in South Korea, where he supervises TV series, commercials, movies, and game companies. He has worked as a 3D artist on projects such as Columbia Tristar's The Nuttiest Nutcracker, New Line Cinema's/asow X, and Jon Nappa's The Super Snoopers; co-authored Sybex's Mastering Maya series; and taught computer animation at ITDC, University of Toronto. He has also lead projects such as games movies for Dong Seo Game Channel's PC game The Three Kingdoms III and Joycast's PS2 game Wingz.

Frank Ritlop Frank Ritlop is a Canadian living in New Zealand. He has been working in the CG industry for more than nine years and has a degree in film animation from Concordia University in Montreal. He has worked as a lighting supervisor for CG studios in Montreal and Munich and as a lighting artist at Square USA on Final Fantasy: The Spirits Within. He is currently working at Weta Digital as a Shot Technical Director on the second installment of the Lord of the Rings trilogy.

Remington Scott Remington Scott is currently overseeing motion capture production at Weta Digital for The Lord of the Rings: The Two Towers and was the Director of Motion Capture at Square Pictures for Final Fantasy: The Spirits Within and The Matrix: Flight of the Osiris. He has professionally created digital animations for 16 years. During this time, he was the Interactive Director at Acclaim Entertainment for the multi-platinum selling Turok: Dinosaur Hunter, and he also co-created the first digitized home video game in 1986, WWF: Superstars ofWrestling.

v

MarkJennings Smith Mark Jennings Smith has been interested in CG since 1972, when at age 10 a chance encounter with the first coin-op PONG changed his life. A CG historian, Mark would love nothing more than discussing industry topics from CG philosophy, industry politics, and pixels as fine art to character animation, flocking simulation, and the rise of the synthetic actor. He enjoys collecting fossils of CG past, on film and video. He sites William Latham, Yoichiro Kawagichi, Karl Sims, and David Em as influences among others. His art and words can be found from cover to page, in several CG/FX books and magazines. His film work has run the gamut from Universal Pictures to Roger Corman himself. His latest projects deal with "EXstreme Organix" (www . a b s y n t h e s i s . com), a cult comic-book hero, and a study of the past, present, and future of virtual humans.

Susanne Werth Susanne Werth got into animation in Mexico in 1997. She graduated from Fachhochschule Furtwangen in computer science and media and started out as a character animator with a children's TV series in Potsdam, Germany. After a period of time working as layout artist and layout supervisor, she went back to animation and stepped forward into MEL scripting. She currently works as character animator and MEL programmer at a children's TV production company in Germany.

Habib Zargarpour Habib Zargarpour is Associate Visual Effects Supervisor at Industrial Light & Magic. He is a recipient of the British Academy Award for Best Achievement in Visual Effects, as well as being nominated for an Academy Award for Best Achievement in Visual Effects for his work on both The Perfect Storm and Twister. His other credits include the upcoming Signs, Star Wars: Episode I The Phantom Menace, Spawn, Star Trek: First Contact,Jumanji, Star Trek: Generations, and The Mask. Habib joined ILM in the early '90s, after working as a graphic artist and fine arts illustrator since 1981. He received his B.A.S.C. in mechanical engineering from the University of British

vi

About the Authors

Columbia in Vancouver and went on to graduate with distinction in industrial design from the Art Center College of Design in Pasadena in 1992.

Technical Editors Remington Scott See above.

Student Contributors Mark Bamforth Robert Helms Robert Helms is a graduate student pursuing a Master of Fine Arts in digital production arts at Clemson University. He received his Bachelor of Science in electrical engineering from Clemson University. He particularly enjoys the programming and modeling aspects of the field. In his spare time Robert enjoys reading, painting miniatures, and SCUBA diving when he has enough money.

Mark Bamforth works in the Multimedia Department at PricewaterhouseCoopers. He has been working with 3D applications for 9 years and programming for 19. His animated short Space Station Fly-Through was screened at Siggraph 2000. He is currently working toward various continued education degrees in Maya and special effects at New York University's Center for Advanced Digital Applications. Eric Kunzendorf

Rebecca Johnson Rebecca Johnson, from Sumter, South Carolina, is completing work on a Master of Fine Arts in digital production arts at Clemson University. She was trained as a visual artist at Lander University, and her interest in commercial design evoked enthusiasm for computer-generated art. She enjoys combining her interests in art and computer design through character development and animation. While studying at Clemson, she has participated in many animated productions, undertaking roles as art director, modeler, and animator. Currently she is researching impressionistic rendering techniques. Rebecca hopes to continue to work in the field designing and modeling characters. Jacob Richards Jacob Richards started programming when he was 11 years old and worked on everything from the C-64 to the Apple IIe and up to the SGI Onyx machines. He has been working in 3D for more than five years. He received his Bachelor of Science in computer science from Clemson University in 1999 and is now working toward his Master of Fine Arts in digital production arts at Clemson. Jake is presently interning at Pixar Animation Studios.

See above. Keith Reicher Keith Reicher is a multimedia artist/3D animator currently freelancing in New York. He graduated from Pratt Institute with a Master of Fine Arts in computer graphics. Keith is the sole creator of the 3D animated short Benjamin Task, on which he functioned as writer, modeler, animator, and music composer. His interest in visual effects and animation began with the first Star Wars movie. He is now working toward a career in the film industry. Joshua E. Tomlinson Joshua E. Tomlinson is a techie by trade but an artist at heart. He has a love for both the technical and aesthetic aspects of CGI. He receieved his Bachelor of Science in computer science from Wofford College in 2000 and is now finishing his Master of Fine Arts in digital production arts at Clemson University.

Contents

Part One

Beginnings: Modeling

1

one Accelerating the Preproduction Process Eric Kunzendorf Getting from Concept to Animation 3 Scriptwriting, Thumbnailing, and Drawing 4 Modeling Methods 8 Texturing a Flour Sack 16 Setting Up for Animation 19 Creating an Arm 22 Blobbyman Comes to Life 31 Summary 33 two

Modeling a SubDivision Surface Horse

35

Peter Lee Creating Basic Shapes with NURBS Conversion to Polygons 37 Modeling Details 39 Summary 49 three

35

Organix—Modeling by Procedural Means 51 MarkJennings Smith Stop and Smell the Roses: A Primer 52 A Visual Maya Zoo 54 Bring Simple Life to a Creation 56 Abusing the Cone 59 Alternate Uses of Paint Effects 65 Organix and Paint Effects 68 Summary 81 VII

viii

Contents

Part Two

four

Putting Things in Motion: Animation 83

Animation and Motion CaptureWorking Together 85 Robin Akin and Remington Scott What Is Motion Capture? 85 Animation and Mocap 86 When Should You Use Mocap? 7 Using Motion Capture as Reference or Straight out of the Box 88 Cleaning Mocap 91 Summary 117

five Lip-Synching Real-World Projects

119

John Kundert-Gibbs, Dariush Derakhshani, and RebeccaJohnson Creating a Lip-Synched Animation 120 Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor 128 Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching 149 Summary 163 Part Three

The Numbers Game: Dealing with Complex Systems 165

six Creating Crowd Scenes from a Small Number of Base Models 167 Emanuele D'Arrigo Not Only Big Studios 168 Heroes 169 Deploying Three Task Forces 170 Always Room for Improvement 192 Summary 193

Contents

seven

Taming Chaos: Controlling Dynamics for Use in Plot-Driven Sequences 195 John Kundert-Gibbs and Robert Helms When To Use Rigid Body Simulations 196 The Setup: Plan, Plan, Plan 196 Preproduction: Research and Development 197 Production: Getting the "Shot" 98 Integration and Postproduction: Cheating the Shot So It Works 199 Working Example 1: A Quasi-Deterministic Pool Break 201 Working Example 2: Shattering Glass Over a Live-Action Plate 212 Summary 221

eight

Complex Particle Systems

223

Habib Zargarpour Industrial Lightand Magic Preproduction: Research and Development 223 Choosing the Best Method: Which Type of Simulation to Use 231 Visualization Techniques: Tips and Tricks 241 Putting the Method to the Test: Pushing the Limits 246 Advanced Techniques 247 Creating the Button 257 Testing and Documenting Before Postproduction 258 Final Result 259 Summary 260 nine

Creating a Graphic User Interface Animation Setup for Animators 263 Susanne Werth Planning the GUI 264 Creating the Window 268 Procedures 278 Warnings and Other User Helpers 288 Summary 289

ix

x

Contents

Part Four

Endings: Surfacing and Rendering

291

ten

Effective Natural Lighting

293

Frank Ritlop Lighting Design 293 Lighting Passes 294 The Properties of Light 294 Mapping a Texture to a Light's Color Attribute 295 Light Types 297 Shadows 304 Light Rigs 319 Finishing Touches 322 Summary 323 eleven

Distributed Rendering

325

TimothyA. Davis Jacob Richards The Maya Dispatcher 326 Tools and Recommendations The Socks Program 335 Summary 349

332

Introduction

Introduction When, in June 2001, Mariann Barsolo (Acquisitions and Developmental Editor at Sybex) and I first discussed putting Maya: Secrets of the Pros together, we had little inkling what a massive, international endeavor this book would be—nor how successfully it would turn out. Through good contacts and good fortune, Maya: Secrets of the Pros is truly a compendium of the global state-of-the art of Maya—and indeed 3D graphics as a whole. In these pages are authors from the Far East, Europe, Canada, and the east and west coasts of the United States. Our writers include those working for large effects houses, those working in (or owning) small CG production studios, and those teaching in universities. Our group includes a Maya professional from Italy working in Germany, two from the United States writing in Europe, and three who traveled from Europe or the United States to Australia or New Zealand during the course of writing their chapters. In short, we bring together in these pages a cross-section of the Maya community at large. What does this smorgasbord of globe-trotting Maya professionals from all walks of life mean for you, the interested reader? It means we will serve insights and instruction from the best of the best for you. It means—both on the pages that follow and on the included CD-ROM—you will have access to some of the best techniques, tips, and source materials ever collected in a book intended for public dissemination. It means you will gain understanding of the business, science and art of 3D graphics. And it means you will gain a global perspective about what makes us all passionate about the world of 3D graphics, however we practice it individually.

About this Book One thing worth noting is that Maya: Secrets of the Pros is not for the neophyte: If you don't know the difference between a manipulator handle and a spline curve, you're probably better off getting another book first (like, say, Mastering Maya 3 from Sybex). If, however, you're an advanced hobbyist or especially a professional who makes your living doing 3D graphics, this book is definitely for you—in fact, we built it from the start to be for you! In fact (and this is worth pointing out in bold face), even if you use other 3D

xi

packages along with or instead of Maya, this book is still for you. Although the scene files are all Maya, the workflow strategies and insights apply to just about any professional 3D package. We have attempted, whenever possible, to keep this book version-agnostic, if not package-agnostic. In other words, we feel the knowledge contained in this book is too timeless to go out of style whenever the next version of Maya comes out, so we concentrated on presenting workflow, technique, and creative problem-solving practiced by professionals rather than just the latest bells and whistles Maya provides (though there's plenty of "wow" factor to each of the chapters). So, whether you're working in Maya 4 or Maya 21, the knowledge in this book will challenge and inspire you to create better, more efficient, and more beautiful work. To get a better feeling for the buffet of tasty 3D dishes in store for you, try flipping through the book's pages (as if you didn't do that already). Just in case you want a little more of an appetizer for each chapter, here's what's in store for you, chapter by chapter. Part One: Beginnings: Modeling Chapter 1 starts at the beginning, moving from conceptual work to modeling efficient characters for your animation work. Eric Kunzendorfwalks you through the steps of visualizing your character and its eventual actions and then modeling and texturing the character so that your animation work will be a breeze rather than a chore. In Chapter 2, Peter Lee presents a concise, powerful method for creating complex organic forms (in this case a realistic horse) using Maya Unlimited's amazing modeling tool, SubDivision Surfaces. This chapter not only shows you how to use one of today's cutting-edge tools, but shows how professionals create complex shapes quickly and efficiently. Chapter 3 takes us to a whole new plane of modeling and animation. Here Mark Jennings Smith shows us how, through repetition of simple geometric shapes and Paint Effects brush strokes, to create eerily natural shapes he terms "organix." And if modeling these objects is beautiful, animating them is something close to meditation at a computer screen!

xii

Introduction

Part Two: Putting Things in Motion: Animation In Chapter 4, Robin Akin and Remington Scott cover the fascinating art and science of combining motioncaptured data from live actors with keyframed animation dreamed up by the animator—you—sitting in a studio. Using high-quality motion capture data and a powerful animation setup, the authors walk you (literally!) through the process of combining these two types of animation. Chapter 5 covers the exacting art of lip-synching mouths with pre-recorded audio tracks. Using examples from both cartoon and photo-real cases, Dariush Derakhshani, John Kundert-Gibbs, and Rebecca Johnson present the most efficient and flexible methods for matching your model's lip motion to your audio track, and they even provide tips on getting the best sound recording you can for your work. Part Three: The Numbers Game: Dealing with Complex Systems In Chapter 6, Emanuele D'Arrigo shows you how to create an entire crowd of "Zoids" from a single base model and then how to get them all to do "the wave" on cue! In this chapter, you will learn how to vary the size, shape, and color of your base model and how to introduce random variety to your characters' actions, producing believable crowd motion in no time flat. In Chapter 7, John Kundert-Gibbs and Robert Helms tackle the problem of taming Maya's built-in dynamics engine to produce specific, controllable effects for specific animation needs. Whether you need tight control over a stylized reality or to get a complex effect to look as real as "the real thing," this chapter will provide insight into getting the job done on budget and on time. Chapter 8 is all about particles, particles, and more particles! In this chapter, Habib Zargarpour takes you on a backstage tour of the process used to create the massively powerful and realistic wave mist from The Perfect Storm. Here, from one of the true masters of the insanely complex, are the secrets to working with huge datasets of particles to create photo-real production work. If you've ever wanted to create a simple graphical control for your animated characters, Chapter 9 is for you. First Susanne Werth helps you refine your goals in creating a GUI animation control; then she

walks you through the steps of creating one yourself. When you finish, you'll have a working template into which you can fit just about any character to speed up your (or someone else's) animation task. Part Four: Endings: Surfacing and Rendering In Chapter 10, Frank Ritlop shows you how the pros do lighting. Not satisfied with a few lights shining on his example scene, he meticulously demonstrates the layers of lights that need to be built up to form the beautiful finished product. Once you've worked through this chapter, you'll have the understanding and confidence to create your own complex and beautifully lit scenes. Chapter 11 is all about getting the most out of your rendering machines, whether they are dedicated render farm boxes or are being shared by users and render tasks. Timothy A. Davis and Jacob Richards explain the general theory of running large render jobs in parallel and then take you on a tour of their own distributed renderer—included on the CD—which you can use to speed up your rendering tasks.

About the CD The CD-ROM that accompanies this book is packed with useful material that will help you master Maya for yourself. In addition to a working demo of xFrog (a 3D modeling package that creates some very cool organic models), we have scene files, animations, and even source code relating to the chapters in the book. Some CD highlights are: • Models, textures, and animation of a flour sack • A completed subdivision surface horse, plus animation of it walking • "Organix" scene files and animations (see Chapter3) • Motion-capture data and a pre-rigged skeleton to place it on • Models and animation demonstrating various lip-synching techniques • Models and MEL code for generating crowd scenes, plus animation of this crowd doing "the wave" • Models demonstrating rigid body solutions to a billiards break and shattering glass, plus animation of various stages of work on these scenes

Introduction

• A simplified version of the "crest mist" generating scene used in The Perfect Storm • MEL code for generating character animation GUI controls • Scenes with models and textures for use in practicing lighting technique • A completely functional Windows-based distributed rendering solution, plus source code for it As you can see from this list, rather than having to create entire scenes from scratch for each chapter, the accompanying scenes and animations get you started and help guide you to appropriate solutions quickly and efficiently. Additionally, after you go through a chapter once, you can grab a sample scene file or bit of code and play with it, finding your own unique and wonderful solutions to the challenges presented in each chapter.

Staying Connected To stay up-to-date on the Maya: Secrets of the Pros, please go to the book's page at w w w . s y b e x . c o m . If you have any questions or feedback, please contact John Kundert-Gibbs at j k u n d e r t @ c s . c l e m s o n . e d u .

Sharing Our Experiences As you can see, the subjects covered in this book unveil nearly all Maya has to offer and likewise most areas of 3D graphics. Often these authors will reveal little known secrets or point out ways to perform a task that make that job much quicker than you might have imagined. Whether you're an animator, a surfacing artist, a

xiii

Technical Director, or someone who loves all the phases of 3D production, there is a delicious dish somewhere in this book for you. And whether you proceed from first to last course or pick and choose your meals, there will be something in Maya: Secrets of the Pros to satisfy your appetite for months if not years to come. What has become clear to all of us who worked on this book is that, no matter how long you have worked with Maya or in 3D graphics, there is always more to learn, and that the joy of learning is half the fun of working in this profession. We also have been inspired and amazed by one another's work. Finally, we have distilled in our little enclave one of the greatest aspects of working in the graphics community: there is an openness, generosity, and willingness to share in this community that is simply astounding. As you sample the chapters in this book, recall that someone is serving you years of hard-won experience with every page you read and every exercise you work through. All you have to do is pull up a chair and dig in. Working on these pages has been a reinvigorating experience. All of us have felt again the joy of discovery and the equally wonderful joy of helping others who appreciate our unique talents. We trust you will feel our heartfelt love of what we do, and in sharing it with you, on any given page. And don't forget to share your passion with others! We have had great pleasure in preparing this eleven-course meal, and invite you to partake of the feast we have set out for you! —John Kundert-Gibbs April 28, 2002

Accelerating the Preproduction Process Eric Kunzendorf

/'// discuss some strategies to accelerate preproduction as well as the early stages of production. In most individual animation projects, these early phases take the lion's share of time. Often animators, especially those learning the art form, spend so much time scriptwriting, thumbnailing, drawing, modeling, texturing, and rigging that they run out of time and inspiration for what was originally the focus of their efforts: the animation itself. Getting from Concept to Animation You create and animate characters in the following interrelated and often interwoven stages: Scriptwriting, deciding what your character will do. Thumbnailing, deciding how your character will look. Drawing, deciding how the details of your character will look. Modeling, creating geometry for characters, props, and backgrounds. Texturing, creating materials for your character and scenes. Setup, wrapping geometry around bones and other deformers (sometimes called enveloping). Layout, arranging characters in your scene. Animating, making your characters move. (Layout is often combined with this phase.) Lighting, making your animations visible for the camera. Rendering, taking moving pictures or "filming" the animation you've created. Post-process, sequencing rendered frames with sound, compositing, editing, and output to tape. As you can see, the process is long, and almost everyone who creates 3D animation follows it to some extent. Game, motion graphic, commercial advertising, animation broadcast

4

C H A P T E R 1 • Accelerating the Preproduction Process

video, and feature film studios all use this methodology to varying degrees. But these are examples of team-based production; individual animation producers/directors, such as those trying to produce an animation for use on their demo reels, are responsible for each phase themselves. Spending too much time on any one phase or group of phases can be fatal to the entire process. As an animator, I tend to focus on getting to the animation phase as quickly as possible, while still having an appealing and easy-to-animate character. My goal in this chapter is to show you how to speed up these early phases of the CG (computer graphics) animation process. Becoming skilled at computer animation involves negotiating the dichotomy of learning the technical processes of the discipline while attempting to master the art forms of quality character animation. Complicating this process is the complexity of character animation itself, the enormity of Maya (or other high-end 3D packages) as a piece of software, and the time constraints inherent in any animation project. Nobody has an unlimited amount of time for work (and making peace with that fact is a superb first lesson), so operating within a given amount of time is an inevitable constraint. Coming to grips with the limited resource of time and comparing it with the enormous volume of work involved makes you realize how daunting the challenge of creating quality CG animation really is—especially in a solo or small group project! "It's [baseball] supposed to be hard. I fit wasn't bard, everyone would do it. The 'hard' is what makes it great."—}immy Dugan (Tom Hanks) in A League of Their Own Computer animation is like baseball, but with the added difficulty of being perceived as easy to accomplish. Unfortunately, the rah-rah making of documentaries, feature-laden advertisements, and skilled demonstrations by power-using industry professionals does nothing to dispel this idea. These facts, coupled with the intrinsic coolness of creating animated creatures and worlds, have lead thousands of individuals to try their hand at animation. Lured by obsolete tales of Hollywood discovering, hiring, and training people off the street and egged on by the desire to see their creations come to life, people often work diligently to learn the software but then become puzzled and, in some cases, discouraged when their skills are not marketable at their desired employment level. This is especially true of character animation. Character animation is hard, and that "hard" truly does make it great! If it were easy, everybody would do it well. Animating well requires that you focus on what you want to accomplish as precisely as possible before sitting down at the computer. The first three phases of the animation process—scriptwriting, thumbnailing, and drawing—are often called preproduction. They are key because you have precious little time to complete an animation, and the planning, far from increasing production time, actually shortens it.

Scriptwriting, Thumbnailing, and Drawing Deciding what you want your character to accomplish should be an obvious first step, but I am continually amazed at the huge effort young artists put into creating characters with absolutely no idea what they want them to do. Then, when they try to animate them, they become frustrated when the characters will not do what they want. The first rule of animation (and all types of film making, for that matter) is: put the story first. All great movies and shorts have stories that every aspect of the production process must serve. Pixar, PDI, and

Scriptwriting, Thumbnailing, and Drawing

Disney all followed this idea in every critically and financially successful animated movie they produced. They come up with interesting stories and then expend enormous amounts of R&D, artistic effort, and technical resources to produce their movies. Game developers operate on much the same principle. Scriptwriting is an art form unto itself. The intricacies of the three-act narrative and beyond are way beyond the scope of this short chapter. So, recognizing that a larger story will provide a narrative framework in which the discrete actions of the character carry that story, I'll confine my discussion of "script" to individual actions within that story. This process works well when you are working to create a demo reel, which can be made up of individual animation exercises as well as larger, more complex narratives. Although having no plan is bad enough, having a plan that is too general is arguably worse. One of my most difficult tasks in guiding animation students is paring down their ideas to manageable levels. Their troubles begin when they present me with ideas such as the following: • "I want my character to fight." • "I want my character to show emotions." • "I want to do a single skin character." Why? "Because it's a test of my modeling skills." • And my all-time favorite: "I want to create a realistic character." And these are only a few. These goals, while noble, are much too general. Hidden in these simple statements are vast amounts of work that can rapidly overwhelm an individual. For example, the "I want my character to fight" story idea lacks some important descriptive work. Unless the character is going to shadow box, the animator will need to model, texture, and rig another character. So the animator has to do twice the work. Next is the question of what type of fighting the characters will use. Will it be American-style boxing, karate-do, wushu, or drunken monkey style kung fu? Will it be kicks, punches, throws, or grappling? Every animator has some desire to create Matrix-style, "wall-walking" fight scenes, but many fail to realize that each move within those fight scenes is extremely well thought out and choreographed. In animation, you may need to build and rig the character in several specific ways to accommodate those actions. The cure for such over-generalization is a detailed description of every action. Therefore, an acceptable beginning for each of these ideas in the earlier list would go something like this: • "My character will be required to throw high, low, and middle-height snap and roundhouse kicks at targets to the front, the side, and the back. He will also need to punch and block with fists, open hands, and elbows." • "My character will need to happily say the phrase 'the rain in Spain falls mainly in the plane' while winking leeringly off camera and sneaking cautiously off stage." • "My character is a superhero in a red, skin-tight body suit. He will wear skin-tight yellow gloves that rise to mid-forearm and shoes that rise his shin. He will wear tight blue Speedo-style shorts and have a big blue T emblazoned on his chest. His body suit will extend all over his head Spiderman style with only cutouts for eyes. He will need to run, jump, fly, kick, and punch." • "I want my character to appear naturalistic enough to engage the audience. I will concentrate on making her eyes, face, and hair convincing so as to be better able to convince the audience of the emotions she will have to display."

5

6

C H A P T E R 1 • Accelerating the Preproduction Process

Although these statements are substantial improvements over the first set of ideas, these statements are only the beginnings of practical concepts. The next step is to describe in detail what the character will actually do within the context of the story. You need to plan each gesture, action, and expression before you begin modeling. By describing each action in meticulous detail, you'll get a good feel for exactly what you will need to animate, and unrealistic expectations will evaporate under the hot light of thorough examination. Concurrently with writing the story for the character, you must draw constantly. Visualizing both the appearance of the character and the performance that character will give is essential to completing a successful animation. At this point, the type of preproduction depends on your individual skills. If you are a strong draftsperson, you should spend more time drawing than writing; if you're a weak draftsperson, you can spend more time writing if you are more comfortable doing so. These drawings need not be highly detailed. In fact, you can indicate motions with simple, not-much-more-than-stick figures drawn rapidly (see Figure 1.1). The quantity of drawings is what is important at this stage; drawing the character accurately is a secondary consideration. Furthermore, you need to fully describe each motion in the script. A kick should have at least four drawings: a ready pose, a raised leg pose, a fully extended kick pose, and a recovery pose (see Figure 1.2). Keep in mind that these drawings help when you begin animating. But wait! We haven't decided what the character even looks like, so how can we decide what it will do? This vagueness is intentional because when possible, the final design of your character is determined by what you, the animator, plan to do with it. Remember that every facet of the animation serves the story you plan to tell, and you relate that story primarily through the actions of the character. Naturally the appearance of that character is secondary to the story itself. For example, it is counterproductive to expect that an obese character can bend over, touch its toes, and vault into a forward flip (this is not impossible, but the modeling and rigging chores would be a technical director's time-consuming nightmare!). If Figure 1.1: Some gesture drawings of rapidly drawn figures your goal is to create a believable performance, the

Figure 1.2: Motion drawings of a kick

Modeling Methods 7

model/character should help to achieve that goal. Conversely, you might already have a character pre-built or preconceived. In such cases, it is up to you to find appropriate actions for that character. Furthermore, animators working in an effects company may have this decision taken out of their hands entirely because they have to animate someone else's character; the animator then has no choice but to work with what they are given. My point is that animators should do everything possible to enhance their ability to create a believable performance, and to the extent the animator has control, the design of the character should not make that goal more difficult. Drawing is the beginning of modeling, so the beginning of modeling doesn't happen in Maya, but on paper. Here, there is no substitute for drawing ability. Having determined what your character can do, draw the character. If you are not proficient in drawing, you will have to either muddle through or hire someone who is proficient. Ideally, the final product of this phase is a fully posed "character" drawing that reveals the personality of the model (see Figure 1.3). You use this drawing as reference/inspiration later when animating. More important, you need to produce a front and side schematic drawing of the character. The details of these drawings should match in both views. Graph paper is useful for lining up details (see Figure 1.4).

Figure 1.3: A character drawing

Figure 1.4: A schematic drawing of a figure

8

C H A P T E R 1 • Accelerating the Preproduction Process

Modeling Methods Whereas scripting, thumbnailing, and drawing provide the conceptual basis for your work, the model provides the visual expression of your vision. Producing the model and rigging it for animation are the most time-consuming and laborious phases of any animation. You must carefully choose the method you use to create your characters: this choice has dramatic implications later in terms of setup, animation, texturing, and rendering. The mistaken tendency of most people is to believe that modeling options are simply divided between polygons and NURBS surfaces. This is a harmful oversimplification, especially given the advent of Subdivision surfaces available with Maya Unlimited. Rather, a more useful discussion centers around the degree to which a character breaks down into separate objects. Single skin vs. separate objects becomes the real question, and it is a visual rather than a technical problem. The great mistake that many beginning independent animators make is trying to force the idea of animating a "single skin" character. They tend not to realize that few, if any, characters that they see either on TV or in movies are all one piece of geometry. Most, if not all, are segmented geometry; the seams are cleverly hidden by another piece of geometry or by the border between textures. This isn't noticeable because the character's geometry is so well animated that we are convinced of the gestalt of the character. We don't see him, her, or it as separate pieces; we see the character Woody, Buzz, Shrek, or Aki. Thus, the central point in modeling for animation is that a well-animated piece of geometry always transcends the modeling method used to create it. Consequently, you want to use the simplest modeling method necessary to create a character to animate. Four basic modeling methods are available in Maya: • • • •

NURBS patches Trimmed and blended NURBs objects Polygons SubDivision surfaces

Each of these methods has its own advantages and disadvantages when modeling characters for animation.

NURBS Patches Using NURBS (Non-Uniform Rational B-Spline) is the classic way to model organic shapes in Maya. NURBS consist of four-sided patches that are often perplexing to artists who are new to Maya. At present, you cannot directly manipulate a NURBS surface; modeling occurs when you manipulate hulls and control vertices (CVs). Manipulating patches requires that you pay careful attention to surface UV parameterization. Edge and global stitching ostensibly ensure smooth joins between patches; unfortunately, keeping edges joined through animation can be difficult. Also, without a 3D paint program (such as Deep Paint), texturing NURBS with complex image maps can be problematic. Nevertheless, NURBS surfaces are efficient; so they animate quickly; and properly built, they provide a highly organized surface that you can easily convert to polygons.

Trimmed and Blended NURBS Objects Trims and blends are part of the classic Maya character-modeling paradigm. Maya uses curves projected on a NURBS surface to determine areas that are hidden from view. These

Modeling Methods

hidden areas are called trims. You can connect these holes relatively smoothly to other objects with blends. Blends are pieces of geometry that are interactively generated between two curves or isoparms. As each curve moves, the blend follows. Resembling lofts, these curves also maintain a certain amount of tangency with their generating surfaces. Because there are fewer surfaces overall, trimmed and blended surfaces are generally easier to texture map. Unfortunately, when activated, they slow animation unacceptably and are unusable for interactive performance.

Using Trims and Blends Using the Set Driven Key command, you can interactively block the evaluation of the NodeState attributes of trims and blends. Setting the NodeState attribute of the ffFilletSrfn node to Blocking and the NodeState attribute of the Trimw node to HasNoEffect, you can use trims and blends in character animation on a limited basis. I usually use this technique to connect the eyelids to a NURBS modeled face. Here are the steps: 1. Select the blends, and then open the Attribute Editor. 2. Click the FfFilletSrfr? tab, and then click the Select button. 3. ChooseWindows GeneralControls attribute in the Channel box.

ChannelControl,anddisplaythisnode'sNodeState

You can now set the NodeState attribute to Blocking. By connecting the NodeState attribute to a custom integer attribute on one of your animation controls using Set Driven Key, you can control the display of all your blends at once. You can do the same for your trims by selecting the trimmed object, clicking the Trlrrm tab, loading that into the Channel box. and displaying the trim's NodeState attribute. However this time, set the NodeState attribute to Has No Effect, which basically turns off its evaluation, thus speeding up the interactive performance of your animation controls.

Polygons Polygon models are the oldest form of 3D surface, and most renderers (Maya's included) tessellate NURBS surfaces into polygons at render time. For a short time, polygon models fell out of favor with character animators because of their flat, faceted nature, but with the advent of SubDivision surfaces, polygonal modeling techniques are becoming more popular. Polygons are 3-, 4-, or n-sided shapes described by vertex position data. Connected, they form polygonal objects that can be shaded, textured, lit, and rendered. Polygonal modeling paradigms most closely resemble conventional sculpture, with figures being roughed out in low polygon mode and smoothed toward the completion of modeling. In Maya 3 and later, the polygon manipulation tools and animation performance have improved dramatically. Texture mapping polygon characters requires that you create UV maps and can rapidly become a tedious chore, but with skill, texture maps can make an otherwise unacceptably low polygon model into a visually interesting subject.

SubDivision Surfaces These exciting polygonally derived surfaces are the newest type of modeling paradigm. They offer the animation advantages of low polygon surfaces combined with the smoothness of highly tessellated NURBS surfaces, thus combining the ease of use of polygons with the

9

10

C H A P T E R 1 • Accelerating the Preproduction Process

Figure J.5: A flour sack modeled using each method. From left to right: SubDivision surfaces, NURBS patches, polygons, and NURBS trims and blends. organic quality of NURBS surfaces. They are expensive in terms of memory usage, but given the drop in the price of memory, this is no longer a problem. However, SubDivision surfaces are currently available only with Maya Unlimited (requiring a significantly greater expense than Maya Complete), and they are currently incompatible with Fur and Paint effects. Figure 1.5 shows a flour sack that was modeled using each of the modeling methods.

Using NURBS to Model In my animation classes, one of the first exercises we do involves animating flour sacks that jump, walk, and interact with a ball. In past courses, we have used polygon and NURBS types of flour sacks; currently we use NURBs. We use a flour sack because it is simpler to animate than a biped yet more complex than a beach ball. Of course, before modeling, I tried to think about what the flour sack might have to do. I had to model for a variety of motions because the final project for the unit is to come up with a ball/flour sack interaction. Consequently, my students need a wide latitude of motion to the sack. Figure 1.6 shows some of the preparatory drawings I used in planning for these motions. Building a flour sack is a useful first step in building a more complex character, because you can apply many of the modeling techniques to just about any character. In this instance, we stitch "hands" and "feet" onto our flour sack. I use NURBS patches for a number of reasons. First, from this finished model, you can easily tessellate the model into a polygonal model of varying detail. Merging vertices results in a single polygonal mesh. Or, you can also bind the model directly to a skeleton. Modeling with patches gives us many advantages, such as interactively tangent blends; Figure 1.6: Character sketches of the flour sack

Modeling Methods

11

instant, controllable smoothing; and surface attachability and detachability. Using the file floursackdismembered . m a on the CD, let's begin. One problem with patches is aligning the surfaces properly so that they join as smoothly as possible. Stitching edges and global stitching help a lot, but that won't make a perfectly aligned "silk purse" out of these completely incongruous "sows' ears" that we have now. I use the following method: 1. Replace end caps 2. Fillet blend between patch isoparms 3. Delete history on fillets 4. Rebuild fillets geometry 5. Attach fillet geometry to appendage patches 6. Global stitch In the steps in the following section, I start from the hotbox whenever I choose a menu command. Also, because you'll want to see the wireframe while working, choose Shading Shade Options Wireframe on Shaded if it is not already visible. The steps in the following sections assume some knowledge of NURBS modeling. Although we will model the flour sack in this case, these techniques apply to creating any patch model.

I created f l o u r s a c k d i s m e m b e r e d . m a by massaging NURBS spheres into shape for the body, the "hands," and the "feet." Figure 1.7 shows the settings I use when rebuilding after detaching surfaces. I detach and rebuild immediately, because it is sometimes easy to lose track when working with a patch model. All these surfaces have been rebuilt/reparameterized and are ready for action. Replace the End Caps

The top and the bottom of this flour sack have four patches that meet at the center. I prefer to work with one patch rather than four because it is easier to stitch and texture map. Therefore, I plan to create a single patch using the boundary tool. Here are the steps: 1. RMB each patch, and select isoparm at the base of each triangular patch as shown in the image on the left in Figurel.8. 2. Choose Edit Curves Duplicate Surface Curves to create the four curves we will use to form our patch. Because we create them from these existing patches, they touch at

Figure 1.7: The Rebuild Surface Options dialog box

Figure 1.8: The three-stage process for replacing the end cap using the Boundary tool

12

C H A P T E R 1 • Accelerating the Preproduction Process

their end points and are ready to have the Boundary Surfaces tool applied to them to create our patch. 3. Delete the triangular end patches, as shown in the center image in Figure 1.8. 4. Shift+select the curves in clockwise order, and choose Surfaces Boundary In the option box, go to the Edit menu, reset settings, and click the Boundary button. Press the 3 key to smooth the display of the object, and you should have what is depicted in the image on the right in Figure 1.8. Deselect Surfaces in the Select by Object Type button bar, and marquee select to select the curves and delete them. Now replace the end caps for the other side. 5. Save your work. Although these surfaces are flat now, they will blend in with the rest of the flour sack nicely when we stitch them later. Fillet Blend Between Patch lsoparms The next step is to fillet blend between geometries to create geometry that smoothly transitions between the hands, feet, and body. This is much easier than lofting, pushing, and pulling points into place. Here are the steps: 1. RMB-Isoparm one of the patches on the hand and a facing patch on the body. Shift+select the closest isoparms on each patch, as shown in image A in Figure 1.9. 2. Choose Edit NURBS Surface Fillet Freeform Fillet to display the options in image B in Figure 1.9. Click Fillet to see the result. 3. Go around the hand and create a blend for each patch, as shown in images C, D, and E in Figure 1.9. Don't be alarmed when the isoparms don't match; we'll rebuild them to match the hand patches shortly. 4. Now do the other hand and the feet the same way. We could have lofted between these isoparms, but blending allows us to adjust the CVs in the hand patches while the blends, by their interactive nature, adjust tangency to match. The X-ray image in Figure 1.10 illustrates this.

Figure 1.9: Blending the hand to the body

Modeling Methods

13

Figure 1.10: Editing CVs while the blends automatically remain tangent There is an ugly bend in the blend resulting from misaligned CVs in the bottom patch. To fix that, I grabbed the second to the last hull on the bottom hand patch as well as the last two CVs on the same hull on the adjacent patches (this makes sure that we don't pull our hand patches out of alignment) and pulled it out along the X and Y axes; the blend matched tangency. Delete History on Fillets These blends follow the shape of the hand and foot patches because they have a construction history and are fillet blends. Deleting History removes the construction history and makes these blends static geometry. Select the blends, and choose Edit Delete by Type History. Rebuild Fillet Geometry Now the blends are regular geometry, but their parameterization is wacky. The Attribute readings for them will look something like the upper image in Figure 1.11. This is a good example because we want the Spans for UV to be equal to match all the blend patches around the hand. If you need extra spans running around the hand, rebuild with three or more spans in that direction. 1.Choose Edit NURBS Rebuild Surface clear the NumSpans check box, enter 2 in the Number of Spans U field, and then enter 2 in the Number of Spans V fields. Click the Rebuild button, and you will see that the U and V spans are much more in line with what we want, as shown in the lower image in Figure 1.11. 2. Repeat this procedure for each blend. Select all blends at once and rebuild corporatelyto speed things up considerably.

Figure 1.11: Upper image: Fillet blend with Chord length parameterization. Lower image: Blend with parameterization that matches surrounding patches. Rebuild the blends after deleting history.

14

C H A P T E R 1 • Accelerating the Preproduction Process

Attach Fillet Geometry to Appendage Patches Now that our blends are rebuilt, we need to attach them to their respective hand patches. Follow these steps: 1. Select the hand patch, Shift+select the blend, and choose Edit NURBS Attach Surfaces Clear the Keep Originals check box if it is currently checked. The upper image in Figure 1.12 shows the two patches before applying the Attach Surfaces command, and the lower image shows the two patches afterward. Figure 1.12 also shows the settings used to attach the patches. 2. Repeat Step 1 for all the hand and foot patches. 3. Select all the patches, and choose Edit Delete by Type History. The four patches that now compose each hand and foot are close to tangent with the body patches and close to tangency with each other. We are now ready for the final step: Global Stitch. Figure 1.12: Attach surfaces before and after applying the Attach Surfaces command lf the hands and feet patches are way out of alignment, you should go back and attach the hand and foot patches laterallywith Attach method blend and no inserted knots to make one surface for each hand or foot. Close the surface, and then detach the patches along the original seams to ensure smoothness around the hands and feet.

Global Stitch Global stitching allows you to join patches together seamlessly over an entire character or object. Follow these steps: 1. To see Global Stitch in action, it is best to deactivate Wireframe on Shaded. Choose Shading Wireframe on Shaded. 2. Now, after you delete history on all the patches, select all the patches and choose Edit NURBS Stitch Global Stitch This step is tricky, but well worth the time to get right. Global stitching is cool. Not only does it automatically align all the patches, it is also easy to adjust because it is a single node applied to all the patches. Figure 1.13 shows the option window with the appropriate settings. By adjusting Stitch Smoothness, Max Separation, and Modification Resistance, you can create a smoothsurfaced sack. The big question is, do you select Normals or Tangents? Tangents will do everything possible to try to smooth between patches, even if it misaligns isoparms and CVs. If you can make Tangents work, select Tangents. Normals smooths the surface, but not as well. So let's set Stitch Smoothness to Tangents and click the Global Stitch button.

Modeling Methods

15

3. Deselect all the patches. Ugh! It looks as if the top of the sack is curdled! We need to fix this. 4. Select a patch as shown in the image on the left in Figure 1.14, and click globalStitch1 in the INPUTS section in the Channel box. You can adjust these settings to change the entire sack, which is convenient. 5. Click the Modification Resistance attribute name in the Channel box, and MM click, hold, and drag back and forth in the modeling window to adjust the attribute's value. Hold down the Ctrl key to increase the "fineness" of the adjustment if necessary You want this number to be as low as possible and still get a smooth stitch because this number controls the amount of Figure 1.13: The proper GlobalStitch settings resistance the CVs show to the global stitch. Global Stitch is a powerful, but stupid process. When Stitch Smooth is set on Tangents, it moves CVs wherever it wants to set up its version of what a smooth stitch requires, even if the surface buckles unusably. After setting the Modification Resistance attribute to a setting that gives us the smooth surface you want, you're done. 6. As a last step, select all the patches, and choose Edit Delete by Type History.

Figure 1.14: Before and after adjusting Modification Resistance values

=

16

C H A P T E R 1 • Accelerating the Preproduction Process

Patches are too far apart lf the patches start too far apart, there can be major problems as it appears that Mayaw!ll attempt to join not only the separate surfaces but also join and align CVs that are on the same patch if they are within the Max Separation distance of the stitch. It is best to start with patches that touch or are very close and that are already aligned. Accomplish this by edge stitching first and then deleting history. Misparameterized surfaces Trying to join surfaces that don't have the same number of U spans and/or V spans can be problematic. Make sure that all surface isoparms match both numerically and visually. Surface discontinuities The image in the upper left in the following graphic shows a surface discontinuitywhere five patches meet. Correcting this involves individually shift-marquee selecting the five corner and five pairs of tangency points where the patches meet (you want to make sure you get the multiple points, as shown in the image in the upper right). Shift+select the five points in between, as shown in the image in the lower left. Now, run ElieJamaa's fine Planarize plug-in (available on the accompanying CD-ROM). That should fix the problem, and the image will appear like that in the lower right of the following graphic. For those pesky, hard-to-adjust discontinuities that resist automated fixes, double-click the Translate/Move tool and select Normal mode. In this mode, you can push and pull CVs in the U and V directions. You can also drag them outward along the surface normal. Using Normal mode is the best way to align CVs manually. Pull the CVs perpendicular to the seam to align the patches. Work with CVs and Hull visible for best results.

Once you correct any problems and have a smooth sack, you are ready for the next step, texturing.

Texturing a Flour Sack You need to keep textures as simple as possible. Different modeling topologies make this task simple or difficult depending on what was used and how the character should look. In our flour sack example, a simple burlap texture scanned into the computer and made seamless in Photoshop is the best bet. (See b u r l a p s q . t i f on the CD). Connected to the bump channel in the Hypershade window, this texture can also serve as a bump map. Applied to all the patches of the sack, it appears seamless. The only problem is that the ears and hands patches, because they are so long and thin, can cause the texture map to stretch. However, for simple animation exercises in which the focus is on demonstrating the individual's animation skill, small texture imperfections should be no problem. Figure 1.16 shows the difference between a NURBS flour sack (on the left) and a medium resolution polygonal

Texturing a Flour Sack

Figure 1.16: Left image: A NURBS flour sack textured by using built in UVs. Right image: A medium resolution polygon flour sack textured with burlap applied with custom UV maps.

flour sack textured with the same burlap texture mapped with a custom UV map (on the right). Speeding the texture-mapping step is one of the biggest benefits of proper planning prior to modeling. When you predefine the overall look of the animation, texture mapping becomes easier. Achieving good textures on your subject is difficult enough without trying to define them while you work on the technical part of mapping. Every aspect of Maya gives you an enormous number of choices; it is extremely easy to get lost in the many ways of creating textures. If for no other reason than this, starting this process with a clear idea of what you want and learning how to obtain it is crucial. It is also important to keep a consistent textural style throughout an animation. If a character is textured naturalistically, it becomes the standard by which the rest of the textures in the piece are judged. Much like a drawing in which one part is worked to a high finish, the polished main character will look incongruous with the backgrounds if the rest of the textures are haphazardly thrown into the piece. Although it is entirely possible to play complex textures off simple textures to great effect, such contrasts do not often happen by accident. A consistent level of thought makes such composition devices work in an animation. NURBS surfaces and polygons require different methods of texture mapping. Each NURBS surface, whether a separate shape or a patch, has an implicit U and V direction and is square in shape. All textures applied to NURBS surfaces stretch to fit that shape. Although

17

18

C H A P T E R 1 • Accelerating the Preproduction Process

this feature makes NURBS shapes easy to map, it makes multiple patches difficult to map consistently over the entire surface of your model. For all practical purposes, mapping multipatch models with images fitting across their surfaces requires a 3D paint program specifically designed for that purpose. As such, texturing such surfaces is beyond the purview of this chapter. Polygons provide a much better example that can be textured from within Maya (and Photoshop, of course). Now let's convert the NURBS surfaces to a polygonal mesh. Follow these steps: 1. Converting the NURBS sack to polygons is simply a matter of using Modify Convert NURBS to Polys using Quads, General Tesselation Method, and a setting of 1 for the U and V direction under Per Span # of Iso Params. 2. Click Tesselate to create a polygon flour sack. 3. Choose Edit Delete by Type History. 4. In the UV Texture Editor window, delete the UVs that were brought over from the NURBS to polygon conversion and remap with your own map. I prepared two files that contain UV maps for this polygonal flour s a c k . S a c k U V o n e . m a and s a c k U V t w o . m a (available on the CD) present two different methods for arranging the UVs for this sack. I created them by planar projecting the front and back polygons from the front camera view. I flipped the back UVs, moved them beside the front UVs, and moved them both out of the way in preparation for the next group of polygons to be mapped. I projected the top and side polygons in the same way. I created the UV map for the hands and feet polygons using automatic mapping, and I sewed them together to create the maps found in the files. These two UV maps differ only in the way the polygons are sewn together to create the fabric of the sack. When creating UV maps, be sure that adjoining edges are the same size. They are the same edge, but they exist at two different coordinates in the flat UV map. If one edge is longer than the other, there will be an irreconcilable seam where the two disparate edges meet in the model, as shown in Figure 1.17.

Setting Up for Animation

Think about where these seams should line up. This flour sack will be made of some kind of cloth or paper (in this case, burlap), so it will be tremendously advantageous to think of these patches as patches of cloth that will be sewn together and then filled with flour. Letting that thought guide me, I created s a c k U V t w o . m a and used it to create the textures. I select the flour sack, open the UVTexture Editor window, and choose Polygon UV Snapshot. Now I can export the image in the texture window as an image to import into Photoshop. I recommend a size of 1024 on U and V. Turn off anti-aliasing, and make the line color white. I recommend Targa or Maya iff for the export; Targa works in Photoshop with no extra plug-ins. Figure 1.18 shows my Photoshop environment. I floated the lines from the UV snapshot by painting the alpha channel in white onto a transparent layer. I then lassoed a section of burlap and dragged it into a layer sandwiched between the white line layer and the background. As I complete each piece of burlap, I merge it down onto the background. I use Photoshop's Rubberstamp tool to remove any seams where I have pasted two pieces of burlap that don't quite match naturally. I allow the texture to overlap the edge of the UV patch because I will almost surely have to tweak the poly UVs after I apply the texture and smooth the polygons. Figure 1.18: The Photoshop environment I have included a flat burlap square seamless texture on the CD ( b u r 1 a p s q . t g a ) . I created it by scanning a piece of burlap and making it seamless using Photoshop's Clone tool. I have also included the b u r l a p c U V . t g a file that is the finished UV mapped color texture created earlier in this chapter. It applies seamlessly to the sack in s a c k U V t w o . m a . From this file, you can derive a bump map by either connecting it to the bump channel in the Hypershade window or editing it in Photoshop to create a more custom look. I also included a file called C o l o r M a p . t g a , which corresponds to the map in s a c k U V o n e . m a . Use it as a guide to mapping that file. With texturing done, it is time to move to setup. However, it isn't necessary to wait until texturing is complete to move on. If you want to, you can set up the original and create a UV map of a duplicate copy. Then, when finished, you can choose Polygon Transfer to copy the UV map to the setup original.

Setting Up for Animation I suspect that many animation projects are "rotting" on hard disks everywhere. I further believe that these projects are hung up at the setup stage because of the dizzying array of options that 3D programs such as Maya offer to the technical director: Smooth vs. Rigid skinning, Direct vs. Indirect skinning, Lattice vs. Cluster deformations, and Forward vs. Inverse kinematics are just a few of the many setup techniques available. What's that you say? You are an animator! That may be true, but technical directors (TDs) usually handle character setup, lf you are doing all the work for your production, congratulations! You are now a TD!

19

20 C H A P T E R 1 • Accelerating the Preproduction Process

Figure 1.19: These ballpoint pen sketches are only a little more involved than the gestural sketches from earlier in the chapter, yet they provide good examples of the extreme poses this character will need.

Setup is arguably the longest phase of the animation process (prior to actually animating). You can take a number of steps to shorten this process, but ideally the person doing the setup needs to know what the character is going to do. Given the fluid nature of the animation process, this ideal is impossible to fully achieve, but because a good setup speeds the rest of your work, it is more than worth putting effort into the front end of the process. Specifically, drawings or other indications of what the character must do that include the most extreme poses give the best indication of what the TD will need to set up. Figures 1.19 and 1.20 are examples of these types of drawings. In a professional production pipeline, story, character design, and concept changes during the production process make absolute definition of what the character must do impossible; so the character TDs must set up for a wide latitude of motions. The TD, however, is responsible for the process from beginning to end, so having complete knowledge of what the character must do is indeed possible. That said, three principles can speed the setup process, and anyone interested in "going it alone" and producing an animated short themselves or anyone setting up a character for someone else would do well to be familiar with them. As with anything associated with animation in general, or Maya in specific, these principles are general concepts and can be implemented as needed.

Have a Plan and Stick To It Have a method of attacking setup and follow it carefully. Adding or changing methods midway through the process is frustrating, and frustration is lethal to the animation process. Resist the urge to believe that the setup grass is greener and use another method that requires you to start from scratch or from many steps backward. Each method or technique has its own set of features and difficulties that materialize at different times in the setup process. Giving in to self-doubt leads down a path of frustration. Conventional wisdom says that different skinning methods are good for different types of characters. Some say that smooth skinning works for single-skin polygonal characters and that rigid binding works for some other types; but I would like to suggest that skinning is more a matter of personal skills and temperament than intrinsic value. If a person is a great digital painter and has a great deal of patience with painting, using smooth skinning is a good way to set up just about anything, be it NURBS or polys. Similarly, if the TD understands set membership and lattice deforming as a way to correct joint influence problems, rigid binding can work wonders with polys or NURBS. A good modeler might choose blendshapes for facial animation and muscle deformation, while the more technically bent might choose to animate the face with joints and/or clusters controlled with a set driven key technique. Advantages and disadvantages are associated with every setup method; there is no silver bullet.

Setting Up for Animation

21

Figure 1.20: These drawings also show extreme poses, but with the added dimension of form. I scanned some ballpoint pen gestural thumbnail sketches into the computer at a high resolution, resized them, and printed them lightly on toned paper. I then reworked them with white and black colored pencil and outlined them in black ink. The idea behind this method is to add the illusion of form and volume without losing the gestural quality of the sketch.

Set Up Only What You Need to Carry the Story This should seem obvious, but judging from the questions I see on many listservers I monitor, many artists try to include too much in their rigs. In the setup phase, re-evaluate what you need your character to do. Do all the fingers really need to bend and curl independently, or can they all be bent with one control? (See Figure 1.21.) Are muscle bulges really necessary to move the story forward? Does your character need to deform so that it looks like it is breathing? Having a clear idea of what your character needs to be able to do is the best setup tool. If the purpose of your animation is to show off your ability to create an effective rig, by all means, put in as many controls as you have time for. You are in effect stating that your ability to rig is the story you want to tell. Use all the bells and whistles to create as many features as you desire; you will be furthering the story by doing so. If animation is your focus, rigging unnecessary features that no one will ever see wastes time that could be spent enhancing your animation. Because the thrust of this chapter is preparation for

Figure 1.21: Why make the fingers able to bend individually when all you will need for your animation is a single bend control? Which do you think will be easier to animate?

22

C H A P T E R 1 • Accelerating the Preproduction Process

character animation, I want to stay focused on simpler control, which brings us to our next principle.

Set Up for Speed of Animation, Not for Character Features The need for speed is inherent in animation setup. The faster everything moves, the more you can concentrate on animation; everyone knows that. But also, the faster you can select and move the animation controls, the faster animation can actually happen. After you decide which controls and features you need to set up to help tell the story, you need to make sure that these controls and features are easily accessible, movable, and keyable. The first step is deciding what needs to be automated and what the animator (you) must be able to control. You should never see some features, such as modifications that keep the mesh from collapsing during joint rotation. Some features may enhance the appearance of the model as it is animated, but they are so small that the audience will not notice them unless the camera focuses on that part of the character. You can automate other controls, but the animator should really control them. Knowing which is which is essential.

Do Not Let "Perfect" Be the Enemy of "Good Enough" Animators often spend enormous amounts of time tweaking the setup by tuning each vertex or CV in the Component Editor, polishing controls, creating clusters for every little muscle twitch, and generally worrying over every possible problem that could arise. They spend so much time that the animation phase suffers, and the entire animation winds up being less than it should be. The counter to this and many other problems is to remember that even as a wellanimated piece of geometry will transcend the modeling and imaging methods used to model and texture it, so will strong, convincing animation transcend any setup imperfections. A good performance trumps distorted models every time. Therefore, the TD/animator should set a time limit on setup, begin with the overall features such as skin weighting and IK controls, work outward to finger bends and facial features, and finish with details such as muscle flexing if time permits.

Creating an Arm Now let's put some of these principles in action using a well-muscled human arm. We'll work first on the wrist. I use a system of NURBS boxes (created with C o n t r o l B o x . m e l on the CD and shaped by translating CVs) as controllers for the body bones (using FK), arms and legs (using IK), facial expressions (using SDK—set driven key—blendshapes), and fingers (using SDK). I find that using point constraints for the arm IK combined with an orient constraint for the wrist bone allows the hands to stay locked in place when the body moves. The problem is that connecting the elbow to the wrist directly causes the mesh around the wrist to collapse when the wrist rotates around the X axis too far. Correcting this deformation is difficult; weight painting can only take you so far. An elbow, ulna, and wrist arrangement provides a way to transfer the x-rotations of the wrist to the short ulna providing a way for a lattice to correct the collapsing forearm while allowing the wrist to rotate freely in the Y and Z axes. What we'll do is bind the lattice to the elbow and ulna while constraining the rotation of the wrist to the Wrist control box.

Creating an Arm

The steps In the following section assume that you know how to use Smooth Bind and paint weights to create relatively smooth joint deformations.

Finish Setting Up the Arm Bones Open A r m S e t u p S t a r t . m a on the CD, and you will see the skeleton created by snapping the joint placement to a high-resolution grid. All the joints are perpendicularly placed. The CSpine joint is a fork-shaped bone that is actually in line with the rib cage joint, but it has a spur that connects to the collar. The shoulder has a spur that connects to the deltoid joint. This spur bone provides a clusterlike control for that large mass of geometry corresponding to the deltoid muscle (see Figure 1.22). We'll paint these weights to assign these vertexes to the joint. To correct a collapsing wrist mesh, follow these steps: 1. From the top view, rotate and scale (do not translate) the shoulder and elbow joints into position. This keeps the axes pointed in the right direction. Really, that is the key to joint placement: it isn't important for any particular axis to point down the bone, but we don't want our axes to get out of alignment. Rotating and scaling joints into position prevents that from happening. We will still have to adjust some of our local rotation axes before we can constrain our joints to the NURBS control boxes anyway.

Figure 1.22: The deltoid muscle CVs selected

23

24

C H A P T E R 1 • Accelerating the Preproduction Process

Figure 1.23: Adjusting the local rotation of the Cspine joint 2. Select the root joint, in this case the rib cage bone, and type select -hi at the command line. (You will want to make a shelf button out of this command by drag selecting it and MM dragging it to the shelf.) This selects the entire hierarchy of joints. 3. Choose Skeleton Set Preferred Angle to set the bones in their proper place; this will be the angle that Maya's IK solver starts to solve from. More important, it sets the plane described by the placement of the shoulder, elbow, and ulna bones in place, providing a direction for the Pole Vector to point. 4. Select the Shoulder control box and the CSpine joint (in that order), and go to Component Selection mode. 5. RM the Question Mark button, and display the local rotation axes. Select the axis for the CSpine joint and rotate it to match the Shoulder control box, as shown in Figure 1.23. To be as accurate as possible, work from the front view and increase the size of the manipulator by pressing the plus (+) key. (Pressing the minus (-) key decreases it.) 6. Press F8 to switch into Select by Object Type mode, and then choose Constrain Orient to constrain the CSpine joint to the control box. Now it will rotate with the Shoulder box. We can do this immediately because we originally selected the box and then selected the joint to be constrained. 7. Snap the HandControl box to the wrist joint by selecting the HandControl box, holding down the v key, and moving the box to the wrist joint. It should snap to the wrist. 8. Freeze transformations on the box, and adjust the local rotation axis of the wrist to match the box. We freeze the transformations on the control boxes so that we can zero out any transformations and return the skeleton to the bind pose. 9. Click the HandControl box. Shift-select the wrist joint, and orient constrain the wrist to the HandControl box. 10. With only the wrist joint selected, open the Attribute Editor and clear the X axis check box under Joint: Degrees of Freedom to lock it in place. 11. With the Attribute Editor still open, select the ulna and check the Y- and Z-axes check boxes under Joint: Degrees of Freedom to lock them into place.

Creating an Arm

25

12. In the Channel box, right-click the Rotate X attribute to open the Expression Editor. We could use the Connection Editor, but because we would have to use an expression for the right hand if we were setting it up anyway, doing it for this side gives us symmetry, which is clearer. 13. In the Expression Editor, type U 1 n a . r o t a t e X = H a n d C o n t r o l . r o t a t e X * l . For the right side, multiply H a n d C o n t r o l . r o t a t e X by -1 to make the hand rotate correctly. The HandControl now rotates the wrist joint in Y and Z while the Ulna rotates in X. Because we used an orient constraint to control the wrist, it maintains its orientation no matter how the upper arm moves.

Create the Arm IK To create the IK and Point constrain it to the HandControl, follow these steps: 1. Using the Rotate Plane IK (ikRP)solver tool (available in the IK Handle Tool option window), select the shoulder first, and then select the ulna to generate the IK handle. (Notice how the Pole Vector points straight out the back of the shoulder. We'll use this later.) 2. Choose Window Hypergraph, and select the effector that is connected to the shoulder joint. This is quite different from the IK handle itself. The effector is usually hidden when you are working, but we will need to move its pivot point and snap it to the wrist. 3. With the effector itself selected, press the Insert key, press and hold down the v key, and then move the effector to the wrist. Notice that the IK handle moves with it; this is good because we are going to constrain the handle to the HandControl box with Constrain Point. Point constrain the handle to the HandControl box. Press the Insert key again to jump back to editing the object. If you have to, press and hold down the v key and snap the HandControl box to the wrist joint (and the IK handle) and freeze transformations. 4. Shift+select the IK handle, and choose Constrain Point to lock the IK to the HandControl box. 5. Select the ElbowPointer control box, Shift+select the IK handle, and choose Constrain Pole Vector. Now you can rotate the plane of the IK solver by moving the ElbowPointer control box. More important, moving the Pole Vector constraint fights the flipping of the IK plane that occurs when the IK handle moves past the base of the IK chain. 6. Move the ElbowPointer box directly behind the shoulder joint, parent it to the Shoulder control, and freeze transformations. Keeping the pole vector constraint object directly behind the shoulder makes keeping the IK plane aligned with the arm much easier. Moving the ElbowPointer control box up and down moves the elbow independently of the shoulder and wrist (see figure 1.24).

Figure 1.24: The elbow now moves independently of the shoulder and wrist.

26

C H A P T E R 1 • Accelerating the Preproduction Process

Bind the Arm Now let's move on to binding. Many animators believe that binding should occur before constraining. However, I've found that if I need to make any drastic changes to the binding, disabling nodes, detaching, fixing, and going to bind pose resets all the local rotation axes, forcing me to manually reorient these axes. Also, because I'm using IK instead of FK, I want to weight using rotations coming from IK rather than FK; so I constrain before binding. Also at this point, I would delete the hand joint and create a hand, but because we're looking specifically at the forearm, we don't need to bother. Before binding, be sure that your geometry is clean—that it has no construction history other than blendshapes. Most important, be sure that you have removed any Polymeshsmooth nodes in your construction history. These nodes specifically prevent the successful removal of any points from the smoothskin cluster we are about to create. Failure to remove any Polymeshsmooth nodes causes the mesh to tear apart. It's always a good idea to start with clean, history-free geometry before binding. Now let's bind the geometry to the skeleton. Follow these steps: 1. Open the Outliner so that you can see selections as you make them. 2. Select the top joint in the hierarchy (the rib cage), and then select hierarchy (select -hi;). 3. Click and hold the Skeleton Layer in the Layer bar. Select Standard to allow you to select the skeleton. Untemplate the PolyArm layer, and then Shift+select the polygonal arm mesh. Choose Skin Bind Skin Smooth Bind Bind to Selected Joints. The other settings in the options box should be set to: Bind Method:Closest Joint; Max Influences :2 and Dropoff Rate:4.0.1 use Max Influence with a value of 2 because 1 find that limiting skin influence to two joints at binding time makes weighting more manageable later. Click Bind Skin to skin the mesh. Ninety percent of the time, I bind only selected joints to a particular mesh. For segmented characters (which are how most characters are modeled), it is important that those mesh objects be bound only to the necessary joints. This is faster and easier to weight than binding these meshes to the entire skeleton.

3. If you move the HandControl box, you will see that the mesh doesn't look too bad! We will need to fine-tune the shoulder and the elbow joint, but that is relatively easy to do. I like to set a key at an extreme pose for the wrist so that I can scrub through the timeline and see how the mesh deforms in motion. Another great timesaver is to use the Attribute Collection script (available on AliaslWavefront's website—www.aliaswavefront.com—or on www.highend3d.com) to create sliders to move the HandControl box while you are weighting. 4. Let's set a key at frame 1 and move the HandControl box to an arm bent position at frame 10 as shown in Figure 1.25. Copy the key from frame 1 and paste it at frame 20 to take the arm back to its bind pose. You can now paint weights on the shoulder and elbow joints. The elbow joint is fairly easy to tweak, but we are going to concentrate on the wrist. If you rotate the wrist in X, you can see that rotating the HandControl too far in X distorts the mesh badly. If you know absolutely that you will not need to twist the hand so far that the mesh collapses, you can skip the next section and move on to the biceps. Otherwise, let's correct that weight.

Creating an Arm

Figure 1.25: The arm is bent at frame 10.

Correcting the Wrist Any setup correction should require that the TD do the minimum necessary to fix the problem. If you can fix the distortion acceptably by painting weights, stop there. More than likely, however, you will need to add a lattice. Basically, you can fix the Y and Z rotations with painting. You will most likely find that even minimal wrist rotation on the X axis will cause the mesh to collapse; this cannot be fixed by painting. It's possible to spread out the deformations, but the mesh still collapses unacceptably. With a lattice, we can not only spread out the deformation, we can key the tweak node of the lattice to expand and negate or even reverse the tendency of the forearm to collapse. To create and weight the wrist lattice, follow these steps: Choose Edit Paint Selection Tool, and then paint a selection like that shown in Figure 1.26. Choose Deform Create Lattice and create a lattice with 7 divisions in S, 3 in T, and 3 in U, as Figure 1.27 shows. We have extended the selection just past the ulna. We now need to remove the points that are in the lattice from the overall skin cluster of the body. Choose Window Relationship Editor Deformer Sets, click the ffd set in the left window, choose Edit Select Set Members to select those points, click the SkinCluster set in the Relationship Editor window, and press the big minus button at the top of the window to

Figure 1.26: The forearm CV selection

27

28 C H A P T E R 1 • Accelerating the Preproduction Process

remove the selected points from that set. We do this to avoid double transformations once we bind the lattice to the elbow and ulna joints. 3. Shift+select the elbow and ulna joints, select the lattice itself, and choose Skin Bind Skin Smooth Bind. Rotate the HandControl -90 degrees in X, and you will see that the deformation, while better, is not perfect because Figure 1.27: Creating the forearm lattice the majority of the points are closer to the elbow joint. They are influenced too much by that joint. We have to adjust the weight of the lattice points themselves. The good news is that this is much easier to do than it sounds. Because we are only working in X, we can adjust all the points in each row at once with the same weight. 4. Turn off Curves, Joints, and Surfaces in the Set Object Selection Mask button bar. RM the lattice, choose Lattice Points, marquee select the row of lattice points closest to the ulna, and then choose Window General Editors Component Editor. Click the SkinClusterSet, and you can see that the influence on these points is split almost evenly between the elbow and the ulna. We need the influence for this row to be 1 for the ulna and 0 for the elbow. 5. Weight the rows so that they smoothly twist toward the back row, which should be weighted to 1 for the elbow joint. Notice that the mesh still shrinks, but it is smoother than it was. The last thing we will do to complete this process is to key the shape of the lattice itself to the X-axis rotation of the HandControl

Figure 1.28: Upper image: The wrist before lattice creation and rigging. Lower image: The wrist after connecting the tweak node of the lattice to the x-rotation of the wrist controller using set driven key.

Creating an Arm

by connecting the X, Y, and Z positions of the lattice points to the positive and negative xrotational values of the HandControl box. To connect the lattice points to the rotations of the HandControl box, follow these steps: 1. Reset the x-rotation on the HandController to 0. 2. Click the Rotate X attribute of the HandControl, and RM it to open the Set Driven Key window. Click Load Driver. 3. Right-click the lattice, select Lattice Points, and marquee select all the lattice points. Click Load Driven. 4. Drag select xValue, yValue, and zValue on the right side of the Driver window. Click rotateX value in the Driver window, and then click Key. 5. Rotate the HandControl box 100 degrees in X. We want to go past the highest x-rotational values we will use (usually 90 and -90). If the deformation looks good at that point, it should look good at all values leading up to it. 6. Scale, rotate, and translate the points of the lattice so that the forearm shape is pleasing. Key it in the SDK window, and rotate it back 100 degrees in the other direction. Adjust the points, key it, and you're done! You now have a forearm that allows for isolation on the hand and x-rotation without wrist collapse, as shown in Figure 1.28.

Create the Biceps Muscle Moving on to the biceps, we confront a question of setup philosophy. Many artists believe that you can cluster the biceps and create a flex for it based on the rotation of the elbow joint using SDK or expressions, but this ignores human physiology. The animator will need to control the amount of flex in the biceps because how much it flexes reveals a great deal about the character's state of mind by depicting how much force the character exerts when flexing. Although I am a minimalist as far as animation controls, z/the biceps is to flex, especially with a hugely muscled character, the animator should be able to control that flex. B i c e p f l e x . m a has the same file as the arm model we rigged earlier with the addition of a bicep cluster as well as a custom attribute called Bicepflex added to HandControl. To weight the biceps cluster, follow these steps: 1. With the biceps cluster selected, Shift+select the shoulder joint, and parent the cluster to the shoulder. 2. RM the arm mesh, and choose Inputs Complete List. 3. MM drag the Cluster node down below the Skin Cluster node to ensure that the node is evaluated first. 4. Set a key for the cluster at frame 1. Move the cluster outward from the shoulder joint to however high you want the biceps to flex at frame 10. (See the top image in Figure 1.29.) This will not look right because the entire cluster will move uniformly. We will have to weight the cluster points so this deformation looks correct. 5. Painting the cluster weight so that the biceps looks like a biceps when the cluster is translated involves selecting the arm mesh and choosing Deform Paint Cluster Weights Tool. 6. Go to frame 10, flood the cluster with an influence of 0 (see the middle image in Figure 1.29), and set a key. Using Replace as the painting mode with a very high value and very low opacity, slowly build the shape of the cluster by adding influence until it looks right (see the bottom image in Figure 1.29). Smooth as much as needed. I scrub

29

30 C H A P T E R 1 • Accelerating the Preproduction Process

back and forth to see how the biceps will look when the cluster flexes. 7. Move the time slider to 1, and delete the keys on the cluster. This is important because I have found that trying to create set driven keys with keyframes in place can mess up the SDK itself. 8. Connect the cluster's Translate Z attribute to the HandControl's Bicepflex attribute using set driven key to get a good flex. Do not be afraid to experiment with applying SDK to the scale values on the cluster to fine-tune it even more. 9. When your setup is complete, and if you are working on polygons, choose Polygons Smooth to create a smooth skin for your character. You can connect the Divisions attribute to a custom attribute elsewhere on your character to interactively smooth your mesh at render time. If you do this before the end of the process, specifically before you create the lattices for your wrist, your mesh will tear apart. You can take this process further: you can create folds of the wrist as the hand rotates in Y and Z using clusters and SDK. You can also connect the bump depth of a bump map that brings up veins in the arm to a custom attribute called "vascularity" or some such using SDK. You can rig the deltoid and triceps muscles, not to mention flexing the individual muscles of the forearm. As you can see, the potential is endless; unfortunately, your time is not. You can extrapolate the techniques I've covered and apply them to the rest of the body to create a fully rigged character. The biceps-weighting technique works for eyelids as well as facial features. By painting weights, applying lattices, and manipulating sets, you can correct almost any deformation problem on the body.

Control Placement

Figure 1.29: Top image: Translate Cluster along Z. Middle image: flood/replace Cluster weight with influence of 0. Bottom image: paint cluster Weight back until the biceps deformation looks correct.

Although efficiency with the number of controls you create is a virtue; placing them for quick manipulation is essential. Minimize the extraneous clicking of the mouse or movement of sliders, which slows the animation process. A well-thought-out set of character controls will maximize the number of vital movements that can be manipulated on each control. Open

Blobbyman Comes to Life

Figure 1.30: The outliner shot

B l o b b y m a n .ma from the CD to see an example of what I mean. Open the Outliner and click the Translate node. Expand the Translate node completely by Shift+clicking the plus sign next to the name to see the entire control structure laid out for ease of use. (See Figure 1.30.)

Blobbyman Comes to Life B l o b b y m a n .ma contains an unbound human figure accompanied by a skeleton and a partially rigged control structure. You can use this file to apply some of the techniques I've discussed and finish the rig. All IK on both the arms and feet are finished. I have also made forward kinematic controls for the lumbar and spinal bones by adding custom attributes to the HipControl. Let's look at some of the individual controls and what they do. Translate This is the "uber" group by which you can move the entire animation to a different point. For example, if you animate Blobby walking in a particular direction, by rotating Translate 90 degrees, you can shift the entire direction of the walk. Basically, if you want to "pick up and carry off" the entire animation, you use Translate. Character Character node is the top of the "keying" hierarchy. Select Character, select the hierarchy under it, and press s to set a key for every control under it. Using the arrow keys, you can quickly navigate to Character for fast key setting. To add any custom SDK controls (say to adjust a polysmoothface node, for example) add them to the character node.

31

32

C H A P T E R 1 • Accelerating the Preproduction Process

CenterofGravity Often shortened to COG, CenterofGravity is the primary movement control for the entire body. Although you can use COG to move the body in XYZ, leave the rotations to the following controls. HipControl This control is for rotating the hips, lumbar, and spinal bones only. Resist the urge to unhide and unlock the movement attributes because it is best to separate moving from rotating where the body is concerned. Manipulate the spinal column by clicking the various custom attribute names and MM dragging to rotate the LumbarLocator and SpineLocators, which drive the lumbar and spinal joints. These locators are placed in the hierarchy to establish a parental hierarchy with the Shoulder and Head controllers. ShoulderControl Controlling the rotation of the shoulders, ShoulderControl is parented to Spinelocator so that it rotates with the bone it controls yet remains part of the controller, rather than the joint, hierarchy. It has four custom controls that allow the shoulder to shrug and rotate forward and backward independently. HeadandNeckControl Through an orient constraint, this control rotates the neck joint but contains custom attributes to rotate the head itself. It is entirely possible to control this rotation by connecting the rotation of the head bone to the rotation directions of this control using set driven key, but that would disallow counter rotation of the head and neck. I use this control to hang facial expressions for blendshapes, for posing a facial rig using SDK connected to custom attributes, or for controlling clusters for eye blinks. R & LhandControl These controllers move and rotate the hand at the wrist. As mentioned earlier, the controller rotates the wrist joint in Y and Z while controlling the ulna joint in X through a simple expression. This box also contains custom attributes that bend and rotate the fingers. I have completed the creation of finger controls on the left hand with SDK; it is up to you to do the right! R & LankleControl These controls move and rotate the entire lower leg. Point the knees by moving the L & RkneePointer boxes. Lift the foot by raising the ToeControls. The very bottom of the box is flush with the bottom of the foot to make placement on the floor easy to see. I am a proponent of the pose-to-pose method of animating; I find that animating by creating poses first and then adjusting timing allows me to leverage my drawing ability into effective animation. This particular structure of controls allows me to navigate throughout the structure easily using the arrow keys. Also, by navigating to the Character node, invoking the s e l e c t - h i command (which I have made into a shelf button), and pressing the s key, I can key every structure in the hierarchy at once. Animate this character by setting a key on the Character hierarchy and then moving CenterofGravity. Next rotate the hips, spine, shoulders, and head. Then work on posing the feet and hands. By working from the hips outward, you minimize the amount of useless clicking and/or corrective animation you will need.

Summary

Summary Animation does not happen by accident; it takes a huge amount of work, but the job can be made easier with proper planning. Unfortunately, being able to plan effectively requires some knowledge of what Maya can do, and in this chapter I have given you some information about Maya's capabilities along with some ideas of when and how to use them. Having a clear idea of what you want to say with the animation of your character is perhaps the single most important tool in your animation toolbox. By always keeping in mind what you need your setup to do when you get to the character animation stage, you will not only save time when creating and setting up your character, you will animate more efficiently when the time comes, giving you more time to actually animate, rather than fight technical hurdles.

33

Modeling a SubDivision Surface Horse Peter Lee

we'll build a horse using SubDivision surfaces. First, we'll create the basic shapes in NURBS. Next, we'll convert the shapes to polygons and then to SubDivision surfaces. As we proceed, you'll see that almost all the modeling work is actually carried out with NURBS and polygons, with only the finishing touches done in SubDivision surfaces. Many of the most important aspects of creating clean SubDivision surfaces are actually a straightforward application of simple polygon- and patch-modeling techniques.

Creating Basic Shapes with NURBS Let's start with a reference picture. Create a simple polygon plane made of a single face, make it face the X axis (the side view), and then bring in the image of the horse shown earlier in this chapter, which is c h 2 h o r s e _ r e f . t i f on the CD-ROM, as a texture file. You could use an image plane for this purpose as well, but I usually prefer to use the poly plane for several reasons. It's easier to adjust the ratio of the poly plane to match the picture, scale it up or down, and place it in the world space. You can also adjust the transparency of the poly plane or its brightness. Because the c h 2 h o r s e _ r e f . t i f picture is 1200x1000, let's adjust the ratio of the poly plane to 1.2:1 to map the picture of the horse to it without any distortion. Now let's shape the head and the body. Choose Create NURBS Primitives Cylinder. Assign a Lambert material, and make it about one-half to two-thirds transparent. Turn it sideways, and set its attributes to 8 sections and 6 spans to begin with, as shown in Figure 2.1. We want to start with the simplest shape to make it easier for us to model the general shape of the horse; the fewer CVs to work with, the better. Select the hulls of the cylinder, and roughly shape the horse's body by translating, rotating, and scaling the hulls in the side view. (Hint: press the 3 key to view the NURBS surface in high detail.) When working from the side view, don't worry about the shape of the horse from any other views. Concentrate on getting close to the horse reference picture from the side. As

36

C H A P T E R 2 • Modeling a SubDivision Surface Horse

Figure 2.1: The cylinder is placed with the horse reference picture.

Figure 2.2: Extra isoparms are inserted for the horse's body and head areas.

the shaping process becomes more detailed, insert more isoparms in the cylinder by pickmasking isoparm, dragging the mouse to the place where you want to place the new isoparm, and then choosing Edit NURBS Insert Isoparms. Figure 2.2 shows the intermediate shapes. Create two more cylinders, set the attributes to 8 sections and 5 spans, and shape the legs in the same way that you created the body. Again, don't worry about how the image looks from any view other than the side view. The legs need only to roughly conform to the horse reference picture for now, as shown in Figure 2.3. Once the horse shape roughly conforms to the reference picture, shape the horse in other views as well. Move the legs to the left side of the body. Scale the hulls of the cylinder body to make the horse's head and neck areas generally circular but vertically elongated and to make the horse's body area more circular, as shown in Figure 2.4. When the rough shaping is done, choose Edit NURBS Detach Surfaces to cut the body in half as shown in the image on the right in Figure 2.4. This will reduce the task of modeling the details to only one side of the horse. After we convert the NURBS to poly mesh, we'll join the legs to the body. To properly merge the legs to the body, the eight sections of the leg need to line up with the appropriate sections of the body. Place additional isoparms in the body, as well as in the legs, and shape them to more closely follow the reference picture, as shown Figure 2.5. (Keep in mind that the surfaces should be a bit larger than the reference picture; they will shrink in size when they are converted to SubDivision surfaces.) The selected surface patches shown on the right in Figure 2.5 will become a hole after the poly conversion takes place, and the eight sections of the leg will merge with the two sections of each of the four sides. Notice that at this point, the half body in the picture has UV spans of 16 and 6, the front leg has UV spans of 11 and 8, and the back leg has UV spans of 10 and 8. Building the hooves is simple. Create a cylinder with two spans, and shape it like the image on the left in Figure 2.6. Select the bottom edge isoparm, and duplicate a curve from it. Apply Modify Center Pivot to the curve and scale it to zero. (The curve shown on the right in Figure 2.6 has been scaled to 0.2 for visual reference only.) Loft from the edge isoparm to the curve to create the bottom part of the hoof. You can select isoparm using pickmask while you're in object mode.)

Conversion to Polygons

37

Figure 2.3: The horse's legs are roughly shaped.

Figure 2.4: The horse is shaped from front and top views, and then cut into half.

Figure 2.5: More isoparms are added to the horse.

Figure 2.6: Model the hoof using a simple cylinder, and use loft to create the bottom part of the hoof.

Conversion to Polygons To convert the NURBS body to poly mesh, follow these steps: 1. Select the NURBS body. 2. Choose Modify Convert NURBS to Polygons 3. Set the Type to Quads, and set Tesselation Method to General. Set U Type to Per Span # of Iso Params, set Number U to 1, set the V Type to Per Span# of Iso Params, and set Number V to 1. 4. Click Tessellate to convert the NURBS body to poly mesh, as shown in Figure 2.7. 5. Now repeat steps 1 through 4 for the legs. The hooves can be left as NURBS. To join the different parts of the horse that have been converted to polygons, follow these steps:

38

C H A P T E R 2 • Modeling a SubDivision Surface Horse

Figure 2.7: The horse is converted from NURBS to Polygon. 1. Select all the faces of the horse's body area where the legs will join the body, four for the front leg and four more for the back leg, and delete them. 2. Select the two legs and the body, and then choose Polygons Combine to turn these objects into one poly mesh object. 3. Check the direction of the normals of the new object to make sure they are all pointing outward as shown on the Figure 2.8: The horse's body parts are combined, with all left in Figure 2.8. (Choose the normals pointing outward, and the border edges of the Display Polygon Compobody and the legs are merged. nents Normals.) If some normals are pointing in, reverse them by choosing Edit Polygons Normals Reverse with the Reverse and Propagate setting selected. 4. To merge the edges of the legs and the body, choose Edit Polygons Merge Edge Tool, as shown in the top right image in Figure 2.8. When the merging is finished, the whole body should look like the lower right image in Figure 2.8.

Modeling Details

39

Modeling Details Now that we have a rough poly mesh from which to start our detailed modeling, the saying that the devil's in the details applies. On the one hand, the amount of work you put into the details will determine the quality of the resulting horse. You can cheat using bump and/or displacement maps, but that will get you only so far. Most of the horse's details still have to come from its actual surface. On the other hand, the more details you put into the horse, the heavier it becomes, and heavy models are more difficult to set up and animate, and they take longer to render. It's important, therefore, to maintain a fine sense of balance as you work—add details to the model, but only as many as necessary for the job for which you are building the model.

The Mouth Area Let's get back to detailing our horse. To build the mouth area of the horse, follow these steps: 1. Choose Edit Polygons Split Polygon Tool to draw another line of edges around the mouth area as shown in the upper left image in Figure 2.9. You can compare the head in the upper left image with the horse shown in Figure 2.7 to see the extra line more clearly. 2. Append faces to the edge of the mouth area by choosing Polygons Append to Polygon Tool, and move the vertices to refine the shape of the horse's head, as shown in the upper right image in Figure 2.9. I'll soon have more to say about splitting polygons properly for SubDivision surfaces, but for now, let's concentrate on building the mouth area of the horse. 3. Draw two lines from along the edge of the mouth area to intersect with the first line you drew, as shown in the image on the lower left in Figure 2.9, and then delete the faces to create the opening for the mouth, as shown in the image Figure 2.9: Extra lines are drawn and faces created to on the lower right in Figure 2.9. refine the horses mouth area.

40

C H A P T E R 2 • Modeling a SubDivision Surface Horse

Figure 2.10: The border edges along the mouth area are extruded and scaled in. 4. Select the edges around the deleted faces as shown in the left image in Figure 2.10, choose Edit Polygon Extrude Edge, and scale the extruded edges in. You might want to use the default manipulator handle that appears with the command, or you might want to switch to the regular Scale tool to do this, as shown in the middle image in Figure 2.10. Figure 2.11: Edge lines are drawn from the mouth area up 5. Choose Edit Polygon to the head. Extrude Edge one more time, and then move the edges and/or scale them to create thickness for the mouth opening area, as shown in the image on the right in Figure 2.10. Tweak the points to close the mouth a bit more. 6. Using the Split Polygon tool, draw edge lines from the mouth to the head as shown in the image on the left in Figure 2.11. If you try to convert the poly horse to SubDivision surfaces at this point, you will end up with a couple of "extraordinary" vertices as shown in the image on the right in Figure 2.11, which we do not want. Extraordinary points are calculation intensive and will slow down the modeling, animation, and rendering processes. Getting rid of these extraordinary points involves making all the faces quadrangular, or four-sided, which we will get to eventually. You shouldn't clean up the non-quad faces until you have finished adding all the details on the model. 7. Draw another edge line around the bottom of the mouth to shape it better, and draw two more around the top of the mouth as shown in the image on the left in Figure 2.12. 8. Move the points and draw more edges to create an area where the nostril will be created, as shown in the middle image in Figure 2.12.

Modeling Details

Figure 2.12: More edge lines are added around the mouth area to further refine it, and lines are also added to create a nostril area.

41

Figure 2.13: When the faces are kept triangular, the resulting SubDivision surface has extraordinary points, but when the faces are made into quadrangular faces, they convert to clean SubDivision surfaces.

9. Draw more edges to create an inner circular shape, and draw more edges around the mouth area to make the mouth edges protrude, as shown in the image on the right in Figure 2.12. Notice the progression of the nostril area, from a quadrangular face to a five-sided face to a six-sided face, which is then broken into smaller quadrangular and triangular faces. Also notice the way the extra faces around the mouth edge are kept as quadrangular faces.

If you convert the horse at this point, the triangular faces of the nostril area turn into a SubDivision surface with extraordinary points as shown in Figure 2.13, going from the image on the top left to the image on the top right. But when you select every other edge of the triangular faces and delete them as shown in the image on the lower left in Figure 2.13, thus turning six triangular faces into three quadrangular faces, the conversion to a SubDivision surface becomes cleaner, without any extraordinary points being created, as shown in the image on the lower right in Figure 2.13. 10. Select the center vertex of the nostril area and push it up and in. We can come back to the mouth area later for finer sculpting, especially if you want to build teeth into the mouth, but the work of adding edges is basically done.

The Eye Area Let's move on to the eye area. We started with the image in the upper right of Figure 2.14, and we drew edge lines to what's shown in the image in the upper right of Figure 2.14. Now, to build the eye area of the horse, follow these steps: 1. Complete the edge lines along the bottom of the eye area as shown in the image on the lower left in Figure 2.14, and then sculpt the head more to the likeness of the horse.

42

C H A P T E R 2 • Modeling a SubDivision Surface Horse

Figure 2.14: More edge lines are drawn to create the eye

Figure 2.15: Edge lines are created inside the quadrangular face and the innermost face deleted to shape and refine the eye area.

One technique you can use to keep the patches quadrangular as you refine the horse is to push out a vertex point from the edge line it's part of, as shown inside the circle in the image on the lower left in Figure 2.14. Once the vertex jots out from the line, it is easy to see that you can draw another line to split the large seven-sided face into two quadrangular faces, as shown in the image on the lower right in Figure 2.14. You can see another technique being used to keep the faces quadrangular inside the circle in the image on the lower right of Figure 2.14. What was a single edge in the image on the lower left has been replaced by two edges, thus creating an extra face. One of the quadrangular faces changes into a five-sided face as a result, but we'll correct this as we model on. The necessity for creating the extra quadrangular face becomes clear when you see that is where the hole for the eye will be created. 2. Zoom into the quadrangular face where the eye will be. 3. From the area shown in the upper left image in Figure 2.15, select the face covering the eye area. You can either delete the face, select the resulting boundary edges, and choose Edit Polygon Extrude Edge twice, or you can use the Split Polygon tool to draw the additional edges and delete the face at the center, to create the surface shown in the upper right image in Figure 2.15. 4. The four-sides of the eye area are too few to properly sculpt the eye, so draw an edge line starting from the upper middle of the eye hole, and draw another edge line starting from the lower middle. Don't worry too much about where these lines end up for now. Your only concern at this point is that the four sides have become six sides, as shown in the lower left image in Figure 2.15. 5. Draw yet another edge line going out to the side of the eye, and apply another Extrude Edge to the boundary edges of the eye so that you can create thickness for the boundary area, as shown in the lower right image in Figure 2.15. Now, let's turn to the way the edges coming out of the eye area are connecting to the rest of the head and clean up the topology. The area stretching around the eye has some triangular faces, shown in the upper left image in Figure 2.16, which create extraordinary points when converted to a SubDivision surface, as shown in the upper right image in Figure 2.16. When the topology of the area is changed to quadrangular faces as shown in the lower left

Modeling Details

Figure 2.16: Refining the faces to quadrangular faces will create a much cleaner SubDivision surface.

43

Figure 2.17: More details are added to the sides of the eye area to fine-tune the eye shape.

image in Figure 2.16, however, the resulting SubDivision surface is much cleaner, as shown in the lower right image in Figure 2.16. The subtle changes in the lines make a lot of difference in the SubDivision surface conversion. As you sculpt the eye area more, you'll soon find it necessary to further divide the side patches of the eye into smaller faces so that you can make the sides of the eye fold tightly. Notice how the smaller divisions go from the upper left image to the upper right image in Figure 2.17. A careful examination will show that all the new edges are quadrangular patches. This area, therefore, will convert to a SubDivision surface without any extraordinary points. The eye area that you've seen so far is actually a flattened-out version of the model. I did this so that you could more clearly see the topology of the patches. In the lower left image in Figure 2.17,1 sculpted the same surface with the same topology more realistically. Although the points have been moved around, making some parts of the area difficult to see, the topology of the images in the lower left and the lower right are the same. The image on the lower right shows the final resulting SubDivision surface area of the eye.

The Ear Area Detailing the ear area is similar to detailing the eye area. Starting from the basic head as shown in the upper left image in Figure 2.18, move vertices and draw edge lines to make smaller divisions. The lines added in the upper right image in Figure 2.18 are not randomly drawn, but carefully placed to prepare a five-sided face (shown inside the circle), which will be extruded to create the ear and also to make sure that we eventually end up with all quadrangular faces. Once you delete the unnecessary edges, you get the topology shown in the lower left image in Figure 2.18. Notice that, with the exception of one triangular face, all the faces are four-sided. The next step is to extrude the five-sided face as shown in the lower right image in Figure 2.18. Let's work first on the back of the ear. Follow these steps: 1. Push the extruded face out more, as shown in the upper left image in Figure 2.19. 2. Draw a line from the triangular face to the top of the horse's head as shown in the upper right image in Figure 2.19, and then draw another line to the top of the head from the back of the ear.

44

C H A P T E R 2 • Modeling a SubDivision Surface Horse

Figure 2.18: Edge lines are drawn to create a five-sided face, which is then extruded to create the ear.

Figure 2.19: The back of the ear area is refined.

3. Divide the faces at the back of the ear into triangular faces as shown in the lower left image in Figure 2.19. Notice that a diamond-shaped face has also been extruded out, which will become the inside of the ear. 4. Delete the three existing edges that shape the triangular faces at the back of the ear area to create new four-sided faces as shown in the lower right image in Figure 2.19. Notice that the original triangular face by the back of the ear is now also quadrangular. As for the front part of the ear, start with a flat five-sided face as shown in image A in Figure 2.20, but extrude a diamond-shaped quadrangular face as shown in image B. Push back the fifth edge to the back of the ear to create an arch for the inner backside of the ear as shown in image C. Detailing the inner parts of the ear is straightforward. Follow these steps: 1. Select the inner diamond-shaped face, and extrude it inward twice as shown in image D in Figure 2.20. 2. With the topology created, push the inner parts in and down, as well as the bottom points of the ear, as shown in image E in Figure 2.20. 3. Convert the poly surface to a clean SubDivision surface as shown in image F, and tweak the points to refine the shape of the ear. Convert back to a poly surface for further modeling.

The Body and the Front Leg In detailing the body, we'll start by adding lines to the neck area. From the rough body shown in the upper left image in Figure 2.21, draw an extra line through the neck and the chest, and draw another line to shape the front part of the neck. Reconfiguring the patches around the neck to keep everything quadrangular is not difficult, but as you can see in the upper right image in Figure 2.21, the chest area gets a triangular face. Let's first, however, further sculpt the chest and the body areas. Add another line to the chest as shown in the lower left image in Figure 2.21, and add yet another one around where the leg joins the body as shown in the lower right image in Figure 2.21. These additions and other refinements are necessary for the proper deformation of the horse during animation. Draw another line along the upper side of the body and also along the

Modeling Details

45

Figure 2.20: The front part of the ear is refined with extrusion, and one of the vertices is pushed to the back of the ear. bottom side of the body. Further sculpt the points to make the leg look more muscular and to bulge the stomach area. These additional lines are shown from two different views in the top two images in Figure 2.22. At any point of the detailing, you can try converting the poly horse to a SubDivision surface to confirm that all the patches are quadrangular simply by choosing Modify Convert Polygons to Subdiv. The parts of the horse shown in the lower left image in Figure 2.22 should convert cleanly to a SubDivision surface with no extraordinary points, as shown in the lower right image.

The Behind and the Back Leg The last areas to detail are the back leg and the horse's Figure 2.21: Edge lines are added around the neck and the behind. The basic poly shape was converted from the chest areas, and those areas are further sculpted. NURBS patches and merged as shown in the upper left image in Figure 2.23. The two lines added while doing the front part of the body terminate as shown in the upper right image in Figure 2.23, creating two five-sided faces in the process. Again, we'll first put in all the lines necessary for proper sculpting and deformation of the horse, and then we'll clean up the topology.

46

C H A P T E R 2 • Modeling a SubDivision Surface Horse

Figure 2.22: Any remaining triangular faces around the chest area are edited to become quadrangular faces, and conversion to SubDivision surface shows if everything is indeed quadrangular around the chest area.

Figure 2.23: Extra edge lines are added around the back leg area, and that area is further refined.

Insert a line from the top of the body to the stomach area as shown in the lower left image in Figure 2.23. Sculpt to more clearly define the back leg and the stomach, and add another line from the top of the body all the way down the back leg as shown in the lower right image in Figure 2.23. From the back view of the horse as shown in image A in Figure 2.24, draw another line on the back leg as shown in image B. Draw a line straight down the horse's behind until it joins the first edge of the back leg as shown in image C. The lines going down to the back center should also be horizontal. Delete the extra vertices at the center as shown in image D. Draw two more horizontal lines as shown in image E. Our last detailing task in terms of sculpting is to tighten the back leg, making it look leaner and more muscular as shown in the bottom image in Figure 2.25.1 moved and tightened the edges in such a way that it may appear as though I added extra lines , but compare the back and side views in the top and bottom images, and notice that no new lines have been added. You can now start on the final refinements of the patches. Figure 2.26 shows three examples of the triangular or five-sided faces being redrawn into quadrangular faces. Once you get used to "seeing" how the lines should be redrawn in any situation, splitting faces and deleting edges to clean up is not a difficult task. To confirm that you have turned the parts of the horse you are detailing into quadrangular faces, convert the horse into a SubDivision surface and see if you get extraordinary points, which are easily seen by the extra edges that surround them. Compare the images in Figure 2.27, and notice that extra edges surround the extraordinary points in the image on the left. When you are satisfied that the surface is clean, get into the front view window, snap all the vertices along the middle edge to the Y axis using the Snap to Grid function, and apply Polygons Mirror Geometry to the horse, making sure that the Mirror Direction is set to -X in the option box. Some of the open edges such as the eyes, the mouth, and the bottom parts of

Modeling Details

47

Figure 2.24: More lines are drawn around the horse's behind, and that area is further refined.

Figure 2.25: The back leg is refined to make it look more muscular.

Figure 2.26: Triangular or five-sided faces are redrawn to become quadrangular ones.

48

C H A P T E R 2 • Modeling a SubDivision Surface Horse

the legs might merge as well when they shouldn't. Simply delete those unnecessary faces. All the center edges of the horse should merge, but if some do not, you can merge those edges manually using the Edit Polygons Merge Edge Tool. On rare occasions when merging does not work (usually because of opposite normal vectors), you may find it most efficient to simply delete one of the two faces and create a new one using Polygons Append to Polygon Tool. Last, fine-tune the converted SubDivision surface horse in Standard Mode or Polygon Mode to get the final shape you want. Figure 2.28 shows the final horse model as a wireframe, and Figure 2.29 shows the final horse model as a rendered image. You can also see an animation of the textured and rigged horse by opening the c h 2 h o r s e w a l k . m o v file on the Figure2.27:The extraordinary points are shown in the CD-ROM. image on the left.

Figure 2.28: The wireframe of the final horse model is shown in shaded mode.

Summary

Figure 2.29: The horse is textured, lit, and rendered.

Summary This chapter took you step by step through the process of creating a SubDivision surface horse. Many modelers in the industry are using this process, in which the basic shapes are built with NURBS patches, converted to polygon patches, merged, refined, and then converted to a SubDivision surface at the very end. Using this process, we bypass the tricky work of keeping tangency between NURBS patches to make them appear seamless. As you refine the polygon model, always edit the edges in such way as to create four-sided faces so that there will be no extraordinary points when the model becomes a SubDivision surface. As far as I know, there is no exact technique or method for refining or redefining the polygon model's topology to create a clean final SubDivision surface. Nevertheless, experienced modelers recognize a cleanly built SubDivision surface when they see one: it has no extraordinary points, the edges form flowing lines that do not get cut off randomly, and those lines go around the surface areas in such a way as to produce correct deformation when properly weighted. But the best method for an aspiring modeler, in my opinion, is surely the one you acquire as you yourself cut the edges.

49

Organix—Modeling by Procedural Means Mark Jennings Smith

this chapter title, you might have thought that the spell checker malfunctioned or that I simply forced it to learn a new word, "organix." In truth, the spell checker doesn't like the word, since it's not part of the standard lexicon. "Organix" is a term I coined to describe an artistic style that combines simple shapes, simple math, and some deep philosophy but produces devilishly complex-looking forms. This chapter is far too constricted to properly cover the deep philosophical relationships of art, biology, physics, and good old Mother Nature, so I'll avoid as much of that as possible. For further edification, you can go to www.absynthesis.com. Instead we'll look at some simple techniques and some interesting examples that will more or less question the twisted cliche, "less is more." To put my work in a bit of historical perspective, I was profoundly moved by the work of William Latham, a British computer scientist who created amazing organic animation with his own proprietary software. "The Conquest of Form," Latham's first animation, was released about 1989. The forms in this animation are wonderfully textured and diverse. His hypnotic creations squirm, writhe, and mutate. These forms were "selfevolving" creatures constructed from algorithms Latham wrote based on certain base principles of natural selection and Darwinism—in other words, life and how it evolves. I am vastly oversimplifying a deep digital concept for the sake of brevity. Beyond the math, Latham's technique was

52

C H A P T E R 3 • Organix—Modeling by Procedural Means

devious in its simplicity, and in homage I call it systematic multireplication and include it in a wider discipline I began to call organix.

Stop and Smell the Roses: A Primer As CG artists we are asked to be mathematicians, theologians, chemists, anatomists, lawyers, advertisers, radicals, cartoonists, politicians, actors, philosophers, physicists, doctors, illusionists, dreamers, and creators. I can't think of a vocation that exposes one to such a range of disciplines, and admittedly I have learned things that I never thought I would. It's important to stop and smell the roses. No, I mean it! Really, both figuratively and literally. I do it all the time. And when you smell that rose, take a good look at its design: • A full bloom is made up of concentric layers of petals emanating from a single bulbous base. • The aged blossom unfolds, revealing its inner sanctum. Center stage is the pistil, which includes the stigma and style, surrounded by a ring of stamen. • The bud is nothing more than the neatly compacted version of an expanded flower blossom. • The smooth green stem is alternately peppered with sharp woodlike thorns and dark green leaves, with micro-fine serrated edges with thin stems. You could continue, perhaps microscopically, and see that Mother Nature is still concerned about her organic symmetrical design elements. In other words, nature is the inventor of systematic multireplication—everything from a spiral staircase to a pack of birth control pills. We always have been and always will be consciously and unconsciously influenced by the symmetry of nature. Figures 3.1 and 3.2 show some organic bits and pieces from my backyard that I have microscopically enlarged from 10X to 200X. Notice that even at this tiny level nature is systematic in its design choices.

Figure 3.1: Photos A, B, and C are various angles and magnifications of an animal bone. Photos D and E are various magnifications of a tree seed. Photo F is a mature grass species.

Stop and Smell the Roses: A Primer

53

The other thing you notice about natural objects is the duplication that takes place when nature creates. Replicating the simpler form leads to the more complex and interesting shape. The computer is a perfect workhorse for the geometric math involved in replicating forms. Every time you create a bicycle tire and spokes or a ceiling fan, you borrow from nature. Nature is not always exclusively organic. You can also find artistic inspiration in gravity, thermodynamics, and surface tension. As a reminder, I keep a chunk of wax near the rest of my computer adornments. I removed the wax from a dish that had been filled with coins. In the center of the dish was a large wine-colored candle, which eventually overflowed its seeping hot melted wax onto the coins. Retrieving my coins uncovered an amazing and inspiring form, shown in Figure 3.3. Gravity, thermodynamics, and surface tension were among the contributors to this bit of natural art. Figure 3.4 shows an image modeled in Xfrog and rendered in Maya. It was the direct result of finding the wax. This image is an example of how all experiences, great and seemingly

Figure 3.2: More organic bits and pieces microscopically enlarged

figure 3.3: An image of coins imprinted in melted wax

Figure 3.4: The resulting image derived and inspired from the wax

54

C H A P T E R 3 • Organix—Modeling by Procedural Means

insignificant, whether you are conscious of them or not, play a role in your creative strength. For so many good reasons, go outside and smell a rose. / thought I was a true geek the first time I sat in a chair and started to notice the specular highlights of the chrome tubing, and the diffuse shadows the fabric played over the wood. That was a long time ago, when it was all still so new. And now I notice that a slight reflection, a glint off of an edge of glass, can instantly put me in that mode where I think about sitting with sliders trying to recreate those visual instances. (Mark Sylvester, Ambassador 3D)

A Visual Maya Zoo I'm often asked how I create certain images. My moving images puzzle people. Noncomputer types get the three-word, short answer, "3D virtual spirograph." 3D people get the one-minute concept demo in Maya. The reaction is similar to that of a magician's fan who becomes privy to an easy trick they had thought difficult. The results of my little "trick," however, can be quite complicated and amazing. Let's begin modeling our first organix primitive. Follow these steps: 1. Load the Maya binary file c a r a p a c e . m b from the CD, and then open Maya's Outliner (choose Windows Outliner). 2. Select c a r a p a c e from the Outliner, as shown in Figure 3.5, and give it a quick render.

Figure 3.5: A rendering of the single carapace object hides the more complex results derived from its use.

The carapace object is a simple NURBS cone that has been distorted a bit. I put a simple ramp texture on it with earthy tones. I used versions of this same ramp for a bump map and incandescence maps. Which textures you use is an aesthetic judgment call, but contrasting patterns work great. I often liken this situation to a kaleidoscope: depending on the mixture of elements you place inside and the random spin, the results can be surprisingly dramatic. Whether you place corn kernels, broken glass, small screws, pebbles, or vitamins inside, the single units seem to lose identity in the whole pattern. 3. With carapace selected, group it to itself. Choose Edit Group Highlight Parent and Center, then click Apply. Name the group Unit_Segment, as shown in the graphic on the left, and then select Unit_Segment.

A Visual Maya Zoo

Now let's duplicate the group a bit and change our single organix primitive into a more complex shape. 4. Choose Edit Duplicate Set Translate to 0, 0.3, 0.3; set Rotate to 10, 0, 10; set Scale to 0.9, 0.9, 0.9; set Number of Copies to 39; and set Geometry Type to Instance, as shown in Figure 3.6. Set Group Under to Parent. That's it. Click Apply and check your result. You should have something that looks like Figure 3.7. Move your camera around a bit and check out the shape. 5. After you check your result, render it out, and then save your scene. Figure 3.8 shows several rendered angles of the new object, which is organic looking indeed. The simple shader that was placed on our base primitive object takes on a whole new texture life after it has been assigned individually on the newly replicated objects. The repetitive nature of the texture is reminiscent of thousands of insects and reptiles. The cone point takes on new significance as well because it appears to be part of a series of thorn, claw, or spikelike barbs. Notice too that we used instances instead of copies, which saves rendering time and memory. Using instances also gives us our backbone for entry-level animation, with which we will deal later.

Figure 3.6: The Duplicate Options dialog box

Figure 3.7: A hardware-rendered result of what your result should look like with the Outliner settings

55

56

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.8: A collage of four separate angles of the new primitive showing its diversity and ability to blend separate components into one By simply altering the pivot point a single sphere can have wildy different duplication results when performed with the exact same parameters. The three sets of images shown in Figures 3.9 through 3.17, show the sphere before and after duplication. The first image of each series displays the highlighted relative position of the pivot point prior to duplication.

Bring Simple Life to a Creation Now let's look at how to apply some basic yet interesting animation to our organism. The motion we will create is deviously simple, yet the end results are sometimes quite hypnotizing and fluid. Follow these steps to continue the example in the previous section: 1. Load c a r a p a c e 2 . m b from the CD. Open the Outlinertodisplay40groups (Segment_Unit). Collapse the original group (Segment_Unitl). You will find the original carapace object we started with in the previous section. We grouped the original carapace to itself before duplicating those groups. We will work with that original object for now. Selecting carapace under Segment_Unit1 selects all objects that make up our organism.

Bring Simple Life to a Creation

57

Figure 3.9: The first image

Figure 3.10: Wireframe version of the render of Figure 3.9 shown at render angle.

Figure 3.11: Final rendered version of Figure 3.9.

Figure 3.12: The second image

Figure 3.13: Wireframe version of the render of Figure 3.12 shown at render angle.

Figure 3.14: Final rendered version of Figure 3.12.

Figure 3.15: The third image

Figure 3.16: Wireframe version of the render of Figure 3.15shown at render angle.

Figure 3.17: Final rendered version of Figure3.1S.

2. This object is set up for some interesting movement. Zoom your perspective view out so that you can get a decent view of the entire organism. 3. Now, let's translate the original carapace node. Test it first by a single translation in one axis. Notice how the entire shape squirms in accompaniment. After each single translation, be sure to undo again by pressing z (Undo) to return to the original state. Try two and then three translations before returning to the original state. Each translation is sequentially

58

C H A P T E R 3 • Organix—Modeling by Procedural Means

additive and significant to the next translation. Although the final destination of each translation is the same, the shape of the whole organism can differ dramatically depending on the translations. 3. You might have guessed that you can alter the base node by other means. Scaling and rotating the node, for example, will give you interesting results. With careless abandon, translate, rotate, and scale in XYZ. Don't fret about returning to your original state; the file is on the CD safe and sound. It is actually quite amazing how much fun it is to watch the shape change form. Believe it or not, you will eventually get a sense of the particular form and be able to judge how it will react. Remember as well that this form is easy to create yet yields some complex results. You can create more complex organisms that expand wildly on the eye-candy factor. Expanding further, each Segment_Unit## has a child node of its own. Selecting these carapace nodes and manipulating them will develop different animations entirely. 4. Select several of the other carapace nodes under some of the other numbered Segment _Units, and witness the behavior of the object as you tweak several nodes in combination. 5. Create a quick keyframed animation to get an idea of the interesting motion you can achieve. Keep it simple. Translate your original carapace node once or twice over 300 frames. You can also scale it and rotate it. Playblast or render out your animation. I have included a rendered animation on the CD called S q u i r m 3 2 0 Q T s o r e n 3 . m o v . Parts of this animation are reminiscent of color-shifting octopi and their dexterous tentacles. Even a little keyframing produces some interesting animation. It is always best to keep your keying work rather simple until you begin to understand the complexities of a form. Each object is on its own axis but is controlled by at least a single other source at any time. When you begin to introduce too many actions, conflicting rotational data can easily result in animation that jumps from key to key rather than smoothly transforming. This looks much like the old gimble lock problem so common in the early days of3D animation. So remember: keep it simple.

Abusing the Cone

59

As you recall, we instanced one original object to create our organism. Pros and cons are associated with instancing, but instancing suits our purposes famously. Here are a few rules to remember about geometry copies and instances: • Copies are just that—identical copies of the geometry. Instances rely on the data that composes the original geometry. An instance is a displayed representation of that original geometry. • Using instances takes much less memory, renders faster, and reduces the size of a scene file. • You cannot alter instances directly. Any change in geometry placed on the original is reflected immediately in the instances. • Instances cannot be assigned alternate shaders. Changes to the shading network of the original object are reflected in the instances as well. • You can duplicate and instance lights, but instanced lights will have no effect in the scene (so I'm not really sure why you would want to do that). The animation S q u i r m 3 2 0 Q T s o r e n 3 . m o v on the CD-ROM expresses a great range of organix movement. We derived something quite complex from simplicity. As you begin to add other elements to the animation equation, you will certainly deal with more variety. Let's take animation a few degrees further by adding some tricks. On paper it will not look like much, but the results will show otherwise.

Abusing the Cone A cone is a basic geometric primitive in any 3D package. Make that geometry a NURBS cone, and you have the makings of some wild animation. This is another simple example of organix that shows that less can be more depending how you look at it. To see just how much torture a NURBS cone can endure, follow these steps: 1. Load conel.mb from the CD. Figure 3.18 shows the parameters for the cone at this point. Nothing differs from the default NURBS cone other than that we want to set the Number of Spans to 5 and cap the bottom of the cone. Now let's elongate the cone. 2. Scale the cone to 0.8, 2.0, 0.8. Rename it to i n s t a n c e d _ t h o r n _ c o n t r o l , select i n s t a n c e d _ t h o r n _ c o n t r o l , and group it to itself. Call the Parent s i n g l e _ t h o r n _ c o n t r o l .

Now that the cone is a bit longer and thinner, let's move its pivot point. Actually the default position of the pivot point for the i n s t a n c e d _ t h o r n _ c o n t r o l object (cone) is fine; we are primarily interested in the Parent. 3. Select s i n g l e _ t h o r n _ c o n t r o l . Again, I like the Outliner to do this, but it's your workflow. Go with it!

Figure 3.18: The NURBS Cone Options dialog box

60

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.19: A cone with its pivot point offset from its original location within the cone now is markedly distant from its geometry.

4. Press the Insert key (the Home key on a Mac system) so that you can move the pivot from its original position. Translate the pivot over eight units in the X direction. If your cone moves, you didn't press Insert properly or at all. 5. After you establish the new pivot position for the cone, press Insert again to disable the ability to translate the pivot and return you to the normal possible translations of the group. 6. Now that the s i n g l e _ t h o r n _ c o n t r o l pivot is offset, move the group until its pivot is at 0,0,0. Figure 3.19 shows the results. By offsetting the pivot point of an object or group, the Duplicate tool becomes much more interesting, especially for working with organix forms. This offset technique is a primary tool for achieving interesting and varied results.

The Duplicate Options dialog box displays the values from its previous use. This feature can be great for helping you to remember your last set of parameters if you want to use them again. It also comes in handy for slight variations of those original parameters, lf your new parameters are completely different, it's best to start from scratch (with the default settings). In the Duplicate Options dialog box, choose Edit Reset Settings to reset the parameters to the default. I find that resetting also gives you a better mental image of what you are doing and that you are less likely to make input mistakes.

Abusing the Cone

Figure 3.20: The results and the settings

Now let's run this baby around the proverbial horn by duplicating it. 7. Change to the front view if you are not there already. Select s i n g l e _ t h o r n _ c o n t r o l to make it active, and then choose Edit Duplicate to open the Duplicate Options dialog box. 8. Choose Edit Reset Settings to flush out the old parameters. 9. We want to create 39 more instances of this group for a total of 40, so set Number of Copies to 39, and select Instance as the Geometry Type. The only other parameter we will change is to adjust the rotation of each instance by 9 degrees on the Z-axis. Remember that because our parent group has an offset pivot point, the result will be dramatically less crowded than our previous example. 10. Click Duplicate to see your result. Figure 3.20 shows what you should have, and the inset shows the parameters used to achieve it.

61

62

C H A P T E R 3 • Organix—Modeling by Procedural Means

This particular s i n g l e _ t h o r n _ c o n t r o l is the parent of the original i n s t a n c e d _ t h o r n _ c o n t r o l and therefore the only one not numbered. Notice that each child of subsequent s i n g l e _ t h o r n _ c o n t r o l # # nodes ( i n s t a n c e d _ t h o r n _ c o n t r o l ) does not have numbers indicating its generation, lf l had attached a numeral 1 to the end of the original s i n g l e _ t h o r n _ c o n t r o l before duplicating it, Maya would have named the first instance s i n g l e _ t h o r n _ c o n t r o l 2, the second s i n g l e _ t h o r n _ c o n t r o l 3, and so on. I prefer to distinguish the original by no number at all. It makes more sense to me, but do what seems logical to you.

11. Save your scene and load c o n e s 3 . m b from the CD. The file c o n e s 3 . m b is the example up to this point, with the addition of shaded cones. I simply dragged a simple blinn shader with a color ramp onto the cones, and I placed a few lights in the scene. The only other difference is that the object has been scaled down to 0.33 of its original size. 12. When you open the outliner, you will notice our group hierarchy m a s s _ c o n t r o l s i n g l e _ t h o r n _ c o n t r o l # # i n s t a n c e d _ t h o r n _ c o n t r o l # # . We are primarily interested in s i n g l e _ t h o r n _ c o n t r o l i n s t a n c e d _ t h o r n _ c o n t r o l . 13. Select s i n g l e _ t h o r n _ c o n t r o l i n s t a n c e d _ t h o r n _ c o n t r o l , and play around with it a bit. Scale, rotate, and translate the i n s t a n c e d _ t h o r n _ c o n t r o l . Again you'll see an amazing amount of interesting instanced control over all the cones. The replicated cone points will often look like barbs, thorns, teeth, or claws, and the layered cone bases will often resemble scales. If you get hopelessly lost, load the Maya scene file again. Figure 3.21 shows some of my variations. Again you see the power of the instanced object and using this technique to create some interesting images quickly and with little fuss. As I mentioned, you can add other things to the mix. 14. In the Outliner or Hypergraph, select the 39 numbered instances of s i n g l e _ t h o r n _ c o n t r o l # # . In the Channels box, and find the Visibility parameter. We want to turn off the visibility of those 39 instances temporarily, so change Visibility to Off, or enter 0 in the parameter box. All 39 cones should disappear, leaving the original unnumbered s i n g l e _ t h o r n _ c o n t r o 1 , as shown in Figure 3.22. This gives us room to focus on our original cone without clutter. The reason for creating the original cone with so many spans is so that we can really "abuse the cone." The more rambunctious we get with our node transformations, the more we test the patience of the NURBS cone to behave smoothly. That said, let's create some clusters on our cone. 15. Select s i n g l e _ t h o r n _ c o n t r o l , and press F8 on your keyboard to turn on SelectToggleMode. Now you can select CVs to group into clusters. 16. Select the point CVs of the cone; we will make that our first cluster. Under Animation, choose Deform Create ClusterCone. Maya creates a cluster out of this top group of CVs, names it c l u s t e r l h a n d l e , and places a C in the interface representing it. You'll see this in any orthogonal or camera view. Rename the c l u s t e r l h a n d l e to t h o r n _ p o i n t .

Abusing the Cone

Figure 3.21: Variations on a theme

We want to create a cluster for every planar level of CVs on the cone, using the method just outlined for the point. Out of the bottom two levels we will create a single cluster and call it t h o r n _ b a s e . Figure 3.23 shows the clusters and their naming conventions from the point to the base. There is not a specific end goal here. What I'm presenting is more a theory-based concept. These techniques are guidelines for creating the abstract, which can serve a useful purpose for attaining a certain look or effect. Beyond the concepts, there is no right or wrong here, and experimentation and imagination are the key to creating something interesting. You'll never see a tutorial for kaleidoscope operation stating "Shake your kaleidoscope this way to create this pattern."

63

64

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.22: The original unnumbered s i n g 1 e _ t h o r n _ c o n t r o 1 If you got lost, c o n e s 3 b . m b on the CD will get you to this point in the process. The file c o n e s 3 c . m b is the same as c o n e s 3 b . m b except that the cone is already animated in c o n e s 3 c . m b . Animating a cluster is fairly routine. Since we are not doing a walk cycle or something that requires a significant set of ordered rules, we don't need to spend a great deal of time animating the cone. With eight sections and five spans, the cone is certainly pliable. Let's animate a single cluster. 17. Load c o n e s 3 b . m b from the CD. Go to the front view; we will animate from this view.

Figure 3.23: The clusters and their naming conventions

Alternate Uses of Paint Effects

18. Open the Outliner, and slide the seven clusters into view. We are going to create the most basic cyclical animation possible (one that repeats exactly after a certain number of frames). 19. We want to create a 90-frame animation, so set the Time Slider for 90 frames. Select the cluster t h o r n 5 h a n d l e . Put the Time Slider first on frame 0, and create a key. 20. In the Channel box, choose Channels Key All. Now slide your Time Slider to frame 89, and once again choose Channels Key All in the Channel box. Slide down to Frame 30, and move cluster t h o r n 5 h a n d l e 0.4 units in the X direction and create a key. 21. At frame 60, move t h o r n 5 h a n d l e to -0.4 in X and choose Key All again. You have now created a short cluster animation. Set the Time Slider to run from frame 1 to 89 (not 0 to 89) and play it back. This is not the most exciting animation in the world, but it will prove quite useful in adding secondary animation. Remember that by adding this animation to the original cone, all the cones will mimic this motion. You buy yourself a lot of syncopated razzle dazzle with little effort. 22. Stop the animation, and open the Outliner. We now want to turn the visibility back on for those 39 instances that we made disappear. Select the 39 numbered instances of single_thorn_control##.

23. In the Channel box, find the Visibility parameter. Change Visibility to On or enter 1 in the parameter box. All 39 cones should reappear, showing the full complement of 40 cones again. Now if you scrub through your 90 frames, you will see that all the cones share the cluster's animation. Make changes to the original node, and run the animation again. You have now added another level of complexity to your organism. Additionally, just as with our first organix primitive, each i n s t a n c e d _ t h o r n _ c o n t r o l # # child of the s i n g l e _ t h o r n _ c o n t r o l # # parents is tweakable. Since each one is an offset of the next, they will control the whole organism slightly differently. Close this scene and open c o n e s 3 c . m b . This scene is identical to the previous scene except that I spent a little more time on the animation of the cone. I actually took advantage of all the clusters that we had previously made. 24. Set the Time Slider to 1000 frames, and then play the animation. You can see the resulting animation created by using the extra clusters. Again, as we have done previously, make the rest of the organism visible. Without adjusting nodes you can see that the animation already has a cool impact on the form. Once you begin tweaking the nodes, the results will be more prominent. Included on the CD is a 1OOO-frame animation that incorporates the scaling, rotation, and translation of instanced nodes. It also incorporates the secondary cluster animation and some camera and light movement, which, as you can see, adds yet another level of complexity for experimentation.

Alternate Uses of Paint Effects While I can safely say that I have used almost every software package known (OK, maybe not every one), I am always looking for something unique or exemplary. I take a non-platform/nonpackage approach to getting a piece of animation or art as I envision it. To that end, I don't discount any software on any platform if it is going to provide me with a solution. The all too

65

66

C H A P T E R 3 • Organix—Modeling by Procedura l Means

prevalent attitude of operating system snobbery gets us nowhere as artists. Even if you make a heavy investment of both time and money in a certain software package, don't let that blind you to a nifty toolset if it is within your reach. Later in this chapter, I'll describe some software I use in concert with Maya. When Paint Effects was introduced into Maya, it was an astounding advancement and was used for everything from flowing grass to perspiration. The sheer volume of animatable parameters was enough to boggle the mind. I soon got bored painting trees and decided to see how it could be used otherwise. While testing the limitations of Paint Effects, I was disheartened to find that you couldn't paint polygons. I model in other programs for various reasons, and that makes importing NURBS into Maya a problem. My trouble arose when I tried to paint hair on a polyface model. But it didn't take me long to figure out that I could parent a Maya NURBS proxy to my object, fashion it similarly in form, make it paintable, and then turn it invisible. This became the cornerstone of cool things to come. The following example shows a model of my sister-in-law's face. The polygon model was fitted with a "NURBS skull" proxy for the purpose of receiving Paint Effects strokes. As in real life, I made sure that the hair covers her unsightly scars (uh, I mean polygon edges) (see Figure 3.24). You can work along by opening s c a r y _ f a c e . m b from the CD.

It is easy enough to introduce a NURBS sphere into the scene that would serve as Jennifer's replacement skull. The skull does not need to actually look like a skull, but it is important to make sure that the paintable NURBS surface will indeed fit within the edges of your

Figure 3.24: The imported 3D model of my sister-in-law Jennifer poses a problem for Paint Effects hair attachment. Maya does not yet allow for strokes to be attached to polygons in the normal fashion.

Alternate Uses of Paint Effects

67

polygons. In this example, hair, which protrudes from the scalp anyway, will suffer little from this cheat. Hair can hide scars, tattoos, hickeys, and, in this case, an actual cranium! Over the years, I've found it best to create an obnoxious color for my proxy, because this will make it stand out amidst the hair, pointing out heavy clumps of hair while immediately identifying bald spots. A single Paint Effects stroke can cross multiple surfaces. This is a cool feature and is open for serious experimentation. I noticed while painting different hairstyles on various-shaped head models that a proxy skull wavered dramatically in shape from character to character. This posed a challenge depending on the hairstyle you are trying to achieve. I found it easier to place multiple paintable surfaces together as a great foundation for laying hair. A stroke can be continued across several NURBS surfaces, making it easier to judge how a Paint Effects curve will react. A single curve can then be tweaked further by nudging whole NURBS surfaces around (usually spheres) for the right look. Try it. It will give new meaning to CG hairstyling. Let's try painting a few locks of hair on a proxy skull. Notice that in the process we are painting across multiple surfaces. First, open the file s c a r y _ f a c e . m b on the CD. In this file, I added supplemental geometry to the side of the model's head. I was having difficulty clearing the side of her cheekbones properly. By adding an elongated NURBS sphere (see Figure 3.25), I could easily start from the top of her head and sweep around her cheek without making the hair protrude oddly through her lovely high cheekbones. When you are reasonably happy with your skull adjustments, it is time to test the head for probable adjustments. Select all the NURBS surfaces you added as your proxy, and then choose Paint Effects Make Paintable. Make any brush choice from your Visor and add a few strokes. Remember that holding down the b key allows you to scale the size and flow of your brush stroke. Whatever stroke you use, be it corn or red Mohawk, you'll see it follow your proxy skull. Figure 3.26 should look something like your image.

Figure 3.25: A side wireframe view of two distorted NURBS spheres that will stand in for already removed polygon geometry. Because Paint Effects strokes will not adhere to polygons, I used NURBS replacements.

Figure 3.26: Two brightly colored NURBS spheres are made paintable for accepting Paint Effects brush stokes. Here a variety of vegetation crosses the skullcap and cascades down the side of the head. Notice that a brush stroke will continue across two separate paintable surfaces.

68

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.27: The top-down view of the bead model with real Paint Effects hair brush strokes. The NVRBS proxies used to replace the skull are still in place but have been toggled invisible in the Channel Editor.

Now make all your proxies active at the same time. In the Channel Editor, locate Visibility and turn it off. Now all your proxy skulls should have disappeared. Try adding a few more strokes to your "invisible" objects. The strokes will continue to cover the surface regardless of the status of their visibility. As I mentioned, the obnoxious color shaders applied to your proxies serve a purpose. Make your proxies visible again. You'll see how much easier it is to paint hair when you know where you're painting. Try painting some decent locks on the scary face model. See if you can complete the entire head, making it as real as you can. It's actually quite amusing. Figures 3.27 and 3.28 show one possible outcome to our model's hair replacement surgery. How does this fit into organix? Well, the realization that I could paint across more than one object and turn those object(s) invisible prompted me to consider further uses—or abuses—of the technique. The ability of a single Paint Effects stroke to cross multiple surfaces made me curious. It added a whole new realm of possibility to my abstract beasties, while creating a new way to toy with Paint Effects strokes.

Organix and Paint Effects It's always great to have a new tool. I naturally wanted to adapt Paint Effects into an interesting and unconventional organix tool. Post haste I delved into the possibilities of some new organix forms. As I learned what Paint Effects was capable of, I began to see great untapped potential in the brush strokes that it generated.

Organix and Paint Effects

Figure 3.28: The rendered result of a few well-placed Paint Effects strokes does a fairly decent job of giving ]ennifer a new cyber-style.

Duplicating Unattached Paint Effects to Create Larger Grouped Objects On the CD I have placed a simple Maya binary, S i n g 1 e S t r o k e . m b . This scene file is basic Maya. What's important here is the thought process and concepts. We'll consider and utilize Paint Effects brush strokes as objects unto themselves. Therefore, applying the same principles of multireplication and instancing, you can create your own organix primitives. These organix primitives, composed of grouped Paint Effects brush strokes, will become a form of pseudo geometry. They'll hold some 3D standard NURBS and polygonal geometry characteristics. Some pros and cons are associated with using these primitives. In some situations, using a Paint Effects tree over a polygonal model of a tree is advantageous; in other situations, Paint Effects is clearly not up to the task. You can quickly assemble an orchard of apple trees for backdrop scenery, but placing a bird's nest and avian interactions with the tree is best done by using actual geometry.

69

70

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.29: The Duplicate Options dialog box

Figure 3.30: The perspective window

Lets look at a few examples of duplicating Paint Effects brush strokes as geometry. Follow these steps: 1. Load the Maya binary S i n g l e S t r o k e . m b from the CD, and then in the Outliner, choose Windows Outliner. 2. Select s t r o k e G o 1 dl from the Outliner and rotate it 90 degrees on the X-axis. Now render it. The brush stroke is one of the default Paint Effects metal brushes in Maya. 3. Now let's duplicate the brush stroke a bit and change its form. Choose Edit Duplicate We will want to alter some parameters. Change Translate to 0, 0, 1.5. Change Scale values to 1.0, 0.8, 0.7. Set the Number of Copies to 19. Geometry Type is Instance. Set Group to Parent. That's it! Make sure s t r o k e G o l d 1 is still active. Click Apply and check your result. Figure 3.29 shows the correct parameters for the Duplicate Options dialog box. 4. Check your result in the perspective window, as shown in Figure 3.30, and then render it out. Your results should look something like Figure 3.31, depending on your camera angle. 5. In the Outliner, select all s t r o k e G o l d # brush strokes and group them together. Label this new group S t r o k e G o l d G r o u p l and close it. The curve that you should not select is c u r v e G o l d . Rename that to S t r o k e G o l d C u r v e l C o n t r o l . Save your scene file. It is S t r o k e G o l d G r o u p l C o n t r o l .mb on the CD. Figure.3.3l:The results of duplicating Paint Effects

Organix and Paint Effects

Let's take this a tiny bit further. Follow these steps: 1. Load S t r o k e G o l d G r o u p l C o n t r o l . m b from the CD. 2. If necessary, open the Outliner. Select the S t r o k e G o l d G r o u p l group only. What we have now is a Paint Effects primitive fresh from the oven and ready for further experimentation. Let's scale it down to a smaller size by changing the Scale XYZ values in the Channel box to 0.2, 0.2, 0.2. 3. Rename S t r o k e G o l d G r o u p l to S t r o k e G o l d G r o u p . As I mentioned earlier in the chapter, I prefer to designate the original with no numbers. Open S t r o k e G o l d G r o u p to view the child brush strokes that constitute it. Select brush strokes s t r o k e G o l d 1 through s t r o k e G o l d l 2 , and group them together (select them all and press Ctrl+g). Name that group S t r o k e P a c k . Performing this step gives us control over the group as a whole. 4. Now let's duplicate our organix primitive. With S t r o k e G o l d G r o u p l still selected, choose Edit Duplicate Reset your parameters to default values by choosing Edit Reset Settings in the Duplicate Options dialog box. Set the Translate StrokeGoldGroupl parameters to 0.5, 0.5, 0.5 in X, Y, and Z, respectively. Set Rotate values to 20.0, 20.0, 20.0 in XYZ. Set Number of Copies to 19, and set the Geometry Type to Instance. Figure 3.32 shows the proper parameters. Click Apply and frame your result in the perspective window so that you can see the entire chain of duplicates. Now you can see why we scaled our model back down a bit. Figure 3.33 should resemble your output. Render it out to see your result (see Figure 3.34)

71

72

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.32: Setting the parameters for the duplication of StrokeGoldGroupl

Figure 3.33: The wireframe perspective view of the duplication result

This image may not be dropdead gorgeous, but we have created an organix model with several individual controls that operate the identifiable parts both en masse and separately. The lone curve, S t r o k e G o l d C u r v e l C o n t r o l , simultaneously controls the scaling, translation, and rotation of every instanced brush stroke created from it. Selecting any of the S t r o k e G o l d G r o u p groups controls that individual group of curves as a single unit. The S t r o k e P a c k groups Figure 3.34: The rendered version of the perspective view control the brush strokes as a with new duplicated results single unit, but affect the scaling, rotation, and translation of all StrokePacks simultaneously. Load the completed scene file S t r o k e G o l d C o n t r o l C o m p l e t e . m b from the CD and toy around with the controls a bit. I used a relatively simple Paint Effects brush stroke, but as with geometry, you can see the potential for some elaborate displays.

The Chinese Dragon Revisited In the popular Sybex Mastering series, I created an image for Mastering Maya Complete 2.1 received a great deal of positive response about the image, but there was no tutorial or other mention of how it was created. This was partially because Paint Effects was a not a product at the time, and thus the image was created with as yet unreleased tools. While creating Chinese Dragon (see Figure 3.35), I applied organix principles to Paint Effects brush strokes for the first time. I used some knowledge gained from my proxy skull experiments to create the image. Let's dissect the original Maya binary and uncover a few other interesting techniques. Follow these steps: 1. Load C h i n e s e _ D r a g o n _ r e v i s i t e d A . m b from the CD. I have hidden a lot of clutter from view so that we can focus on part of the dragon (see Figure 3.36). The NURBS sphere, P r o x y _ S p h e r e , was placed in the scene to accept Paint Effects strokes. Instead of hair, I

Figure 3.35: The Chinese Dragon from Mastering Maya Complete 2. The dragon was rendered with an alpha channel and composited with the sky background, painted in Photoshop.

74 C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure3.36: The result of loading C h i n e s e _ D r a g o n _ r e v i s t e d A . m b with most geometry and brush strokes invisible

chose one of the metal brushes. I painted a single brush stroke onto P r o x y _ S p h e r e , which I had previously made paintable. The intention here was to multireplicate the curve many times over and then make P r o x y _ S p h e r e invisible. Here are some things to note: • A Paint Effects brush stroke applies to a NURBS surface similar to curves on surface, but it is not attached to the surface exclusively. In other words, the brush stroke can be removed from the surface of the NURBS sphere as an independent node, yet retain its original painted shape. • Altering the shape, translation, or rotation of P r o x y _ S p h e r e will affect its assigned brush strokes in kind, regardless of the proximity of each to the other. See Figure 3.37. • Paint Effects brush strokes can translate, rotate, and scale independently of the object on which they were painted. See Figure 3.38. 2. Load C h i n e s e _ D r a g o n _ R e v i s i t e d B . m b from the CD. 3. In the Outliner, open the Tendrils group. Paint Effects brush stroke s t r o k e l is the sole child of the Tendrils group. This is the stroke painted on P r o x y _ S p h e r e . Perform actions on both s t r o k e l and P r o x y _ S p h e r e , and notice how they affect each other. The earlier bulleted items may seem trivial, but, as you can see from this example, they are at the core of organix animation using Paint Effects.

Organix and Paint Effects

Figure 3.37: Various simultaneous actions on assigned brush strokes by altering the paintable object

4. Reload C h i n e s e _ D r a g o n _ R e v i s i t e d B . m b , and run through the animation slider with the s t r o k e l brush stroke selected. You'll see that it has been previously animated with a rotation around its X-axis. Because it shares the same origin as P r o x y _ S p h e r e , it appears to act as though it were an animated curve on a surface when animated. This illusion breaks down quickly, however. 5. Reload C h i n e s e _ D r a g o n _ R e v i s i t e d B . m b , and select P r o x y _ S p h e r e in the Outliner. Scale it in the Y-axis until your sphere becomes an egg. The brush stroke will scale with the sphere as expected. Create a keyframe at zero for the new Y scaled value of

75

76

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.38: Various actions of a Paint Effects brush stroke performed independently from the NURBS object on which it was painted P r o x y _ S p h e r e , and run through the Time Slider again. You'll see now that the curve on surface animation was just an illusion. 6. Reload C h i n e s e _ D r a g o n _ R e v i s i t e d A . m b . (Make sure you load C h i n e s e _ D r a g o n _ R e v i s i t e d A . m b , not C h i n e s e _ D r a g o n _ R e v i s i t e d B . m b . ) OpentheTendrils group, and you will see the rest of the duplicated brush strokes. There are a total of 60 instances of s t r o k e 1 . By selecting various numbered brush strokes, you can easily see that all instances do not lie on the surface of P r o x y _ S p h e r e . Performing any actions directly on any single brush stroke will not affect the others as you might expect. Try it for yourself. If you lose the original configuration, simply reload C h i n e s e _ D r a g o n _ R e v i s i t e d A . m b .

• Organix and Paint Effects

Great! Now we can begin to see something more interesting by toying with Proxy_Sphere. 7. Load C h i n e s e _ D r a g o n _ R e v i s i t e d C . m b .

8. In the Outliner, select P r o x y _ S p h e r e and go to the camera l perspective view if you are not already there. 9. Press w on the keyboard to select Translate mode, and select P r o x y _ S p h e r e at its origin handle. Moving the sphere around in 3D gives you a good idea why I called my scene Chinese Dragon. " The original brush stroke, while animatable, will not transfer its actions to its 59 instanced strokes as you might suspect. Scrolling through the Time Slider makes it obvious that the instances are reacting to the animation on s t r o k e 1 . However, I created this animation before creating the instances by animating the curve created by the initial brush stroke. This curve has since been deleted, but would be required to perform instanced stroke animation.

10. To make P r o x y _ S p h e r e invisible, turn off Visibility in the P r o x y _ S p h e r e Channel box by entering off or 0 in the visibility channel. Turning off visibility does not, however, stop you from animating P r o x y _ S p h e r e to control the 60 Paint Effects brush strokes. Selecting P r o x y _ S p h e r e in the Outliner or Hypergraph and selecting an action displays the proper handle, and you can set keyframes on the invisible object just fine! If you are using this invisible control technique to animate a Paint Effects organix primitive, it makes sense to animate with the object invisible. 11. Load C h i n e s e _ D r a g o n _ F i n a l . m b from the CD, and open the Outliner once more. This is the final version of the binary, updated to Maya 4. The animation of the dragon is also rendered as a QuickTime Movie on the CD and is named c h i n e s e _ d r a g o n _ r e v i s i t e d 3 2 0 Q t s o r e n 3 . m o v . The rest of the scene is composed of two separate organix chains, created with instanced NURBS geometry. The original geometry on each chain is nothing more than a distorted, 3D-textured, NURBS sphere, animated by the same techniques for instanced geometry described at the beginning of this chapter. I also added a second instanced Paint Effects primitive to P r o x y _ S p h e r e and animated it in exactly the same fashion. The final animation was the direct result of experimentation, with no particular goal in mind other than interesting organix type motion.

Other Organic Programs and Maya I use several programs in conjunction with Maya to create organix (as well as other things). One that stands out as a sleeper hit and bears mentioning is Xfrog from Greenworks. Xfrog is a procedural modeling and animation program that fits into the core of the organix ideal. With a set of Xfrog "components," you can design sophisticated organic models. Using Xfrog, I quickly modeled the multi-legged creature in the image "Pinos Mellaceonus" (see Figure 3.39). Greenworks has graciously allowed us to put a full demo of Xfrog 3.5 on the CD. It includes tutorial information and some great models and animation files. I have used Xfrog

77

78

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.39:1 modeled the "Pinos Mellaceonus" insect in Xfrog. Texturing and other models were done in Maya.

to create both real and abstract models. The palette of tools is not overwhelming but allows you to fashion some highly detailed models, be they imagined or real. A reasonably proficient user can model anything from a pineapple to a whole banana tree (see Figure 3.40). Earlier I mentioned that you can finely craft the intimate parts of a flower to exacting detail using this program. Although you would be hard pressed to model a horse (impossible I think), anything natural that conforms to organix type rules is fair game for Xfrog. A fly's eye to rows of teeth or a volvox to salmon roe, and any plant imaginable, are well within the grasp of Xfrog. It also has some interesting animatable features that allow you to animate a finely detailed tree or plant, from seed to maturity. Greenworks has written a Maya plug-in that imports Xfrog-created models and animation (. x f r files). As you go through the Greenworks tutorials on the CD, some texture problems might arise. Xfrog uses PNG and the full supported TIF image formats. Maya once read PNG in an earlier version, but this functionality was removed for some reason in later versions. Maya has never correctly read the full flavor spectrum of the TIF file format. These are shortcomings on Maya's part that I have been lobbying to have corrected, but at present they are a bit of an

Organix and Paint Effects

Figure 3.40: The Xfrog interface with the highly detailed and textured model of a banana tree

intractable problem. However, the Maya plug in does a great job of importing the models and the Xfrog animation as well. The CD includes a few Xfrog files that I have converted into Maya 4format. Also on the CD is an original abstract animation ( X f r o g _ p r i m e d 3 2 0 Q T s o r e n 3 . m o v ) I created in Xfrog and then imported to Maya for texturing and rendering. The Tip of the Food Chain As forewarned at the beginning of chapter, in these pages we have barely nicked the surface of organix. The simple techniques and examples in this chapter, albeit fascinating in their own right, represent a small portion of the 3D basics of organix. Years ago pioneers were interested in the biologic theory of computer graphics. My second strong CG influence was the work of Karl Sims. His groundbreaking animation "Panspermia" was the talk of Siggraph in 1990. Sims wrote his own software based on biological "self-evolving" algorithms that created, moved, reproduced, and evolved 3D geometry (biological geometry) based on rules gleaned from nature. I hope the images in Figure 3.41 are inspirational to you. There is an amazing cult of individuals interested in self-evolving computer graphics. If you're interested, you can head to my website at www.absynthesis.com to find out more.

79

80

C H A P T E R 3 • Organix—Modeling by Procedural Means

Figure 3.41: A series of images from the award-winning animation "Panspermia" by Karl Sims. See h t t p : / / w e b . g e n a r t s . c o m / k a r l / i n d e x . h t m l for more information on Karl's work. All images © Karl Sims. All rights reserved.

Organix and Paint Effects

Summary As we come to the end of this chapter, I offer some final parting ideas and thoughts of what was hinted at yet not given treatment here. The idea of passing a brush stroke across multiple surfaces led me to think about Paint Effects and Maya Dynamics. The ability to apply hard/soft body dynamics to Paint Effects laden geometry gives some added intrigue to animation. It also then stands to reason that we can affect Paint Effects brush strokes in other dynamic ways as well. Forces such as gravity hold interesting promise for experimentation too. I have done interesting experiments with deformers and constraints (springs, nail, and hinge). MEL as a programming language is formidable in developing self-evolving Maya worlds right within the program itself. I have included on the CD some simple Maya binary files to enable you to delve into a few of these issues. By dissecting these binaries, you might spark your own ideas and move in new directions. These files are located in the chapter directory under B o n u s _ B i n a r i e s . Whatever you do, experiment with abandon, and have fun!

81

Chapter Four:

Animation and Motion CaptureWorking Together

Chapter Five:

Lip-Synching Real-World Projects

Animation and Motion Capture Working Together Robin Akin and Remington Scott

has often been seen in a competitive role with traditional keyframed animation, this chapter will deal with using keyframe animation and motion capture together to create complex animation more efficiently than either method could on its own. In general, motion capture data can be used as a base onto which keyframed animation can be built. The complex motion of human (or humanlike) characters can be blocked out very quickly by a live actor in a mocap session. Onto this base layer of animation, you can add keyframed animation in a nondestructive manner, which allows you to add personality to the character, move certain body parts, and otherwise adjust the motion capture animation to fit the needs of a specific scene. We'll cover methods of combining these two forms of animation, which have been used successfully in a number of films, and we'll include some exercises that will put the theory into practice.

What Is Motion Capture? Motion capture, commonly referred to as mocap, is digitally capturing the motion of something in the real world and translating the end result into data that can be applied later in animation software. Many animation houses and visual effects studios use motion capture as an animation tool in a variety of ways. You'll find motion capture in films, commercials, and video games and in just about any area of computer graphics that requires realistic human motion. More often than not, you'll see human movement mocapped, but you can digitally capture even the motion of inanimate objects such as cameras. You can also mocap props to help with positioning in a scene.

© 2002 FFFP

86

C H A P T E R 4 • Animation and Motion Capture—Working Together

Sensors capture the data and then plot the data's individual coordinates in space. The most popular systems use optical or magnetic sensors. Optical systems involve special cameras that surround the capture area, facing the subject. Small reflective spheres are placed in strategic points on the body, and the coordinates of each ball in 3D space are captured and translated into data that can be read into an animation program. Magnetic systems rely on cables to transmit the data of the coordinates. Another term you'll hear in relation to mocap is performance animation. Performance animation typically refers to mocap that focuses on human motion, for example, the specific style of a famous person's movements. Often, the point of choosing performance animation as a technique is to capture the nuances of the movements specific to a personality. Andre Agassi's tennis moves or the distinct dancing of Michael Jackson are two examples of celebrities who have been mocapped for the purpose of recording their distinct style of movement.

On the Technical Side In an optical mocap system, at least two cameras must see each marker in order to triangulate the position of that marker in a calibrated volume or zone. Generally, the more cameras in an optical system, the more (additional, repetitive) coverage of each marker, lf a marker is obscured from the view of the cameras, a gap appears in the marker data until the marker can be seen from at least two cameras again. Gaps in the data are not easy to deal with, because this missing information is a portion of your subject's action. Filling these motion gaps has been tedious in the past, but improvements in camera resolution, image quality, and software are solving these technical issues.

Animation and Mocap As we mentioned earlier, mocap is a tool you can use to get the desired animation result. If we could get the word "tool" to blink on a printed page, we would. Motion capture, like computer animation in general, is simply a means to an end. In our experiences, at times mocap data needs to be "massaged" to get the intended result, but at other times this tool has been a huge time saver when the action matched exactly what was planned for the animation. In those cases, mocap buys time for more challenging shots, such as those that might need to be keyframed using traditional methods. The decision to use mocap does not always mean replacing traditional keyframing. Often, you can combine the two methods or use mocap only for shots when it's useful or appropriate. That was the established approach in productions such as Titanic and Final Fantasy: The Spirits Within. As they say, "necessity is the mother of invention," and over the years, necessity has brought about the development of different types of hybrid motion capture and keyframe animation processes and pipelines. We have found that the best-case scenario is a situation in which the animator has a setup that allows motion capture and traditional keyframing to be combined as the animator sees fit. Using this approach, you can override the mocap when it's needed, and you have more control over when to use each method. In the end, you are the judge of whether the result was what was intended. It's best to have as much flexibility as possible.

When Should You Use Mocap?

When Should You Use Mocap? Mocap generally shines when used to animate human or anthropomorphic, bipedal characters. In some circumstances, it has been used to realistically re-create the motions of animals. Motion capture is not always a good choice when it comes to humans enacting the motion of other creatures. For example, you may recall the "guy in a suit" syndrome of Godzilla. At one point, mocap was chosen to animate Godzilla, but in the end it was reconsidered, and animators keyframed the creature. This was primarily because the character's skeletal structure and the structure of a human simply weren't compatible enough to get believable results for that time. The same is true of characters that squash and stretch, such as cartoony characters. In its present state, mocap can't handle squash and stretch well. They're just two different and "too different" styles. Used for some time for background characters, crowds, or stunts, mocap is fast becoming a desirable method that filmmakers use to create realistic digital performers. At Square USA, we used mocap to create lifelike human performances for the animated characters in Final Fantasy: The Spirits Within. What if a movie has wrapped, but a scene needs to be changed and the actor is no longer available? A digital version of that actor may be the solution. Or, what if an actor must interact with a digital element such as a humanoid alien creature that needs to move realistically? Consider using motion capture. If an actor is placed in a dangerous situation or if that actor must perform an action that they cannot do without harming themselves, mocap can be a viable alternative. For example, in a scene from the feature film Final Fantasy: The Spirits Within, the lead male character Gray jumps through a glass window, falls from more than 25 feet onto solid ground, tumble rolls forward, and gets up. A jump from three stories onto a hard surface could seriously injure any one, even a stunt man. To complicate matters, we didn't want to use a stunt man because the motion of a stunt man would not match that of the actor playing Gray. We solved this by dividing the motion into three segments. In the first segment, the actor breaks through the glass and jumps from a platform of about 4 feet in height; in the second segment, Gray's fall is keyframed; in the third segment, the actor again jumps from the platform, only this time he focuses on the landing and his reaction to the fall. We then blended these three segments to form one continuous action. Here's a short list of some ways that mocap has been used to create realistic motion in feature films: • • • • • • • • • •

Gladiator, crowds in the Roman colosseum Titanic: passengers on deck and stunt characters The Patriot: battle scenes The Mummy: crowds and mummy characters The Mummy Returns: principal actor SFX shots, pygmy mummies, and Anubis creatures Star Wars: The Phantom Menace: robots and humanoid creatures Lord of the Rings trilogy: battle crowds, Gollum, principal actor SFX shots, and distant Orc shots Enemy at the Gates: CG soldiers and crowd scenes Pearl Harbor: digital sailors Final Fantasy: The Spirits Within: human character animation

87

88 C H A P T E R 4 • Animation and Motion Capture—Working Together

A New Medium of Expression? Think of this sidebar as an acknowledgment to the animator's alter ego, the mocap performer. Despite the popular beliefs of many in the entertainment industry, realistic digital actors will not replace human actors. When you use motion capture, an actor performs the action that helps bringthe digital character to life. At the foundation of the fusion of motion capture and animation is the motion-captured performance: an exact digital recording of an actor's motions. The essence of the performance is the emotional, psychological, and physical presence of the actor and their relationship to other performers, the environment, and the audience. Can motion capture be a new medium of expression for the next generation actor? Advances in digital technologies and motion capture have allowed actors to expand beyond Hollywood typecasting such as what you look like. Actors can explore new opportunities and create memorable performances and characters that they would never have been able to play previously because of ethnicity, age, or look. The success of motion capture is based on the performer's talent to emote through their actions instead of appearance. lf the final result of your animation is to be cartoon like and you use motion capture as a foundation, work with a very animated performer, keeping in mind that you will most likely need to interpret and enhance the performance, especially in situations that require squashing and stretching of the character. However, if you are looking for a realistic performance, steer clear of actors who cannot express themselves through subtleties of motion.

Using Motion Capture as Reference or Straight out of the Box To animate a character believably, seasoned animators act out their shots and use reference material to observe timing and weight. They can then apply those observations when animating a character. Just as video reference and mirrors are useful to animators, mocap can be a good reference. At times, the motion capture is near perfect, and with just a minor cleaning, the shot's complete. At other times, you need to significantly change the shot. You might need to solve technical problems with the data , or you might need to slightly alter the character's behavior, which ends up requiring extensive hand keyframing. Even in these cases, the mocap can be useful as a reference for timing. The strength of motion capture is its ability to record fine details of motion. Most optical systems record markers on a sub-millimeter level, allowing for an extremely high fidelity of subtlety and nuance in your animation. Mocap has been used extensively in the past for shots that include fighting, running, stunts, and other broad-motion actions; however, with the capability to capture the slightest movement, this technology enhances effects shots that require a heightened sense of reality. The decision about whether to use mocap straight out of the box, meaning using the captured motion without changing it, often depends on the circumstances surrounding the shot.

Using Mocap for Reference Studios such as ILM have used motion capture for character reference, as have animators at Square USA, Digital Domain, and other studios. Digital Domain's use was most apparent in

Using Motion Capture as Reference or Straight Out of the Box

James Cameron's film, Titanic. Titanic was a significant film, especially in the computer graphics industry, for its visual effects. Some of those effects were produced by animating human characters through the use of keyframing, motion capture, and at times a combination of mocap and keyframing. Mocap was used mainly in two ways. For normal actions, such as people walking around on the deck, it was often used directly. It was used as reference for some of the stunt work such as characters climbing on the railings.

What About Rotocapture? Rotocapture is a term that was coined to describe an early technique for combining mocap reference and keyframe animation. Mocap was used as a reference, and the animation model was "rotoed," or posed into position over it.

Rotoscoping and Motion Capture as Reference? The theory of using mocap as reference is similar to using live-action reference footage when animating humans and animals. This concept is covered well in the classic animation reference, The Illusion of Life, by Frank Thomas and Ollie Johnston. This book chronicles the development of Disney animation, is a valuable resource for animators, and is an excellent addition to any animator's library. The Illusion of Life has been out of print for a while, but with luck, you can probably find it for sale online and through used book stores. Chapter 13, "The Uses of Live Action in Drawing Humans and Animals," covers how to use reference material. The authors stress several concepts, including how important it Is to use reference footage as a guide, but not necessarily directly as the animation. They also describe how helpful the footage can be when you are studying and perfecting certain actions.The development of Disney's Snow White was helped a great deal by animators who had the opportunity to study human motion through rotoscoping. Debate continues to this day as to whether or just how much of Snow White's motion was handled with this technique. The Seven Dwarfs were animated traditionally, and live-action film was used as resource material. It helped in developing character gestures and attitudes, as well as in examining the intricacies of a human being's actions. You can learn a lot about the subtleties of movement by examining liveaction footage in detail. Motion capture can be equally helpful when approached with the same mindset.

Rotocapture and rotoscoping are similar techniques in that they both require an artist to animate on top of existing reference material. The main difference is that in rotoscoping the artist animates over a 2D plate or image, and in rotocapture the artist animates over 3D motion data. The limitation of rotoscoping is that you have only one perspective to use as reference, whereas with rotocapture you can move the camera virtually anywhere in 3D space. Animators have encountered two problems with rotoscoping: it can be extremely timeconsuming, and it can be creatively frustrating. In 3D animation especially, rotocapture is becoming more antiquated with the advancement of motion capture technologies and animation pipelines. These improvements let you use motion capture as a basis for your animation. In essence, mocap delivers the basic elements of weight and timing with a foundation grounded in real-world physics. You can layer keys on top of motion capture data and add layers of more creative and thoughtful elements to the character's performance. You can also use the raw mocap as reference for timing in animating characters, while preserving the ability to keep more creative control over the process.

89

90

C H A P T E R 4 • Animation and Motion Capture—Working Together

Recommended Links and Other Resources You can learn more from the following sources. You'll also find a great deal of useful information about motion capture and keyframed animation on the web. • • • • • • • •

FILMBOX,at www.kaydara.com/ Motion Analysis, at www.motionanalysis.com/ VICON,at www.vicon.com/ Biovision,at www.biovision.com/ House of Moves,at www.moves.com/ Motion Analysis Studios, at www.performancecapture.com/ The Illusion of Life: Disney Animation, by Frank Thomas and Ollie Johnston (ISBN-0-7868-6070-7) All of Eadweard Muybridge's photographic studies of figures and animals in motion

Motion Capture and Final Fantasy: The Spirits Within Hironobu Sakaguchi, the director of Final Fantasy: The Spirits Within, believed his vision could only be told through realistic human digital animation. The story required that the emotional range of the characters be genuinely human, breaking away from animation's tradition of exaggerating character actions. Early in preproduction, we decided that motion capture would play a central role in creating realistic digital humans, but we were also dedicated to the skills of the animators and wanted to ensure that the animation department was as actively challenged as the motion capture department. The big hurdle we faced early on was: what would we keyframe and what would we capture? This question was answered in two ways. First, we decided to use mocap for human body skeletal movement, as seen in Figure 4.1, but for the complex facial expressions, mocap could not equal the quality of the performances that the animators created.

All animation for Final Fantasy: The Spirits Within needed to be completed wlthin just over a year and half, and that goal was met. Production for the entire movie, however, spanned approximately four years.

Second, we decided to ensure that the animation department had the necessary tools to animate over the motion capture, in order to tweak it as a whole or in parts. Square USA developed a pipeline to ensure that the animation and mocap departments could work together. Square USA created a proprietary toolset in Maya that allowed a "hybrid" motion capture and keyframe animation process. Using the methodology of a motion-animation pipeline that supported a workflow of motion capture and animators working together, we were able to decide on a per shot level how much mocap to use straight out of the box and how much to animate over or replace completely. It wasn't always one or the other—all mocap or none. For the humans, most of the time it was a blend. For example, we might tweak some parts of the body for certain shots. Aki's hips might need more rotation, or parts of the body, such as the arms, might be keyed, and others, such as the legs, might be mocapped. Sometimes we combined keyframe animation with mocap to accommodate a change in a character's action.

Cleaning Mocap

Figure 4.1: Square USA utilized motion capture to create realistic human subtleties and nuances for the performances of computer-generated characters in Final Fantasy: The Spirits Within. Copyright © 2001 FF Film Partners. All rights reserved. Square Pictures, Inc.

When details are overlooked in the capture session, the result can mean more work than anticipated for the animation department. Generally, the primary reason for unnecessary changes to the motion capture data is that intensive preproduction development has been overlooked or glossed over. You must plan every aspect of your character, from what they say, to who they interact with, and how they do it. Missing small details in casting, timing, set design, dialogue, or interaction will catch up with you in motion editing or post motion capture animation production and affect your delivery schedule and your budget.

Cleaning Mocap You might have heard that after a motion capture session is completed and the data is handed to an animator, it still needs cleaning. In a large production pipeline, a service bureau or motion capture technicians may have done some cleaning before an animator deals with the mocap data. Depending on your pipeline, the data may still need some attention to improve the quality of the result. What does it mean to "clean" mocap? Standards of clean vary. For our purposes, we define clean as data that preserves the key poses of the performance and does not have technical issues such as flipping joints or noisy vibrations in the curves.

91

92

C H A P T E R 4 • Animation and Motion Capture—Working Together

Mocap data can be very clean if the conditions at the time of capture are ideal, but that's not always the case, unfortunately. In the past, an animator often ended up massaging the data one way or another to get the desired result. You need to make sure that the motion capture team you work with can provide clean data. Ask for sample data to see how much, if any, clean-up you need to do. Your data might need to be cleaned for many reasons, but the motion capture team should be experienced enough to deliver clean data to you. The quality of your data has a lot to do with the artistic and technical capabilities of the motion capture data tracker and editor.

Things to Watch For The mocap process usually involves optical markers or magnetic sensors on the body, and these markers and sensors need to be fastened securely. Often it can be difficult to prevent the unwanted vibration of some markers. For example, you might have a sensor or a marker on a foot that still wobbles a small bit when the actor moves around. This small vibration shows in the data as noise (see Figure 4.2). Magnetic sensors may show metallic or magnetic interference in their curves. In Maya, noise is seen in curve data in the Graph Editor, usually as regular peaks and valleys. Looking at mocap data in the Graph Editor is much the same as looking at an audio curve's frequencies. Filters help average and eliminate noise, but you must apply them carefully. They can over-process or wipe out subtle performance details.

a.

b. Figure 4.2: In the top image, motion capture data shows noise. In the bottom image, a cleaning filter operation has been applied to the curve to minimize the noise.

Cleaning Mocap

Beware of over-cleaning and over-filtering. Noise reduction filtering is often a necessary part of the clean-up process. However, you can over-clean mocap to the point that it looks strange, unnatural, and "floaty" (the character seems to float along instead of having a sense of weight to its motion). When looking at the curves, determine if you need to clean the entire curve or only a segment of it. This is where selective cleaning comes in. Modifying the curve should affect only problem areas, preserving important details and poses.

Because noise is typically a high-frequency jitter, sometimes it's more obvious in a highresolution skinned model than in a low-resolution animation proxy model. If in doubt, doublecheck the final animation on a skinned character before calling it finished.

Blending with Keyframe Animation The trickiest part of blending mocap and keyframed animation is to keep a consistent look. Be sure that one shot doesn't look purely mocapped and another handkeyed with a completely different style. If you take a look at the distinctly different styles of two animators that animate the same character, you'll get the idea. You can modify mocap in several ways, and you can blend it with animation. We'll look at some examples in the next section. Figure 4.3 shows an illustration of the model with some of the controls displayed in the Layer Editor. In the examples that follow, you will use the action of a glamorous, well-poised female model walking the catwalk. Each example concentrates on using motion capture and modifying it with keyframe animation. We won't get into detail about how the character is set up, because there are too many methods. That's a whole chapter in itself and is dealt with elsewhere in the

93

94 C H A P T E R 4 • Animation and Motion Capture—Working Together

Figure 4.3: The model with some of the controls displayed in the Layer Editor

book (see Chapter 1, for example). We designed these examples to have a plug-and-play feel to them so that you can simply load the mocap and start animating on top of it.

Offsetting Existing Mocap

The motion capture that you will use for these examples is that of our model walking a straight line on a flat surface. The walk is just right for the shot, but the director wants a bump in the surface. For the first example, you'll use the mocap data and create an animation over that, featuring the model's reaction to the surface's change in height.

Cleaning Mocap

If you were to animate the mocap skeleton, you would edit the keys in the motion capture f-curves, which permanently affect the mocap data. We highly recommend not doing that because of its destructive nature. In this example, we'll animate an offset skeleton that is driven by the mocap data. Using an additional skeleton, you can adjust the mocap without destroying it. You can use a setup in which the identical skeleton—the offset skeleton—has its IK handle, joints, and pole vectors point-constrained to locators that are parented to corresponding joints on the mocap skeleton. When there are no adjustments to the offset skeleton, the two skeletons are in perfect alignment and overlap. When you move the locators of the offset skeleton, the second skeleton becomes apparent. You can animate the controls to literally offset the mocap in order to get the desired result for the animation. Essentially, you animate slight changes on top of the mocap data while retaining the capture data's purity. This example illustrates how slight changes to the offset skeleton drastically alter the action of the character without affecting the motion capture data. A practical use of the offset skeleton involves slight retargeting of the controllers. For example, you capture an actor reaching for a doorknob, turning it, and opening a door, but in the scene file the doorknob is at a different height than the original. Simply move the offset locator for that hand to the new location, and the skeleton will follow. The f-curves are not deleted, nor is the capture data destroyed.

We would like to thank Florian Fernandez for providing the animation model, setup, and MEL script on the CD that accompanies this book. You can visit his web page at www.flo3d.com. We would also like to acknowledge Spectrum Studios for providing the motion capture data.

Load the Scene File

From the CD, load the scene file W a l k . m b . When you play the animation, which is driven by mocap data, you should see a low-resolution model of a woman walking. For most optical motion capture recording sessions, the action is captured at a frame rate in the range of 60 to 120 frames per second. The reason for such high-speed capture is to ensure that the markers do not blur. The technology behind tracking markers accurately

95

96

C H A P T E R 4 • Animation and Motion Capture—Working Together

depends on the software being able to find the center of the marker. If a marker blurs, it becomes elongated, and the position of the center of the marker is less accurate, causing jitters in the data. The mocap for these examples was captured at 60 frames per second, but you'll need to change the frame rate to fit either the film (24 frames per second) or the NTSC (30 frames per second) standard for playback. In this example, we'll set the frame rate to video NTSC, which is 30 frames per second. You will also want to turn off the Auto Key feature and this can be done in the Preferences window also. To adjust preferences, follow these steps: 1. From the Marking menu, choose Window open the Preferences dialog box:

Settings/Preferences

Preferences to

2. From the Categories list, select Settings to open the Settings: General Application Preferences window. In the Working Units section, set the Time field to NTSC (30fps). Also, make sure that Linear is set to Foot. At the bottom of the window, click the Save button. 3. Turn off Auto Key in the Keys window under Settings. Clear the Auto Keys check box. The motion capture animation now ends at frame 191. Make Sure That the Control Components Are Visible To make the control components visible, follow these steps: 1. In the Scene Menu bar, LM click Show to display a drop-down menu. Make sure that the NURBS Curves check box is checked. You can't see any of the controls if the NURBS Curves check box is not checked. Scrub the Time Slider, and you will see that, along with the low-resolution model walking, there is a letter C in a cube The C is the Control box, a toggle switch that changes control from the offset skeleton to the animation skeleton. You won't use this element in this example. 2. In the Channel box, click the middle icon to display the Layer Editor.

Cleaning Mocap

3. Scroll down to the animControlsL, animControlsR, and animControls layers. Turn off visibility for each layer by clicking the V in the box to the left of each layer name. The result is that the animation skeleton in the scene is hidden. 4. Select the cube with the letter C in it. In the Channel box, as shown in Figure 4.4, make sure that Mocap_keyframe is set to 0. This value toggles the offset or animation skeletons to fit onto the mocap skeletons. Once the value is set to 0, you will not need to do anything more with this Control box.

figure 4.4: The Control box

Notice in the workspace window the five yellow cubes on the model's body: two at her wrists, two at her ankles, and one at her root. These are the offset controllers that we will animate. All the cubes move in X, Y, and Z, but only the root cube moves and rotates. To make the cubes easier to select for animation, follow these steps: 1. Select the yellow cube at the root, and make sure that nothing else is selected. From the Marking menu, choose Display Component Display Selection Handles to display a small selection handle above the geometry in the center of the cube. The selection handle always appears on top of the geometry. When the selection handle is selected, you are controlling the root offset controller. Dragging a selection box over the root area selects only the selection handle of the root offset controller.

97

98 C H A P T E R 4 • Animation and Motion Capture—Working Together

2. Select the yellow cubes at the wrists and ankles. Choose Display Component Display Selection Handles to display all the offset controllers. This makes selecting and deselecting these nodes easier. Drag a selection box around the model's body. All the offset controllers are selected, and none of the geometry or joints are selected. Figure 4.5 displays the selection handles for offset controllers. Lock All Rotation and Scale Values for the Wrists and Ankles To lock the rotation and scale values, follow these steps: 1. Select the offset controllers for the wrists and ankles. In the Channel box, click and drag down to select the Rotate X, Rotate Y, Rotate Z, Scale X, Scale Y, and Scale Z attributes. RM click and hold to open a pop-up menu. Select Lock Selected to lock the attributes and gray them, as shown in Figure 4.6. Since the root offset translates and rotates, we will only lock the scale attribute for that node. 2. Lock the Scale attributes for the root offset controller. 3. Save this scene as O f f s e t . m b . You will use this scene for the examples that follow. Animate the Offsets Before we start animating our model walking over the bump, let's play a little with the offset controllers to see exactly what they do. First, set a key on the five offset controllers in order to retain their original positions. Follow these steps: 1. Select all of the model's offset controllers, go to frame 0 in the Time Slider, and set a key.

Figure 4.5: Displaying selection handles for offset controllers

Cleaning Mocap

Pressing s on the keyboard is a shortcut for choosing Animate Key.

99

Set

2. Select the model's root and wrist offset controllers. Set keys for these nodes at frames 14, 35, 56, 78, 101, 122, 143, 165, and 187. 3. With the root and both wrist offset controllers selected, go to frame 25. Use the Move tool to translate the model's upper body down so that her knees are slightly bent. Set a key. 4. To copy this key to frames 45, 68, 90, 111, 133, 153, and 176, first make sure you are on frame 25 in the Time Slider. You can press the comma key to jump forward to keys in the timeline, and you can press the period key to jump backward. MM click anywhere on the Time Slider and hold. (MM dragging in the timeline lets you change time without updating the scene.) Drag your mouse to frame 45 and release. Set a key. You have copied frame 25 to frame 45. Continue to copy this key to the remaining frames. Play the animation. The model looks as if she has a heavy weight on her shoulders because of the bounce we created in her walk. You can adjust the f-curve of her bounce in the Graph Editor. Follow these steps:

Figure 4.6: Lock the attributes on the wrist and ankles for Rotate X, Y, Z and Scale X, y, Z. Also lock the attributes for the root offset controller for Scale X, Y, Z.

1. Select the model's root and both wrist offset controllers. In the Marking menu, choose Window Animation Editors Graph Editor to open the Graph Editor. 2. Hold down the Ctrl key and select the Translate Y nodes for armOffsetL and armOffsetR. Also Ctrl+select the Translate X node for the rootOffset node. We set up this character with the XTranslation used for vertical motion on the rootOffset, rather than YTranslation. The only time this appears is in the rootOffset node.

3. In the Graph Editor, shown in Figure 4.7, you should see the f-curves representing the model's root and right and left wrist offset nodes forming a sine-like wave between 0 values and negative values. LM click and drag a Selection box around all the keys that appear in the Graph Editor in the negative value range. All the keys that appear in the 0 value range represent the model's offset controllers in the normal stance. All values that appear in a negative value represent her offset controllers in the squat position. 4. With the negative value keys selected, select the Move tool, and then Shift+MM click inside the Graph Editor to display an icon that consists of an arrow and a question mark. This will constrain your movement of the selected keys to either a vertical or horizontal movement within the Graph Editor. By moving the mouse cursor upward, you choose the vertical constraint, and the keys move closer to or farther from the 0 value in the Graph Editor. Shifting the negative value keys closer or farther from the 0 value makes the model's root and right and left wrist offset nodes drive her upper body up or down, which affects the amount of bend in her knees. Adjust the keys according to your preference to make the model look as if she is carrying a heavy burden on her back (see Figure 4.8). When you're ready to move on, save this scene as H e a v y W a l k . m b , and load O f f s e t . m b .

100

C H A P T E R 4 • Animation and Motion Capture—Working Together

Figure 4.7: In the Graph Editor, select the keys that are in the negative value range.

Figure 4.8: Translate the model's offset controller keys closer to the 0 value to lessen her upper body plunge (or move them farther from the 0 value to increase her drop). Animating Walking over a Bump in the Terrain To make the bump, follow these steps: 1. Choose Create Polygon Primitives Cube.In the Channel box, set Translate X to 7, set Translate Z to -3, set Scale X to 4, set Scale Y to 0.5, and set Scale Z to 1.5. When you now play back the animation, you will see the model's foot pass through the cube as she walks (see Figure 4.9).

Cleaning Mocap

Figure 4.9: Notice that at frame 50 the model's left foot sinks into the cube.

Figure 4.10: At frame 50, the model's left foot lands on the platform and does not sink through it. The ankle is offset by a value of30 in Translate Y. Now, let's make the bump affect the model's left foot when she places it down at about frame 50 (see Figure 4.10). Follow these steps: 1. In the Perspective window, select the left ankle offset controller. Go to frame 30 in the Time Slider and set a key. This is the first frame of animation for this offset. 2. Go to frame 36. In the Channel box, enter a value of 30 in the Translate Y field. Set a key.

101

102 C H A P T E R 4 • Animation and Motion Capture—Working Together

Play the animation. It looks as if the model raises her foot starting at frame 30 and steps on the bump at frame 50. However, she continues to walk for the remainder of the animation with her left foot on an invisible elevated platform and her right foot at ground level. Your animation should look like the movie b u m p L e f t L e g P l a t _ s i d e V i e w . m o v on the CD. Let's bring our model's left foot down so that she appears to walk only on a bump and not on a platform (see Figure 4.11). Follow these steps: 1. In the Time Slider, MM copy frame 36 to frame 72. Set a key. This ensures that the model's foot is raised between frames 36 and 72, the duration of time that this foot is on the bump. 2. In the Time Slider, MM copy frame 30 to frame 86. Set a key. At frame 86, the model's left foot is back in the normal offset position. Your animation should now look like this movie b u m p L e f t L e g _ s i d e V i e w . m o v on the CD. Switch to the Side window. As you play the animation, notice that although the model's left foot rises to step on the bump, her right foot does not elevate and appears to move through the bump. Let's fix that (see Figure 4.12). Follow these steps: 1. In the Perspective window, select the right ankle offset controller and set keys on frames 50 and 69 in the Time Slider. 2. Go to frame 56. In the Channel box, set a value of 60 in the Translate Y field. Set a key. Your animation should now look like the b u m p L e g s O n l y _ s i d e V i e w . m o v movie on the CD. Our model's feet are looking better, but her upper body needs to react. Let's adjust her root (see Figure 4.13). Follow these steps: 1. Select the root offset controller. Set keys on frames 50 and 84 that define the duration of time for her root animation. Next, we will translate her root offset up.

Figure 4.11: After frame 86, the model's left foot is positioned back on ground level.

Cleaning Mocap

Figure 4.12: The model's right ankle is raised by a value of60 in Translate Y. Her foot no longer intersects the geometry of the platform.

Figure 4.13: Translating the model's root offset controller affects her whole upper body.

Remember that on thls model, the rootOffset's Translate X value takes the place of the Translate Y value. Therefore, when you translate the root offset controller up and down, enter values In the Translate X field in the Channel box.

2. With the root offset controller still selected, go to frame 56 and set a value of 35 in the Translate X field of the Channel box. Set a key.

103

104 C H A P T E R 4 • Animation and Motion Capture—Working Together

3. In the Time Slider, go to frame 68 and set a value of 9 in the Translate X field of the Channel box. Set a key. The keys you just set have lifted up the model's root. Now let's add a key that acts as the follow-through for her body weight coming down. 4. Go to frame 75 and set a value of -18 in the Translate X field of the Channel box. Set a key. Now let's work on making the model's hands move with the rest of her body. Follow these steps: 1. In the Perspective window, select both the right and left wrist offset controllers. Set keys on frames 40 and 82. 2. Go to frame 56. In the Channel box, set a value of 35 in the Translate Y field. 3. At frame 69, set a Translate Y value of 10, and at frame 76, set a Translate Y value of-13. Play the animation. She walks and steps on top of a bump that wasn't there when the action was captured. Let's fine-tune the animation. You might have noticed that the model's left foot sinks slightly when she steps on the bump. Let's fix that in the Graph Editor. Follow these steps: 1. Select the left ankle offset controller. Open the Graph Editor, and select the Translate Y value under the legOffsetL node. You will see the Y translation curve. If you do not see the f-curve in its entirety, in the Graph Editor choose View Frame All, or for a shortcut press the A keyboard key. 2. LM drag a selection box around the keys you placed at frames 36 and 72. Both keys are selected, and the selection handles appear for each selected key (see Figure 4.14). 3. In the Graph Editor, choose Tangents Flat from the drop-down menu (see Figure 4.15). For a final touch, add rotation to the model's hips (see Figure 4.16). Follow these steps: 1. Select the root offset controller, and go to frame 56 in the Time Slider. Select the Rotate tool, and rotate the root offset controller so that the model's left hip is higher than her right hip. Set a key. 2. Go to frame 75, and rotate the root offset controller so that the model's right hip is higher than her left (see Figure 4.17). Set a key. 3. Save this file as B u m p . m b .

Figure 4.14: In the Graph Editor, select frames 3 6 and 72 on the legOffsetL Translate Y curve.

Cleaning Mocap

Figure 4.15: Flattening the tangents creates a plateau in the curve, which stabilizes the model's foot and places it firmly on the ground.

figure 4.16: Creating hip rotation. The more the hip rotates, the more swagger and attitude. Play your animation. It should look like the b u m p C o m p l e t e _ s i d e V i e w . m o v and b u m p C o m p l e t e _ p e r s p V i e w . m o v movies on the CD. To get a better view of your animation, hide the mocapSkeleton, offsetControls, and offsetSkeleton in the Layer Editor. You should see only the bindSkeleton layer. With these settings, there is no additional information on the character to distract your eye when viewing her animation.

An offset controller is a subtle but powerful animation tool when working with mocap. You can use it to animate small changes in the motion capture character in a speedy

105

106

C H A P T E R 4 • Animation and Motion Capture—Working Together

Figure 4.17: Rotate the hips so that the right hip is higher than the left.

and efficient manner. If you are not happy with the results, you can delete keys from the offset controllers without affecting the mocap data.

Using the Trax Editor to Animate on Top of Existing Mocap Data

In this exercise, we will again work with our model that walks with poise and attitude. This shot would be perfect if not for one small detail: the director wants the model to blow a kiss and wave to her fans. In the past, this would have been a time-consuming endeavor because motion capture data has keys on every frame. You would have had to eliminate and reduce keys and then key the rotation of the joints in her shoulder, arm, and hand. However, with the Trax Editor, you can create an overlay animation of the model raising her arm and waving without destroying the integrity of the original motion capture. The Trax Editor is a nonlinear animation sequencer that you can use to layer and blend clips from animated elements and overlap them to create new motions. The Trax Editor can be quite useful when you want to layer keyframed animation over motion capture data. To start, load the scene file that you saved earlier in this chapter, O f f s e t . m b .

Cleaning Mocap

Workflow for the Trax Editor and Motion Capture You can animate over motion capture in many ways (the first example in this chapter illustrates one other method), but one of the most effective and simple procedures uses the nonlinear animation features of the Trax Editor, especially since Trax doesn't destroy your original data. For the purpose of this example, we already created a clip of the mocap.

Your workflow for the kiss and wave actions is as follows: 1. Lock all nonanimation attributes. 2. Animate the character blowing a kiss and waving good-bye using Rotation X, Y, and Z values on the model's right arm. 3. Create a clip of the kiss and wave. 4. Shift the kissNwave clip's starting time. 5. Adjust the f-curve keys in the Trax Editor's Graph Editor.

107

108 C H A P T E R 4 • Animation and Motion Capture—Working Together

Lock Non-Animation Attributes It is good practice to lock all attributes that you will not key, thus reducing the clutter of keyframes resulting from your work. In this example, we'll animate only the rotational values of specific joints. We will not animate the Translate, Scale, and Visibility values in the Channel box; therefore, we'll lock these values to ensure that we don't accidentally adjust one. Follow these steps: 1. In the Outliner, expand the mocapSkel node until you have the following nodes visible: R_collar, R_shoulder, R_elbow, R_wrist (see Figure 4.18). 2. Select R_collar, R_shoulder, R_elbow, and R_wrist. You can do this by clicking the R_collar node, and with the mouse button still pressed, drag the cursor down onto R_wrist.

Figure 4.18: Expand the mocapSkel node. You will be setting rotation values in the Channel box for the R_collar, R_shoulder, R_elbow, and R_wrist joints.

Cleaning Mocap

3. With the R_collar, R_shoulder, R_elbow, and R_wrist joint nodes still highlighted, in the Channel box select Translate X, Translate Y, and Translate Z. RM click on top of the selection to display the Channels dialog box. Scroll down and select Lock Selected. The numeric values for Translate X, Translate Y, and Translate Z are shaded and are now locked. 4. In the Channel box, select Scale X, Scale Y, Scale Z, and Visibility. Select Lock Selected for these values also. The numeric values for Scale X, Scale Y, Scale Z, and Visibility are shaded and locked. Set Keys to Define the Animation Range When animating over an existing clip, it is extremely important to set "neutral" keys at the head and tail of your new animation to define a beginning and an end for the range of the new clip. If you don't, the clip and keyframed animation will interact in a bizarre manner. In this example, the clip of the kiss and wave will start on frame 0 and end on frame 132. We will not modify the value of the first and last keys; they serve as start and end poses of the kiss and wave animation that will blend into the animation of the model walking. We will set keys on four joints: the R_collar, R_shoulder, R_elbow, and R_wrist. The R_shoulder and R_wrist joints will have an animation range of 132 frames. The R_collar and R_elbow joints will have an animation range of 111 frames. Even though certain joints do not have the same frame range, the length of the clip will be the length of the longest frame range, 132 frames, when the four joints are selected and made into a clip. In the Timeline, the last key that has been set on any joint defines the duration of the entire clip. Therefore, all the last keys do not have to be on the same last frame. 1. In the Outliner under mocapSkel, select the R_collar joint node, and then Ctrl+click the R_elbow node. Both the R_collar and R_elbow joint nodes will be selected in the Outliner. 2. In the Timeline, go to frame 0 and set a key by pressing the s key on your keyboard. 3. Go to frame 111 and set a key. You have now created an in and out for the animation range of the R_collar and R_elbow nodes (see Figure 4.19). 4. In the Outliner, select the R_shoulder and R_wrist nodes. 5. In the Timeline, set keys at frame 0 and 132. You have now created an in and out animation range for the R_shoulder and R_wrist nodes (see Figure 4.20). Set Keys for the Kiss and Wave Animation We will set keys on the R_collar, R_shoulder, R_elbow, and R_wrist joint nodes to animate the essential movement of the model blowing a kiss and waving. The only transform values we will enter in the Channel box are Rotate X, Y, and Z (recall that the rest of the transform nodes are locked). Set R_collar Keys for Rotate X, Y, Z First, set keys for rotation on R_collar joint. Follow these steps: 1. In the Outliner under mocapSkel, select the R_collar joint node. 2. Set the keys shown in Table 4.1 on the designated frames.

109

110

C H A P T E R 4 • Animation and Motion Capture—Working Together

figure 4.19: Set an in and out range for the R_collar and R_elbow joints.

Figure 4.20: Set an in and out range for the R_shoulder and R_wrist joints.

Cleaning Mocap

Type the values In the Channel box fields.

Your animation should look like the w a v e R _ c o l 1 a r _ p e r s p V i e w . m o v movie on the CD. Set R_shoulder Keys for Rotate X, Y, Z Next you will set X, Y, and Z rotation keys for the R_shoulder joint node. Follow these steps: 1. In the Outliner under mocapSkel, select the R_shoulder joint node. 2. In the Channel box, set the keys as shown in Table 4.2. Your animation should look like the w a v e R _ _ s h o u l d e r _ p e r s p V i e w . m o v movie on the CD. Set R_elbow Keys for Rotate X, Y, Z Next you will set X, Y, and Z rotation keys for the R_elbow joint node. Follow these steps: 1. In the Outliner under mocapSkel, select the R_elbow node. 2. Set the keys shown in Table4.3. Your animation should look like the w a v e R _ e l b o w _ p e r s p V i e w . m o v movie on the CD. Set R_wrist Keys for Rotate X, Y, Z The R_wrist joint node is the last joint for which you will set X, Y, and Z rotation keys. Follow these steps: 1. In the Outliner under mocapSkel, select the R_wrist node. 2. Set keys on the suitable frames, as shown in Table 4.4. Your animation should look like the w a v e R _ w r i s t _ p e r s p V i e w . m o v movie

111

112 C H A P T E R 4 • Animation and Motion Capture—Working Together

on the CD. Scrub the Timeline or play the animation to see the model raise her arm, blow a kiss, and wave. Create a Clip of the Kiss and Wave We will now take this chain of joints and turn it into a nonlinear animation clip. Follow these steps: 1. In the Outliner, select the mocapSkelCharacter and then select the R_collar, R_shoulder, R_elbow, and R_wrist joint nodes. Selecting the mocapSkelCharacter will associate the clip with that character. 2. Press F2, and then choose Animate Create Clip 3. In the Create Clip Options dialog box, shown in Figure 4.21, type kissNwave in the Name field. Leave all other parameters at their default settings. 4. Select Create Clip. You will notice that the keys from the Timeline have disappeared. They have been moved into the Trax Editor. 5. Choose Window Animation Editors Trax Editor to open the Trax Editor. You will find that kissNwave has been created as a second track under the sexyWalk track. Shift the Start Time of the kissNwave Clip After you create an animation, you don't have to destroy your animation by adjusting keys if you don't like the timing. You can slide the clip on the track to delay the start frame of the animation or start it earlier than you originally planned, or you can even slow down or speed up the actions by scaling the clip. To change the start time, follow these steps:

Figure 4.21: The Create Clip Options dialog box.

Cleaning Mocap

1. In the Trax Editor, select the kissNwave clip. Notice that the clip has numbers on both the head and tail, designating the start frame and the end frame. On the left side of the kissNwave clip is the number 0; on the right side is the number 132. 2. LM click the kissNwave clip, and slide it until the frame start reads 45 and the frame end is 177. Scrub the Timeline. Now the animation doesn't start with the model blowing a kiss. Instead, she takes a few steps and then raises her arm. There seems to be a little more attitude in her behavior since we shifted her kiss and wave until after her entrance. Adjust the F-Curves in the Trax Editor's Graph Editor Although the kiss and wave keys are not visible in the Timeline, you can still manipulate them in the Trax Editor. Follow these steps: 1. In the Trax Editor, select the kissNwave clip, as shown in Figure 4.22. 2. Choose View Graph Anim Curves, or select the icon for the Graph Editor in the Trax Editor pane to open the Graph Editor 3. With the Move tool selected, LM click to select keys and MM click to move them. You can manipulate the f-curves by adjusting keys the same way you would normally in the Graph Editor. 4. Adjust the curves until you are happy with the result. Your final animation should look like the w a v e C o m p l e t e _ p e r s p V i e w . m o v movie on the CD. You have now finished this animation, and you just got approval from the director for your shot, so take a well-deserved break and grab a latte. Then read on to explore another procedure for animating over motion capture with the Trax Editor. Disable the mocapSkel Clip in the Trax Editor We mentioned earlier that you can create animations on mocapped skeletons using two techniques. We used one of these techniques in the previous section when we set keys on a moving

Figure 4.22: Shift the kissNwave clip on the Timeline until you are happy with the timing of the model's wave. Use the Graph Editor to tweak f-curves.

113

114

C H A P T E R 4 • Animation and Motion Capture—Working Together

skeleton driven by capture data. The other technique involves disabling the motion capture clip in order to animate on a static character. Using this technique, you isolate your animation to evaluate its strength on its own merit by turning off the primary body movement. Follow these steps: 1. In the Timeline, go to frame 0. 2. Open the Trax Editor, and RM click and hold the sexyWalk clip, to display a pop-up menu. Clear the Enable Clip check box and the kissNwave Clip check box. Scrub the Timeline. Result: the motion capture clip sexyWalk and animation clip kissNwave are disabled, and therefore the skeleton does not move. You will not lose this motion; it is simply turned off for now. 3. Set keys on the R_collar, R_shoulder, R_elbow, and R_wrist joint nodes. You can create your own wave or use the keys in Tables 4.1, 4.2, 4.3, and 4.4, earlier in this chapter. 4. In the Outliner, select the R_collar, R_shoulder, R_elbow, and R_wrist joint nodes. Select F2, choose Animate Create Clip and enter kissNwaveRelative in the Name field. Click the Create Clip button. Scrub the Timeline. You should see the arm animating while the rest of the model's body stays static. Enable sexyWalk To turn on the model's motion capture, we need to enable that clip. Follow these steps: 1. In the Trax Editor, RM click sexyWalk and check Enable Clip to activate the motion capture movement. Scrub the Timeline. Something is not right. The model's arm is waving erratically and is not in the positions that we set. We didn't key her arm at the origin, and it needs to be relative to the motion capture clip. 2. In the Trax Editor, RM click kissNwaveRelative and check Relative Clip. Scrub the Timeline. Our model is now walking and waving. You can now disable the sexyWalk clip at any frame in the Timeline and analyze the kissNwaveRelative clip moving independently of the motion capture clip. Because we created the animation of the arm with the sexyWalk clip disabled, we can now enable or disable sexyWalk at any frame in the Timeline and analyze the kissNwaveRelative clip moving independent of the motion capture clip. Adjust f-curves accordingly with the sexyWalk clip enabled or disabled. The Next Step We used the Trax Editor to create an overlay animation clip on top of a motion capture walk. Not once did we have to deal with all the keys that motion capture produces. In fact, we used traditional forward kinematics to animate the arm. This exercise should give you a starting place to explore animation with motion capture in the future. Keep practicing with this walk. Try creating a clip of the model turning her head or her torso or waving with her other hand. Use your imagination and the techniques we covered and have fun.

Cleaning Mocap

Combining Mocap with Animation

In this example, we'll combine the mocap that we already have with keyframing, using the simplified hybrid setup you've been using from the CD. The model will walk along and inadvertently stumble over a box. Since the mocap does not include her tripping, we must keyframe this motion on the animation skeleton, blending it with the mocap skeleton's motion. This particular skeleton has only basic animation controls for purposes of demonstration. A production skeleton should have several more options such as forward kinematic controls on the arms and legs, as well as inverse kinematic controls.

Let's get started. Follow these steps: 1. Load the file O f f s e t . m b that you created earlier in this chapter and source the script Snap.mel.

To source the MEL script, open the Script Editor, and choose File Source Script. Browse to the location of the S n a p . m e l script on the CD. Select it, and click Open.

2. At the command line, type snap to open a box that has a Snap Skeleton button and a Reset button, as shown in Figure 4.23. Make a Snap Button To make things easier later, let's make a button for the Snap tool. This tool is a MEL script that will help us get the animation model into position at the point where the transition from mocap to keyframed animation occurs. Follow these steps:

Figure 4.23: The Snap button is activated.

1. In the input area of the Script Editor, type snap, highlight the word, and drag it to the shelf. 2. In the main menu, choose Window Settings/Preferences Shelves. 3. Scroll down the list to find the Snap tool, and in the box next to Icon Name, type snap, and press Enter. 4. Save all shelves and close the dialog box.

11 5

116 C H A P T E R 4 • Animation and Motion Capture—Working Together

Figure 4.24: The model with foot controls selected Make a Button for Selecting Animation Controls Now let's make a button to select the animation controls on the animation skeleton. Start by hiding the layers for the parts of the model that we don't need at the moment. Make sure that the visibility is off for the bindSkeleton, the mocapSkeleton, the offsetSkeleton, and the offsetControls. Follow these steps: 1. In the Show menu in your Scene Menu bar, turn offJoints, IK handles, and Locators. 2. Select the two large boxes that represent the foot controls, leaving the other boxes and controls on the feet unselected, as shown in Figure 4.24. 3. Add to the current selection by holding down Shift and dragging over the remaining boxes and curve controls that are visible above the feet. Leave the large Control box cube next to the model unselected. Make a Button to Select Animation Controls Now we'll create a button to make the animation controls easier to select. Follow these steps: 1. In the Script Editor, highlight the output that describes the selection you just made. Make sure the two large boxes of the feet are included in the list of objects selected. Use this text:

2. Choose File Save Selected to Shelf, and enter a name such as SELECT. 3. Click an empty space in your workspace to deselect everything. Now, let's bring back some of the layers you've hidden, such as the bindSkeleton and the mocapSkeleton. You can use the offset skeleton and offset controls as well later, if you like, but for now, let's keep them hidden to reduce screen clutter. Let's start animating. Select the Control box, and key the Mocap_keyframe attribute in the Channel box to a value of 0.

Summary

Put the bindSkeleton layer in reference mode. This will make it easier to select the animation Control boxes.

Determine Where Mocap End and Keyframing Should Begin Now, let's assume that we want the model to stumble over a box at frame 113, since that's where she is shifting weight for the next step. Follow these steps: 1. To create the box, choose Create Polygon Primitives Cube In the dialog box, type the dimensions of the box, maybe along the lines of a width of 1.5 and height and depth of 0.3. Place the box in front of the model's feet, near the tip of her left toe. As you scrub through the Timeline, you notice the model's feet go through the box at frame 115. 2. Let's place another key on the Control box at frame 112, at a value of 0. At frame 113, key the Control box again, only with a value of 1. This creates the transition of influence from the mocap skeleton to the keyframe animation skeleton. The bind skeleton follows whichever skeleton is keyed to the on position, meaning having a value of 1. The model will snap to the exact position of the animation skeleton in the work space. 3. View your curve in the Graph Editor, and ensure that the first two keys have flat tangents. At this point if you scrub forward, you'll see the body of the model float backward to its initial position, which happens because the influence of the animation skeleton is on at that point, and the influence of the mocap skeleton is off. 4. To help get the body into the position of the last frame of mocap used before the transition, we'll use the Snap tool. Scrub back to frame 114, and ensure that the mocap skeleton is visible in the Layer Editor. Make sure that Joints are turned on under Show in your working view as well. Click the Snap button you made earlier. The bind skeleton and the animation skeleton should both snap to the position of the mocap skeleton. Click the Select button. Set a key by pressing s on your keyboard. The Snap tool is designed to be used only once at the transition point between motion capture and animation. 5. Keyframe the rest of the animation as you would a regular animation skeleton.

Summary In this chapter, we covered the basics of motion capture and discussed methods of working with it. We manipulate the mocap using offsets and the Trax Editor, as well as by adding keyframes to a hybrid animation model to blend traditional key framing with motion capture. You can combine animation and motion capture in many ways, so have fun exploring and try different solutions.

11 7

Lip-SynchingReal-WorldProjects John Kundert-Gibbs, Dariush Derakhshani, and Rebecca Johnson

One Of the most tedious and time-consuming,yet highly visible and critical, tasks in 3D animation is lip-synching prerecorded vocal tracks on human or anthropomorphized characters. Not only is a character's mouth highly visible in most shots, audiences are extremely good at determining whether lip-synched animation looks "right. " Thus arises the daunting task of animating dozens or hundreds of words accurately, yet efficiently enough to fit within a tight time constraint. Oddly, if lip-synching is done properly, it becomes an almost invisible effect; it's only when lip-synching is off somehow that audiences even pay attention to it. Thus, the art of lip-synching is the art of creating an effect that looks so natural that people don't even notice it. Although lip-synching in hand-drawn animation requires exposure sheets or other methods of prefiguring each mouth shape (and expression), you can use today's 3D packages such as Maya to skip this phase if needed (though many productions still use exposure sheets) and use the shape and sound of the voice track within the program itself as a guide. In this chapter, we'll discuss the basic theory of lip-synching and give you some general guidelines for doing it properly and efficiently. We'll then work through two sample scenes, putting this theory into practice. After completing this chapter, you should have a solid understanding of how to produce your own lip-synched animations and be ready to create your own "invisible" vocal animations.

120

C H A P T E R 5 • Lip-Synching Real-World Projects

Creating a Lip-Synched Animation You can do lip-synching in a multitude of ways, but we'll focus on a proven technique that is efficient and allows a great deal of fine-tuning control. With this technique, which uses the power of a number of Maya's software tools, you can build a library of words, phrases, and emotions and then use the Trax Editor to place them in the Timeline based on where a given word falls in a voice track. In addition, with this technique you can control the weight (or amount) of any given word, you can control how long it takes to pronounce the word, and you can even add small touches on top of the basic words as they are spoken. All told, this method is extremely efficient—especially if you need to do a series of animations with one or more characters. It allows for great accuracy in the lip-synching process and is even transferable from one character to another, further saving the animator's time and energy. The one drawback is that it takes a good deal of time and some understanding of the technique to get the whole process up and running. Here is a general outline of how to proceed, using this method, to create effective lipsynch animation. Preproduction Tasks As with all animation work, the first step is preproduction. In preproduction, you create the storyline, script (obviously an important step when lip-synching is involved) the look and feel of the animation, and create storyboards that describe the action. If you are working on a series of similar animations (for example, a Saturday-morning cartoon series), you will likely have a "bible" that contains the general art direction, character descriptions, and possibly technical material. In addition to creating the general look of your models and scenes and creating the dialog, in the preproduction phase you might also define general issues of how your character(s) will speak. For example, you might decide how realistic the lip-synching needs to be and determine your general methodology. A little forethought at this stage can save valuable time later. For example, if the characters are extremely cartoonish and stylized, you might need only simple "open/closed" positions for their mouths. On the other hand, if the animation requires extreme realism, now is the time to face this challenge head-on and be sure you have enough resources to tackle this task. Never overanimate your characters, lf they need only simple mouth shapes, don't build a complex and/or hard-to-use system for lip-synching. You are only wasting your—and your company's—money.

Recording Vocal Tracks Once you make basic decisions about the animation and the dialog track is "locked," or finished, it is time to find voice talent and record your dialog! There are really only two secrets to getting a good voice track for your animation: • Finding talented, hard-working actors, preferably with interesting, unique voices • Getting the cleanest recording you can The number of times otherwise good dialog tracks have been ruined by poor recording is probably too high to count, and even decent recordings often need lots of massaging to fix

• Creating a Lip-Synched Animation

problem areas, all of which leads to wasted time and money and a lot of frustration that can be avoided by creating or renting an appropriate facility in the first place. If you have the budget, by all means rent a recording studio for the time you need it. A good rule of thumb is that you need about an hour of recording time per minute of finished dialog. If you can't afford to rent a studio, see if you can beg facilities from somewhere close by. Often—especially for nonprofit projects—managers of facilities will allow recording sessions for little or no charge. The one problem that often arises in these circumstances is that the recording session has to take place at odd hours, which can be stressful for cast and crew. If you must construct your own recording space, try to keep the following points in mind: • Find the best microphone you can, and never, ever use the built-in microphone on a camera or a camcorder. • Find the acoustically deadest space you can. An anechoic chamber is best; otherwise, use heavy drapes, foam, or other sound-deadening materials to reduce echo. • Remember that floors and ceilings create echo, so lay out blankets, carpeting, or other materials on them. • Listen carefully to your space or do a test recording. Listen for any kinds of hums or "leaking" sound from the outside world. Anything from fluorescent light fixtures to airconditioning can cause a low level of noise in your recording that is difficult to delete. • If possible, have only your voice actors and the microphone(s) in the room. The fewer machines (recording devices, cameras, computers) in the room, the less noise you will get. • Never try to create an effect when recording. For example, don't try to capture a natural echo if your characters will be in a cave. With the audio-engineering software available today, it's extremely easy to add this type of effect, but almost impossible to get rid of an incorrect echo or other effect after it's recorded. The best sound for recording is completely flat and noiseless, save for your actors' voices. Be sure to test your actual actors before you do your final recordings. Often actors' voices—especially stage actors' voices—have an extreme dynamic range, which can cause a poorly adjusted recording setup to clip. It's much better to find this out in a trial recording than after your actors have gone home for the evening! To find voice actors for your dialog tracks, first decide what your voices will sound like. Next, either hire professional voice talent (if your budget allows) or go scouting for amateur actors who are willing to work for the exposure. Someone who is familiar with local community or college theater programs can find you good talent quickly. If you have the good fortune to be able to audition your actors, listen to what they bring to a particular role. Often a well-trained actor gives you a more interesting reading than what you had in mind. You just have to be able to hear that different is better, not worse. A point of some debate is whether to rehearse your cast before doing voice-over recordings. We believe a short rehearsal just before recording is beneficial because it helps actors get into the flow of the scene. Others argue, however, that this rehearsal reduces the spontaneity of the recording. Regardless of whether you rehearse, finding a good director can help get the best out of your actors. During the recording process itself, continue to listen to your actor(s). They will often come up with marvelous spur-of-the-moment line readings that can make a dull line into a memorable or humorous one. One of the best techniques for getting a range of line readings out of an actor is to have them read a line three or four times in a row with just a slight pause between readings. Often this repetition helps them loosen up and try readings that they wouldn't necessarily have tried had they had more time to rehearse. Again, the audio software available today makes creating a dialog track from many individual takes quite easy.

121

122

C H A P T E R 5 • Lip-Synching Real-World Projects

Modeling for Lip-Synching Modeling for lip-synching is the complement of getting a good dialog track: the cleaner and more interesting your model, the easier it will be to create interesting animation to go with your dialog track. For the most part, what goes for all modeling goes for the head and mouth of a character to be lipsynched: create a clean surface with regularly spaced isoparms or facets that avoid bunching up, especially in areas where a lot of activity will take place (such as the cheeks or mouth area; see Figure 5.1). In addition, consider how the virtual muscles under your character's face will pull the skin and lips to create sounds. This task may be easy if your character is extremely simple, but for most models, you'll need to think about how their mouths move. Most often people refer to human anatomy when creating mouth shapes, because most Figure 5.1: A cleanly modeled head, ready for rigging and animation animated talking creatures— human or not—move their lips like people do. Because most animals don't have the range of motion in their lips necessary for speech, anthropomorphizing their mouths is necessary for convincing mouth animation. The human mouth is made up of a number of muscles laid out In concentric rings around the lips, allowing us our large range of motion and expression In this area. The most straightforward way to model this muscle structure is to model the mouth area as a series of rlngs moving away from the lips. When you then pull on faces or control vertices, the mouth area behaves as if there were a more-or-less circular muscle structure beneath it.

Rigging for Lip-Synching Once your model is built, it's time to set it up for animation. You can rig mouth animation in a couple of ways: • You can manipulate the skeletal bones inside the mouth area. • You can directly manipulate the control vertices of the model's surface. Again, depending on the needs of your animation, you might want to use either or both of these methods. For simple, stylized, or "soft" characters, such as Monsieur Cinnamon that

Creating a Lip-Synched Animation

we'll work with later in this chapter, adjusting the surface of the mouth to get the appropriate shapes works well. However, real human mouths depend on a jawbone that rotates below the skull to achieve the major mouth positioning (the lip muscles fine-tuning this motion). As the jaw rotates—an effect difficult to simulate using blend shapes—rotating bones inside your character's mouth produce a more realistic gross motion for the mouth animation. Generally, the more realistic your creature, the more people will notice if only the surface of the model is moving. In such cases, using bones or, more often, a combination of bones and blend shapes is a better solution. Using bones to rig the mouth can be a simple or complex process, depending on the effect you're trying to achieve. In the simplest case, you can use one bone coming from the head joint, which acts as a jaw for the character's mouth, as in Figure 5.2. You must then skin this bone to the jaw area and weight it properly so that as the

Figure 5.2: A single jawbone extends from a head bone, allowing the jaw area of the head to rotate similarly to a real jaw. bone moves, the lower jaw area reacts accordingly.

Usually a smooth bind is best for skinning the jaw area. You then need to manipulate the weights so that the lower jaw is completely affected by the jawbone while the upper jaw is completely unaffected. Fading the influence of the lower jawbone in the lower cheek area produces a soft transition from the low jaw to the rest of the head.

In more complex cases, you can build an entire "muscular" system in spiderlike fashion out of bones surrounding the lip area. As each "leg" pulls on an area of the lip, the affected skin of the model is distorted along with the bone. Although this complex bone structure can create amazingly subtle effects, it is fairly complex to set up and use and, with the advent of blend shapes, is not used as frequently as it once was. To rig a character for blend shapes, you make multiple copies of the default mouth area—which is modeled in an expressionless neutral pose—and deform the vertices of the mouth to create various shapes, which become the target shapes that the neutral head will blend to when you animate the mouth. Rigging for blend shapes, then, is creating a library of mouth shapes that you can select, either by themselves or in combination, to create the final mouth shape at each moment of the final animation. For simple characters, the mouth library can be fairly small. Smile, frown, Ah (open), M (closed), and E (half open and stretched)

123

124

C H A P T E R 5 • Lip-Synching Real-World Projects

shapes might be all you need to create convincing lipsynching. For more realistic characters, your library of mouth shapes obviously increases to allow for the subtlety of the human mouth. A library of dozens of mouth shapes might be necessary for a realistic human character. As always, don't overrig your blend shapes. Create only the shapes you'll actually use; otherwise, you waste time both in rigging and in hunting for the correct blend shapes during animation. To create the actual blend shape node itself, follow these steps: Figure 5.3: The Blend Shape window 1. Select each of your target models, and then select your default model. 2. In the Animation menu, choose Deform Create Blend Shape. 3. Open the Blend Shape window (choose Window Animation Editors Blend Shape) to see your blend shape controls, as in Figure 5.3. To create mouth shapes, simply move one or more sliders up and down to create the shape you want for the current frame. Once you create your blend shapes, you will probably want to hide the target models in order to clean up your work area.

One useful aspect of the blend shape method in Maya is that you can use base blend shape targets to create "meta" blend shape targets. For example, say you want to create the mouth shape for whistling, and you already have target models for closed pursed lips and for the O sound. Rather than create a new target model from scratch for the whistle, you can use the Blend Shape window to combine the O and pursed mouths and then save this new shape as a blend shape target by clicking the Add button in the Blend Shape window. In Figure 5.4, the third blend shape (whistle) was created from a combination of O and pursed shapes given by the slider positions. Creating blend shapes from other blend shapes is a powerful time-saver durFigure 5.4: The Blend Shape window ing the rigging process. You can create five to ten basic shows the whistle mouth shape cremouth shapes and then produce the actual phonemes ated by combining the O and pursed (Ah, O, E, M, K, and so on) by combining these basic mouth shapes. mouth shapes.

Creating Vocal Clips Using the Trax Editor With your mouth shapes stored as blend shapes, you can load your dialog track and start keyframing your dialog right away. (To do so, move to a frame, move sliders to get an appropriate shape, and click the Key or Key All button to set keys on the blend shape for that

Creating a Lip-Synched Animation

frame.) Although this method may be fine if you only need to lip-synch a few seconds of speech, a much better method for longer stretches of dialog is to use Maya's character and Trax Editor features to create clips for various words and mouth shapes. To load sound Into your Maya scene, save your dialog track as a . w a v file, choose Flle Import, and browse to the sound file. Once the file is imported, you can see the shape of the sound file in the Timeline by RM clicking the Timeline and choosing Sound from the shortcut menu.

We will look at the Trax Editor more in detail in the first hands-on example later in this chapter, but the general method is to create a character (or subcharacter) for the mouth. The blend shape node is to be added to this character with the envelope and shape names selected in the Channel box and with the From Channel Box option selected in the Create Character options. This last step ensures that only these attributes will be keyed with the character, removing unnecessary keys during animation. Once the blend shape is a character, take the script and start creating the words the character speaks to form a library of character clips. Because the Trax Editor allows for scaling of words, you do not need, at this point, to match the words with any given timing; so in general you select a standard length (5 or 10 frames) and make all words last that long by default. During the actual synching process, you can adjust this timing, as well as the size of the mouth for the word, to fit the way the word is actually spoken. To create a clip, simply keyframe the series of mouth shapes for any given word or reaction, choose Animate Create Clip and give the clip the name of the word you just created, as shown in Figure 5.5. Once you animate an oft-used word for your character, you can save it as a clip and then load Figure 5.5: Creating a clip for the word it for future use. "goodbye" It is a good idea to create a neutral mouth shape and "breath" shape in addition to your words. You'll use the neutral mouth shape when the character is resting between sentences, and you'll use the "breath" shape when the character is getting ready to speak again. If you have lots of dialog or more than one character speaking in your piece, two distinct advantages will accrue from this method in addition to the ease of placing words where they need to be in a more intuitive manner (see the next section): • Any repeated words ("the" is often repeated multiple times, for example) have to be keyframed only once, because you can reuse the same source clip as many times as needed. • You can easily share a library of words between characters. As long as they have the same blend shape targets in the same order — even if the blend shapes look different

1 25

126

C H A P T E R 5 • Lip-Synching Real-World Projects

from one character to the other—you can transfer clips from one to the other, saving even more setup time. Thus, you can incrementally grow your word library (again, assuming all your characters have the same targets in the same order) over time on a single project or even multiple projects. For more information on transferring clips from one character to another, see Mastering Maya3, by Peter Lee and John L. Kundert-Gibbs (2001,Sybex, Inc.).

Creating the Completed Vocal Track The sound file is read into the computer, and your library of words is completed, so now it's time to lay out the actual words in synch with your sound. Use the middle mouse button to scrub the Timeline to hear your dialog track, choose where each word comes, and drag that word from the Visor window onto your Trax Editor window. Words are stored in the Visor under Animation: Character Clips and Poses: Clips.

When the words are basically in place, select each word (double-click it in the Trax Editor) and use the Channel box to adjust its length and scale so that it better fits the spoken word. If you decide a particular word is not good enough, you can open the word's keyframes in the Graph Editor (choose View Graph Anim Curves in the Trax Editor menu) and adjust them, as in Figure 5.6. After laying in, scaling, and weighting your words, add a blend between them if you like (select two clips and RM choose Blend Clips) and test your animation using a quick playblast! All the work on the front end creating character clips pays off here: the animation process itself is much faster than keyframing each word in place as you go. Figure 5.7 shows the Trax Editor and clips for Figure 5.6: Adjusting the animation curves for a word in the Graph Editor a famous sentence.

Figure 5.7: Creating a sentence using the Trax Editor

Creating a Lip-Synched Animation

In general, we have found that moving a character's lip-synched animation one or two frames before the actual sound for that mouth shape starts helps sell the reality of the synching. For some reason, matching sounds exactly to the mouth shape makes the visual mouth shapes seem to lag behind the audio track, which is disturbing. Because it's easy to move clips and fine-tune timing with the Trax Editor, experimenting with timing is a straightforward task.

Finishing the Lip-Synch Animation In the last stage of the animation process, basic technique gives way to art and storytelling. All the extra work put in here translates into more compelling and believable characters who sell their reality and get the audience to care about the story. Fine-Tuning and Adding Personality to the Vocal Track Although the basic lip-synch work is done now, there is always room for fine-tuning and improvement. Without this stage, the lip-synching may seem forced or mechanical, so here is where you get to add character to your model's speech. At this stage, you need to consider the following: • Anticipation and "overshoot" of words and sentences • Reaction to other characters' words and actions • The general personality of your character At the basic level, your character needs to anticipate what it will say next. In addition to body and facial movement (which are covered elsewhere in this book), you usually open your mouth before speaking in order to breathe in. The larger, louder, or more emotional the sentence or phrase to come, the bigger this anticipation should be. Likewise, after a sentence or a phrase, a character needs to regroup for the next set of words. Especially at the end of loud or emotional utterances, a character often overenunciates the last vowel or consonant, which adds emphasis to the words; the return to a neutral mouth position can take somewhat longer in these cases. Animating a character (or mouth) when it is not speaking can be particularly challenging, because you need to create an "internal monologue" for the character during these periods. If another character tells a joke, for example, does this character find it funny? Or really funny? Or was he thinking about the color of the sky at the time and missed the joke entirely? This information is available to the audience only through the animation of the character, and because most reactions are not scripted, you need to figure them out on your own. Although a big challenge, these "takes" are a great opportunity to be creative and put your own interpretation of the character into your animation work. Just be sure you don't upstage the speaking character with your work! Finally, determining the personality of your character has a bearing on how its mouth looks, and even on how you create your blend shapes in the first place. Is your character a villain in a melodrama? Then it probably sneers constantly, which distorts every word and mouth shape. Or maybe it's a happy character, in which case it will tend to have a more open and relaxed mouth. Or nervous, in which case it might tightly purse its lips when not speaking. One extremely valuable resource in this fine-tuning stage is the dialog track itself. The speech of good actors will give you much of the information you need about the character and its reactions. Even better, if you have a video recording of your actors speaking, you can

1 27

128

C H A P T E R 5 • Lip-Synching Real-World Projects

"steal" the way their mouth looks for any portion of the dialog, imbuing your animation work with just that much more realism and personality. Integrating the Lip-Synch into the Final Animation In a real production environment, the head of a character is usually animated concurrently with the body to save time. Thus, the head, with all the lip-synch work keyed onto it, will likely exist on its own and will need to be integrated into the body, which has been animated elsewhere. In most cases, there are two possibilities for placing the head back onto the character. The first is if no skeletal structure exists in the head, and the second is if one does. If no skeletal structure exists, your head will likely replace a dummy head that has been childed to at least a single bone, which has probably been keyframed for gross motion of the head. In such a case, simply delete the old head and make the new head the child of the head bone. It should then inherit the motion of this bone for large-scale motion, while maintaining the blend shape work you have done for lip-synching. If, on the other hand, the head skeleton has been inside your model all the time, you may have skinned the head to it (rather than simply parented the geometry to the skeleton) and may have created a lot of animation—even all the lip-synching—via these bones. In such a case, the body animators should have left the head area alone completely, and you should be able to parent the lowest bone in your chain to the neck or collarbone area of the body skeleton, which maintains all your skeletal and blend shape animation work for the entire head area. At this point, it is a good idea to create a playblast or quick render of your completed character to be sure your head and body actions match properly. If the mouth and head are extremely animated while the body is quiet, if the body consistently anticipates actions several frames before the head, or if any other obvious problems arise, you will need to sit down with the body animator and figure out a way to integrate your work to create a seamless whole. Now that we have covered the lip-synch process in the abstract, let's look at two hands-on examples that let you try your hand at lip-synching.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor Lip-synching, if done well, compliments and blends into the overall animation. But if the timing is not quite right or if there are other visible problems, lip-synching becomes a distraction, lowering the quality of the animation. Blend shapes provide a convenient and versatile way to simplify the lip-synching process. And the Trax Editor helps automate the blend shape process by allowing you to store clips of words animated from the blend shapes for easy construction.

Preparing the Model for Lip-Synching Spending the extra time to properly set up the character helps to make the actual job of matching facial expressions and movements to sounds move quickly, allowing you to maintain your timeline. In this example, we'll use a humanoid character (without teeth or a tongue) to illustrate the basics of lip-synching using blend shapes, a word library, and the Trax Editor. Here is the process: 1. Prepare the character for blend shape creation.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

2. 3. 4. 5. 6. 7.

Create poses for expressions and sounds. Make the blend shapes. Import the sound. Create clips. Use the Trax Editor to line up sounds and motions. Preview the final scene.

Creating the Head (a General Overview) Monsieur Cinnamon (MC), the character we'll lip-synch, is a simple character with a complex personality. In one scene, he acts bubbly, exuding friendliness, and in another he is, hmmm, to put it nicely—a jerk. Keep this in mind as you create your character. The role the character plays in the animation should dictate the style of the lip-synching process. To prepare for lip-synching, imagine the mannerisms of your character. Are they confident, outspoken, shy, or bashful? A person portrays a great deal about their personality through mannerisms and their tone of voice. As a lip-synch animator, your job is to convey the character's personality through its facial movements. MC's temperament is one of extremes, smiling one second and in the middle of a mad tirade the next. The animation of the head must coincide with the body. For example, if MC's body language is exaggerated, his facial movements must also be overemphasized. Before you begin, open M C m a g n i f l q u e . m o v on the CD-ROM and watch MC speak the line we will be lip-synching. If you want to create the head shape, simply open a new file in Maya and start working. You can use this file to move through the steps of the example. Remember, as you create the head shape, MC should be able to look cute, cuddly, self-centered, or mean with the simple push of the blend shape sliders we will create. Now, follow these steps: 1. Create a NURBS sphere for the head shape. 2. Make sure the poles are approximately where you want the mouth opening. 3. Use a minimal number of sections when creating the sphere. (It is much easier to add detail later than fight with a heavy model.) 4. Select the CVs in the center of the sphere. 5. Pull the CVs inside the sphere, and arrange them to form the cavity inside the mouth. As sort of a cheat, you can create a sphere. Set the sweep angle to 180. Scale the half sphere so that it fits inside the head shape. Use a dark color to texture the surface in order to give the appearance of the inside of the mouth. Creating the hemisphere is quicker than shaping the interior CVs. 6. Use the Sculpt Surfaces tool and/or manipulate the CVs to build the facial structure: cheeks, eye sockets, chin, lips, and forehead. Remember, MC Is a simple character, so you don't need detailed facial features. After all, Monsieur Cinnamon is made of dough.

7. Name the sphere o r i g i n a l _ h e a d .

8. Create eyeballs and eyebrows.

129

130

C H A P T E R 5 • Lip-Synching Real-World Projects

Preparing the Character for Blend Shape Creation Depending on the complexity of your character, blend shape creation can be one of the most time-consuming portions of the lip-synching process. However, it is definitely worth investing the time up front because the blend shapes provide smooth, easily controlled transitions from one shape to another. Blend shapes are similar to morphing, in which one shape transforms into the other. Sliders control the functionality of the blend shapes. Spend the extra time as you create the forms to make sure that the mouth shapes look correct. No matter how skilled you are when it comes to matching the timing of the sound and animation, you will not have a successful lip-synching experience if your blend shapes are torn or lacking. You will find that blend shapes are easier to make if there is more detail in the mouth, cheek, and forehead areas. Since our character is fairly simple, we will only add CVs to the mouth area. The isoparms we will add will help give the appearance of underlying facial muscles. Follow these steps: 1. Switch to the Modeling menu. 2. The mouth area does need extra control, so add one or two isoparms around the mouth. 3. Select the face. RM click and choose Isoparms. 4. Click an isoparm near the mouth area, where you need more detail, and drag the yellow selection to the place where you want to insert the isoparm. 5. To add an isoparm, choose Edit NURBS Insert Isoparms choose Edit Reset Settings, and then click the Insert Button. 6. Repeat this process until you have enough detail to shape the mouth area in a variety of poses. 7. RM click the head shape. 8. Select an isoparm near the area where you want to insert an isoparm, and drag the yellow isoparm to its new location. 9. Repeat until you are satisfied with the level of detail around the mouth. (Be careful not to overdo this stage!) The CVs and hulls that result from adding isoparms may not be positioned exactly as expected, yet they will deform the shape in the area where you inserted the isoparm. Creating a Neutral Pose Your character needs the ability to go from happy to sad or from a relaxed pose to a scream. The easiest way to create the variety of poses is to start with a neutral expression (see Figure 5.8). The neutral pose will be the base shape of the blend shapes to come. Any changes you make to the neutral pose will be developed into a blend shape, showing the movement from the neutral expression to the new expression. You can combine each of the blend shapes to simply alter the new shape to form another pose. Make sure your model is clean and that the CVs are easy to manipulate. When modeling, keep the geometry light. Remember, you can add control points or vertices when you need them. If you have too many control points, it will be frustrating to manipulate the model. It is much easier to add points than to take them away without affecting the shape you are modeling. If you are ready to jump right into the lip-synching, open M c b l e n d s h a p e s . m b on the CD-ROM. This file contains the head and all the blend shapes. You can also create more blend shapes of your own. This example is a linear process, so you will build on each step that you complete. If you are going to complete the entire example, begin with the M c h e a d o n l y . m b file, and use this file throughout. You will be asked

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

Figure 5.8: A model of Monsieur Cinnamon's head in a neutral pose

to open different files. In some cases, the file will show you the finished portion of the process. Use these files as examples and continue working in either the M c b l e n d s h a p e s . m b file or the M c h e a d o n l y . m b file. Don't forget to save your work along the way! Detaching Surfaces

When a person speaks, the mouth, nose, eyes, cheeks, and forehead all move in relationship to one another. To provide easier (and separate) control over these movements, we'll split the head into three sections. We'll then create blend shapes that utilize the separate areas. Once all the blend shapes are created, we'll put MC back together again! The blend shapes will be combined to move all areas of the face so that the animation doesn't look stilted. Open M c h e a d o n l y . m b on the CD-ROM, and look at how MC is naturally divided by his isoparms. For our purposes, we want section one to contain the mouth, chin, and cheeks. Section two will consist of the eyes and the forehead. Section three will be the back of the head. When slicing the character, consider which groups of facial movements occur together, lf you are working with a more realistic model, you divide the face differently than we are with MC.

To detach the surfaces, follow these steps: 1. RM click the head shape, and choose Isoparm from the pop-up menu. 2. Select the isoparm that falls midway on the nose (see Figure 5.9). 3. Choose Edit NURBS Detach Surface

131

132

C H A P T E R 5 • Lip-Synching Real-World Projects

Figure 5.9: The selected isoparm illustrates how the face will be cut into sections. 4. 5. 6. 7.

Figure 5.10: The isoparm signifies where the surface will be detached.

Clear the Keep Originals check box. Choose Detach. Deselect the object. Select the new surface and press 3 on the keyboard so that the mouth patch will display smoothly. 8. Rename the new surface m o u t h _ p a t c h . 9. Select the upper portion of the head. 10. Choose the isoparm, as shown in Figure 5.10. 11. Choose Edit NURBS Detach Surface. Press 3 to display the object smoothly. 12. Shift + select the detached surface, the eyelids, the eyes, and the eyebrows. Press Ctrl+g to group the objects together. 13. Rename this group to e y e _ f o r e h e a d _ p a t c h . 14. Select the back of the head, and rename it b a c k _ p a t c h . Figures 5.11, 5.12, and 5.13 show the three portions of MC's head.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

Figure 5.11 : MC's mouth, chin, and cheeks

Figure 5.12: MC's eyes and forehead

133

Figure 5.13: The back of MC's head

Creating Blend Shapes Now it is time for what you have been waiting for: blend shape creation! You will soon realize why taking the extra time to create the shapes to manipulate is so important. If your facial expressions are not done correctly, you will spend even more time focusing on the technicalities of expressing a certain sound. The purpose of blend shapes is to save time during the animation process. Blend shapes offer many advantages over keyframing CVs directly or using other techniques. Once the blend shapes are set up, you can quickly and easily move from one expression to another. You can also combine different shapes to gain extended use of the facial expressions you have created. You can even create new blend shapes from a combination of the blend shapes you have already prepared. To make full use of blend shapes, you must first understand the basic terminology. Blend shapes are a combination of a base shape and a target object. The base shape is the object that you want to manipulate. The target object is the shape of the object that you want to achieve. In MC's case, the three sections of the original head shape are base shapes. The duplicated copies you manipulate are the target shapes. A blend shape is the combination of the target shape and the base shape, the target shape being the look we are aiming to achieve. The base shape is the character's starting point, and the target shape shows the results of the deformations. Consider which portion of your mouth moves as you speak, and manipulate the CVs accordingly. For example, the upper lip does not move as much as the lower lip, so base the opening of the mouth more on the CVs of the lower lip rather than on the CVs of the upper lip. Blend shapes are a strong lip-synching tool. Keep In mind that they are also useful In a variety of other animation techniques.

Creating Blend Shapes for the Mouth Lip-synching is based on phonetics. Don't try to create a pose for every letter. You will surely drive yourself crazy and waste a lot of all-too-precious time. Instead, base lip-synching on major sounds in a word. You are trying to animate "the big picture" of each word. For

134

C H A P T E R 5 • Lip-Synching Real-World Projects

Figure 5.14: Basic blend shapes needed for lip-synching

example, if you are lip-synching the word "the," animate only "th." Figure 5.14 shows some helpful blend shapes. Depending on the complexity of your character, you may need more or fewer shapes. With these basic pointers in mind, you are ready to begin creating expressions for MC! Follow these steps: 1. Select the m o u t h _ p a t c h and press Ctrl+d to duplicate. Do not Instance a blend shape target object.

2. Rename the shape o p e n . 3. With o p e n selected, choose Edit

Delete by Type

History.

5 Each time you create a shape, move the new shape to a clean area of the workspace. Otherwise, all the shapes will be placed directly on top of one another. Also, do not freeze any of the transformations. If you do, the blend shapes will not work.

4. Press F8 to switch to Component mode. 5. Position the CVs to create an open mouth shape. 6. To open the mouth and pull the jaw down, select CVs in one of the following ways: • Shift+LM to select multiple CVs. • Ctrl+LM to deselect specific CVs. • Shift+Ctrl+LM adds to the selection, whereas Shift+LM toggles selected or unselected. • Pick walk from one CV to another using the arrow keys. • Click Select by Component Type: Hulls to see the relationship between the CVs. Manipulating the CVs takes patience, but it's time well spent, as you will soon realize. When you are pleased with the open mouth shape, it's time to create a blend shape. Creating Blend Shapes To create blend shapes, follow these steps: 1. Select the open shape.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

135

2. Choose Edit Delete by Type History. 3. Shift+select the base shape m o u t h _ p a t c h . The first shape you selected is the target object. The second Is the base shape. In general, all shapes up to the last one selected are target shapes. The last shape you select is the base shape. 4. 5. 6. 7. 8.

Switch to the Animation menu. Choose Window Animation Editors Blend Shape to open the Blend Shape window. From the drop-down menu, select Create Blend Shape. Double-click the blend shape in the Outliner, and rename the shape to m o u t h . Test the shape by moving the slider. The mouth should open and close.

Controlling the Blend Shapes You can control the order of deformation between the two shapes. You can also add target shapes, reset all values to zero, select the blend shape, and set keys on the shape. The blend shapes are controlled by sliders. Moving the slider upward results in a new pose. Returning the slider to the starting position returns the face to the original pose. You can use the sliders in combination to create a variety of shapes. This feature is wonderful because it allows you to reduce the number of blend shapes you need to make. Each blend shape contains Select, Key, and Reset buttons. If you are using multiple target shapes for a single blend shape, you can key, select, and reset all the sliders with a single button for each task. The envelope attribute of the Blendshape node allows you to control the exaggeration of each shape. Also if you set the envelope attribute to a negative number, the shape will provide opposing expressions. For example, if you create a smile shape using a negative envelope attribute, the result is a frown. The envelope attribute is found under the slider for each blend and target shape, as well as in the Channel box for the blend shape, and its default value is set to 1. Experiment with different values for each shape. You can turn a raised eyebrow into a scowling expression. The envelope attribute doubles the usefulness of your blend shape. Modeling a Second Blend Shape Using the Open Shape To create a target shape, follow these steps: 1. Open M c t a r g e t s h a p e s . m b on the CD-ROM. 2. Use the slider to open the mouth. 3. Select the shape, and press Ctrl+d to duplicate the modified base shape. 4. Rename the result to o h . 5. Move oh to an empty area in the workspace. 6. To delete the history of oh, choose Edit Delete by Type History. 7. Since the mouth is already open , it will be easier to create the oh form from this shape. 8. Move and scale the CVs until you have a shape similar to that shown in Figure 5.15. Figure 5.75: The "oh" blendshape

136

C H A P T E R 5 • Lip-Synching Real-World Projects

Creating a Second Blend Shape To create a second blend shape, follow these steps: 1. Select the oh shape. 2. Shift+select the m o u t h _ p a t c h , and in the Blend Shape window, choose Create Blend Shape. 3. Test the results by moving the slider. The mouth should move inward to form an O. Because you will be creating a variety of shapes, remember to rename your shapes so that you can keep track of the sliders when you are keyframing. Don't forget to delete the history after duplicating an object.

Adding a Target Shape Computer animation depends on the ability to automate tasks and ease the workload of the nonartistic portions of an animation. Adding target objects to a blend shape will greatly reduce the amount of time to set keyframes on a character. You can set keyframes for multiple sliders with the click of a single button, but you can also control the sliders individually. Experiment with the sliders in the M c t a r g e t . m b file on the CD-ROM. You will quickly understand the benefits of using target and blend shapes. It's fun to make a variety of expressions, and in a short time you can have a completely animated sentence or animation. Once the blend shapes are set up, the lip-synching process moves quickly from one word to another. Multiple target shapes can influence a single blend shape, allowing for centralized controls and a simplification of the character-creation process. You can add as many target shapes as you want to a single blend shape using the Add button in a blend shape. This way each of the targets can be used individually or in combination with the other targets to form new shapes. Creating target shapes improves the functionality of blend shapes. All the controls are centralized and easy to manipulate. When you create a target object, the base shape is baked and used as the new shape. The target shape must have the blend shape in the object history. You will have multiple sliders to control using a single blend shape. This is advantageous since you can key and reset all the sliders individually or as a group using the Key All or Reset All buttons. If you choose Deform Edit Blendshape Add Options to create a blend shape, a separate blend shape is created. This is not a target object. Each blend shape must be added to a character, keyed and reset individually. Each blend shape can be combined with the others, but you must key each blend shape that influences the shape. When you have a large number of target shapes, you might prefer to change the display of the Blend Shape editor. This menu is found in the Blend Shape window under Options. You can view the blend shapes either vertically or horizontally. To add a target shape, follow these steps: 1. Select the m o u t h _ p a t c h , and set the oh blend shape slider to 1.0 2. Click the Add button in the mouth blend shape. 3. Move the new head shape to an empty area of the workspace. If you are positive you will not need to edit this shape, you can delete it. To be on the safe side, you might want to create a file that contains all the shapes you used to create the blend shapes and have a separate file without all the blend shapes. 4. Notice that a new slider bar has been created in the mouth blend shape controls. Experiment using a combination of the two sliders to form different shapes.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

Figure 5.16: Target shapes allow for easier control over blend shapes. 5. Repeat the process of creating blend and target shapes for the mouth shapes suggested in Figure 5.16. When creating facial expressions, you might experience unexpected results if you add or remove CVs.

Adding Movement to the Eyes and Forehead The movements of the eyes and the forehead emphasize the character's emotions and mirror their mood. If the eyes and forehead don't move, the lip-synching will be boring. Yet if the movement is overdone, facial animation is not believable. As with all aspects of lip-synching, you act as an artist, brushing just the right amount of emphasis or restraint. As an artist, you need to be consistently observant of the people around you. Notice what small facial expressions and quirks really make someone's personality memorable. When you are lip-synching, you can re-create these small details in your character, which catapult the animation to a new level of greatness! When creating blend shapes from a group of objects, it is important that the target object and the base object be grouped in the same order and have the same group members.

137

138

C H A P T E R 5 • Lip-Synching Real-World Projects

Figure 5.17: Manipulating the CVs into poses

Again, we'll manipulate the CVs into different poses. You will want to create the shapes shown in Figure 5.17. Pose A shows surprise, excitement, and enthusiasm. Both eyebrows are raised, and there are wrinkles in the forehead. The eyes are slightly more open. Poses B and C show questioning emphasis and surprise by raising one eyebrow. Pose D illustrates anger and disgust. There are wrinkles on the bridge of the nose and forehead, and the eyebrows are slanted inward. Creating a Look of Happiness or Surprise To create a look of happiness, follow these steps: 1. 2. 3. 4. 5. 6.

In the Outliner, select the e y e _ f o r e h e a d patch. Press Ctrl+d to duplicate the objects. Rename the new group h a p p y . Move the group into a blank area of the workspace. Press F8 to switch to Component mode. Select the CVs closest to the nose on the left eyebrow, and move the selection upward, as shown in Figure 5.18. 7. Repeat step 1 for the right eyebrow.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

Figure 5.18: Select similar CVs to move the left eyebrow and forehead upward in surprise.

139

Figure 5.19: Select these CVs to make the eyes widen in surprise.

8. Move the CVs along the bridge of the nose and the center of the forehead forward and up to create wrinkles. When creating shapes, avoid moving the CVs on the outermost isoparm of the patch. Otherwise, you will have unexpected wrinkles in the blend shapes.

9. Select CVs on the top half of the eye and eyelid and move them upward, to widen the eyes, as shown in Figure 5.19. Be careful to choose only the CVs you want to move. It is easy to inadvertently select CVs

10. Manipulate the CVs until you are satisfied with the shape, and then choose Edit Delete by Type History. Creating a Blend Shape Using Groups Blend shapes are also useful in animating more than one object in unison. For example, the eyes and eyebrows are separate geometry that need to stretch and move according to the motion of the cheeks and forehead. You will want to make sure that the blend shape has exactly the same members as the target shape and that the two groups hold the objects in the same order. If the order is different, the blend shapes will not work properly. You will probably end up with a character that fits perfectly in a horror movie. Using groups allows you to keep a smooth relationship between the objects.

140

C H A P T E R 5 • Lip-Synching Real-World Projects

To create a blend shape using groups, follow these steps: 1. Press F8 to switch to Object mode. 2. In the Outliner, select the group h a p p y . 3. In the Outliner, Ctrl+select the e y e _ f o r e h e a d _ p a t c h . 4. Switch to the Animation menu. 5. From the main menu, choose Deform Blend Shape. 6. Rename the blend shape u p p e r _ f a c e . 7. Test the sliders to watch the face change from calm to happy. Change the envelope attribute to -0.50 and move the slider again. Notice that the eyebrows can now move down in anger or up in concern. The slider range below zero makes the eyebrows move downward, and the range greater than zero makes the eyebrows move upward. Repeat steps 1 through 7 to create other facial expressions. As with the mouth blend shape created earlier, use the u p p e r _ f a c e blend shape to hold multiple targets. Putting It All Back Together Even though we want separate control over portions of the face, the animation would be a little disturbing if we were to watch a talking head in three pieces, so we need to figure out how to put MC back together again. Test each slider to make sure you are satisfied with the results. It is easy to edit the blend shapes at this point. Once the separate surfaces of the head are reattached, you won't be able to create separate blend shapes for the eyes and mouth, but you can always duplicate and reshape the entire head to achieve the desired pose. Since the pieces of the face are working properly, the surfaces can be reattached. To put MC back together again, follow these steps: 1. Select the m o u t h _ p a t c h and the e y e _ f o r e h e a d _ p a t c h .

2. 3. 4. 5.

Press F8 to switch to Component mode. Set all components to Off. Click the Isoparm button. Select the two isoparms where the surfaces touch, as shown in Figure 5.20. (Ctrl+click to deselect unwanted isoparms.) 6. Choose Edit NURBS Attach Surfaces. 7. Repeat steps 1 through 6 using the e y e _ f o r e h e a d _ p a t c h and the b a c k _ p a t c h .

MC is back in one piece. Switch to Object mode, and select the head. The entire surface should appear green, as in Figure 5.21.

Controlling the Face as a Whole Now you can animate the upper and lower portions of the face, but wouldn't it be nice to place all the controls into one slider? For some emotions, such as anger or happiness, you can combine the sliders for different parts of the face, as shown in Figure 5.22.Continue working with the blend shapes in the file you have or use M c b l e n d e d . m b from the CD-ROM to complete this portion of the lip-synching process. The M c b l e n d e d . m b file contains all the blend shapes.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

Figure 5.20: Select these isoparms to reattach the surface.

141

Figure 5.21: The three sections of the head are reattached to form one shape.

Figure 5.22: A happy face and the sliders used to create the form

To combine the sliders, follow these steps: 1. Select the head shape, the eyes, the eyelids, and the eyebrows, and press Ctrl+g to group the objects together. Name the group head. 2. Move the sliders until you get the facial expression you want. 3. In the Outliner, select the head group and press Ctrl+d to duplicate the face. Move the head to a clean portion of the workspace. Name the group a l 1 .

142

C H A P T E R 5 • Lip-Synching Real-World Projects

4. Delete the history. 5. In the Outliner, select the groups all and h e a d . Now create a new blend shape. 6. Repeat steps 2 through 5 for other emotions, and then add the combined facial expressions as target objects.

Creating a Character A character allows you to key multiple objects as a single entity, which is exactly what we need to do when lip-synching. When assigning members to a character set, you determine which attributes from the objects can be keyed. Creating a character also allows you to create clips and reduce animation time through nonlinear animation techniques. Once you create a character you can add subcharacters to the character set. Characters let you animate quickly and efficiently while keying only the necessary attributes. Creating characters helps to organize the clips and lets you easily see the keys for each frame. Pay attention when setting your character. You will notice some crazy, not to mention strange, results if you forget to set the character. To create a character, follow these steps: 1. Be sure that nothing is selected and that you are in the Animation menu. 2. Choose Character Create Character Set 3. Name the character MC, and set Character Set attributes to From Channel Box. Once the character is created, you need to assign the attributes that can be keyed. 4. In the mouth Blend Shape window, click the Select button. 5. In the Channel box, highlight the shapes you want to include in the character, as shown in Figure 5.23. 6. From the main menu, choose Character Add to Character Set. 7. For each blend shape, follow steps 4 through 6, adding the characteristics you want to animate to the character set. Be sure to include all the shapes you need for lipsynching. Figure 5.23: Attributes to include in the character set

Creating a Lip-Synching Library This is the stage where all the planning and blend shape creation proves beneficial. You will discover that words in your script are often repeated. Creating a word library lets you animate a word one time and reuse the animation each time the word is spoken. Depending on your script, you will probably notice that portions of words are used repeatedly. Often, you can simply tweak a word you have already animated to create a new word. You can also transfer the library to other characters.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

Just as we created the blend shapes in sections, it is also easier to animate in sections. Concentrate on the mouth movement first. When you are pleased with your animation, add the eyes and forehead. Work in steps so that the task does not become overwhelming. We will have separate clips for the mouth (word) and eye (emotion) shapes. They can be arranged to coincide in the Timeline at a later point. Here are some guidelines to follow as you create the library: • Use a mirror and watch yourself speak. Notice how your mouth moves, the shapes it forms as you say specific sounds, and the amount of movement. • When you are lip-synching, be a minimalist. Listen to the words and determine the most prominent sounds. Animate the word using the shapes that make up the main sounds only. Watch your animation, and you will be surprised at the results. Your mind will fill in the remaining shapes. • Create playblasts to monitor the movement. You will soon discover that it is much easier to fill in gaps in the lip-synching than to remove unnecessary animation. The rate of speech influences how much detail you place on each word: the faster a character speaks, the less movement you need to give to an individual sound. The phonemes influence the character's movements before and after they are spoken. Consider the timing of each movement. If a character suddenly opens its mouth or pronounces a long vowel, you may find it necessary to tone down the movement. The mouth will appear as if it is randomly moving out of control if you do not allow enough frames for the motion to take place. Creating a library lets you use the Trax Editor to edit a clip as necessary each time the word is used.

Creating Word Clips The word library is composed of a multitude of clips. A clip will be created for each word used in the script. While lip-synching, you'll be surprised to see how quickly people speak and how few frames of animation each word receives. It's easy to overanimate lip-synching. Remember to lip-synch according to the phonetics of each word, and also remember that one word will need to blend into the next. We will create clips for each word based solely on shapes made while saying the words. Later in this example, we will scale the clips so that the action matches the timing of the voice. Our character, MC, aka Monsieur Cinnamon, is a French actor in a croissant commercial. Let's animate one of his lines: "Zay are magnifique!" The sentence is composed of three words, yet we are going to create four clips: one for each word, and another to use as a beginning and an end pose. The words influence one another, and you will achieve a smoother transition between clips if you have separate open and closed clips. Do not set keys for the opening and closing motions at the beginning or end of an individual word. The main sounds are long a for zay, r for are, and mag, na, feek for magnifique. We'll use the closed clips to position the mouth before the animation begins and blend the phonetic shapes with the closed shapes. Since the motion of talking occurs so quickly, the mouth does totally close between words. If you close the mouth in each of the clips you create,

143

144

C H A P T E R 5 • Lip-Synching Real-World Projects

the mouth will appear to be moving rapidly out of control. Even if the clip looks fine, when you scrub through the animation, it will look over done when the words are joined together. Keep in mind that 30 frames equals 1 second, and sometimes people speak more than one word per second. Minimalization is the key to successful lip-synching. A clip can consist of only one or two keyframes. For example, the words "zay" and "are" have only one keyframe that is scaled to last the length of the word. Each clip will begin at frame 1 and can be moved to a new position later . Follow these steps: 1. Open M C 1 a s t . m b from the CD-ROM to see a finished version of the clips and final animation. Open M c r e a d y t o t a l k . m b to begin adding clips, or you can continue working in your own file. 2. Set the character to MC. 3. Listen to the M c m a g n i f q u e . w a v file on the CD-ROM to hear the voice you will be lipsynching. Try to picture the shapes that you will need. 4. Open the Blend Shape window (choose Window Animation Editors Blend Shape. Be sure that every blend shape you want to use Is assigned to the character set before you begin setting keyframes.

5. Move to frame 1 and create the zay clip by moving the slider within the mouth blend shape (remember you can also use a combination of sliders) until you have a shape similar to that in Figure 5.24. 6. Click the Key All button on each of the blend shapes you moved to create the shape. This clip will only contain one keyframe. 7. Switch to the Animation menu. 8. Choose Animate Create Clip 9. Name the clip zay. 10. Click the Put Clip in Visor Only check box, and create the clip. 11. Create the "are" clip by following steps 1 through 10. 12. Name each of the clips for the word you are animating. Figure 5.25 shows the "r" sound that MC says next.

Figure 5.24: Combing the results of the ah slider with a little of the ee slider will form a long a shape.

Figure 5.25: Slider positions used to create an "r" shape

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

13. Follow steps 4 through 12 to create keyframes for the word "magnifique," as shown in Figure 5.26. You will need four keyframes. Start at frame 1, and leave one to three spaces between each keyframe. You can leave more spaces if the position of the mouth is moving from a mostly open to closed position or vice versa. When setting keyframes for the words, allow one frame between consonant sounds and two or more frames on both sides of long vowel sounds. Later in this chapter, we'll scale the clips to match the length of each word. 14. Create a clip named c l o s e d , in which the mouth is closed. This clip should only be one keyframe. You might want to create a few different closed clips to add variety to the animation. For example, you could create a closed clip, a smile, a frown, and a barely open clip, as shown in Figure 5.27. Don't forget you can use the happy face blend shape you created earlier as a starting or stopping point for the sentence. Don't forget to make clips for the eyes and forehead!

Figure 5.26: Suggested shapes to form the word "magnifique'

145

146

C H A P T E R 5 • Lip-Synching Real-World Projects

Figure 5.27: Examples of different "closed" clips

Using the Trax Editor Whew! Now that the clips are created, we can begin to synch the clips with the sound file. The clips you created are stored in the Visor. You can open the visor from the main menu by choosing Windows General Editors Visor. Click the Clips tab to see the clips you have created. If the clips do not appear, be sure you have chosen the appropriate character. MM drag the clip from the Visor to the appropriate character in the Trax Editor. You can use the Trax Editor to organize and rearrange the clips you have created, which gives you maximum usage from each clip. Creating a Sentence from Character Clips The process of matching the mouth movement to the emphasized sound is accelerated because of the blend shapes you created. Organizing the clips is a simple way to quickly animate a large number of words. As your word library grows, you will gain a better understanding of the capability of each blend shape, increasing your lip-synching speed. This portion of lip-synching requires patience and an artistic eye. Playblasts are a quick way to see the results of your work. You will find that a good deal of tweaking may be necessary to make the lip-synching believable. Have fun with lip-synching and try not to become frustrated. To create a word from character clips, follow these steps: 1. Make sure the sound track is represented by green lines in the Timeline. Right-click the Timeline to select the name of the file you want to display. To Import sound, choose File Import and browse to the sound file you want to reference. In this case, choose M C m a g n i f i q u e . w a v from the CD-ROM.

Hands-on Example 1: Lip-Synching Using Blend Shapes and the Trax Editor

2. Place the following clips in the Trax Editor: closed mouth, zay, are, magnifique, and a second closed mouth. 3. Place the closed mouth clip four frames before the character should begin to speak. MM scrub over the Timeline to hear the sound track.This will help you coordinate the sound and the movements.

4. Place the zay clip on the frame with the first green sound line in the Time Slider. 5. Align the other clips so that they begin a frame or two before the matching word is spoken. Scaling Clips Scaling a clip is a great way to extend the use of your animation work. When words are repeated, they can be spoken at different rates of speed. If the character is excited, it might speak faster than normal; if the character is distracted, its speech patterns might slow down. Scaling a clip lets you use the same clip each time a word is spoken, even if the speed or emphasis of the word is different. To scale a clip, mouse over to the lower end of your clip. A straight arrow with a line appears, indicating that you can now drag to scale the clip (see Figure5.28). Cycling a clip lets you repeat an animation as many times as the script calls for. Cycling a clip is especially useful when someone is laughing. You can set the cycle to Relative to add a little variety to the motion, or you can set the cycle to Absolute to begin and end the clip exactly the same each time a cycle completes. To cycle a clip, mouse over the top end of your clip. A curved arrow will appear. Drag the clip to the desired ending position. A black tick mark denotes a complete cycle. You can scale and cycle a clip more than once, giving yourself a wider variety of results from the same piece of animation. To scale a clip, follow these steps: 1. Scale the clip until it matches the length of the word. You can scrub through the Timeline to hear when each sound is said and when words begin and end. This should be all the scaling you need to worry about for the words zay and are. 2. Right-click the magnifique clip and choose Activate Keys to return your keys to the Time Slider for editing. 3. The keyframes begin with frame 2. To simplify the scaling process, Shift+click frame 1 in the Time Slider. Drag the mouse until a red bar covers the last key. (Keyframes are denoted by red bars in the Time Slider.) 4. Click the middle two arrows in the red bar, and drag the keys to the frame before MC begins to say "magnifique." Now you can continue to edit the keys in the Timeline so that the movements are scaled to match the sounds. 5. Scrub through the Timeline and listen to magnifique. Shift+click and highlight the keys you need to position, and move them to the appropriate position in the Time Slider. Match the placement of the keys in the Timeline (or Graph Editor) with the emphasized portions of the words.

147

148

C H A P T E R 5 • Lip-Synching Real-World Projects

6. Return to the Trax Editor window and right-click the magnifique clip. Choose Activate Keys to remove your keys from the Time Slider, which allows you to use the magnifique clip. In this way, the shapes are formed as the words are spoken. Once you are familiar with scaling keys, this portion of the process will move quickly. Since the sentence is spoken without a pause, blending the clips provides a smooth transition between words. Notice that the mouth does not close entirely after every word. Use the closed mouth shapes at the beginning or end of a phrase. If there is a long pause, consider whether the character is happy or sad and what needs to be portrayed during a pause. You might want to blend the nonverbal clips with the word clips. 7. Select the zay clip and Shift+select the are clip. 8. In the Trax Editor, choose Create Blend. 9. Create blends between the remaining clips. Scrub through the animation. If the character's movements are overemphasized, make the correction in the Trax Editor. The weight attribute determines how much movement appears in the animation. To reduce the effect of a blend, lower the weight. If you want to exaggerate the motions, increase the weight. The script might call for the same word to be whispered in one scene and screamed in another, or perhaps sometimes the words are just overexaggerated. The weight of the clip influences the extent of action in each clip. Select the clip, and in the Channel box, set the weight to 0.2. Now, scrub through the animation. Change the weight back to 1, and notice the results. The weight attribute is useful for conveying emphasis and emotion. When you play back the animation, you will discover that you need to reduce the weight of each clip. Experiment with values from zero to 1 until you are happy with the results.

Testing the Lip-Synching: It is finally time to see the results of your hard work! Create a playblast and let the talking begin! If MC's movements appear to lag a frame or so behind the sound, you can offset the sound track in the Timeline. Follow these steps: 1. Right-click the Timeline. 2. Choose Sound name of your track 3. In the Audio Attributes options, set the offset to -2. Alternatively, you can drag+select all your Trax clips and move them two frames or so to the right in the Trax Editor.

Tweak the clips until you are pleased with the lip-synching, as shown in Figure 5.29 (also see a rendered sequence of MC speaking in the file M C m a g n i f i q u e . m o v on the CD-ROM). If the mouth looks as if it is moving wildly and is not in synch with the sound, you probably tried to create too many sounds for a word, or you need to reduce the weight assigned to the clip. Remember to lip-synch phonetically, and not according to the actual letters. Now that you are pleased with the words, add some movement to the upper portion of the face. You might want to set the character to MC and simply create one clip of movement that covers the entire sentence, by setting keyframes throughout the Timeline each time you want movement. Again, do not overdo the motions of the forehead and the eyes. Say the

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

Figure 5.29: MC in action!

sentence while looking in a mirror. Notice when you move the upper portion of your face, and re-create those movements using the blend shapes you created. Don't forget to add movement to the character's head. Remember, a person's head is not still as they speak! Keep in mind that lip-synching requires an immense amount of patience and attention to details. The minor quirks or subtle movements in an animation separate the good characters from the great ones.

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching In stop-motion animation, lip-synch is essentially achieved through "head replacement" techniques. In these cases, the entire head is removed from the armature puppet or molded model and replaced with an exact duplicate head that has a different mouth position. In CG animation, the concept remains much the same. We typically go about lip-synching by replacing the head much the same way by using blend shapes, a.k.a. morph targets. At each frame, the digital model is seamlessly swapped out for another with a different mouth shape. The actual process of 3D lip-synching using blend shapes doesn't remove one head in favor of another. In actuality, it deforms the model's head or mouth area to fit the shape of another model of the head with that mouth position in mind. Still, it is much simpler, yet still fairly accurate, to also refer to this technique as "head replacement."

149

150

CHAPTER 5

Lip-Synching Real-World Projects

Defining the Task In more and more effects shots, whether for film, television, or the game market, the digital animator is asked to create a talking creature or person—such as a baby—from a live action shoot, to augment the reality already captured on film or tape. When dealing with an otherwise real person or animal, it is a waste of time and energy to create a full head to match the live action subject, and a more direct replacement technique is required: mouth replacement. The purpose of this example is to replace a mouth on a loyal and patient pet cat, Rox. With this type of lip-synch, we are going to replace only a part of the talking animal or person (or any other object for that matter), as opposed to setting up an entire head and rigging only the mouth to talk. Since the subject is already shot, in this case a digital still photo, and we are making a photo-real animation, it becomes incumbent on us to use as much of that information as possible and minimize the amount of CG inserted into the scene. In this example, we'll start with a rudimentary snout for the cat and use the live action still image as a direct texture for it. It makes no sense to try to work umpteen different shaders and lights to try to match the live action background when we can just use the real photo. Once we accomplish that, we'll build several replacement blend shape snouts to mimic mouth movements and, along with a simple joint structure for jaw movement and an internal mouth structure, create a deformation chain that includes clusters to make the cat talk.

Modeling Rox's Snout First, we should take a look at our live action plate(s). In this case, we'll be using R o x . t i f (in the s o u r c e i m a g e s folder of the R o x _ l i p _ s y n c project on the CD-ROM) as the BG plate. This image is at NTSC standard D1 resolution, which is 720 by 486. To match your render output to this resolution, open the Render Globals and select CCIR 601/Quantel NTSC in the Resolution Presets. Once you change your resolution, open you camera attributes editor. Change the Film Gate to 35mm TV Projection. Load the image into your Perspective window (persp) by choosing View Image Plane Import Image in the Perspective window. In most cases, it should come in fitted slightly off your resolution gate. Open the image plane attributes, set the Fit to To Size, and click Fit to Film Gate. You should now have the image perfectly fitted to your Perspective window's resolution and film gate. What you see in this window is what will render. In the interest of brevity, we'll condense the modeling portion of this exercise to only say that we'll begin with a NURBS shape that was lofted together using profile curves loosely matching the profile of the cat's snout. With this sort of mouth replacement, it is not at all necessary to create a dead-on model of the cat's snout. We're aiming for something that fits over and gets the general shape and proportions of the snout. To achieve that, we'll take the model, match the camera angles as best as we can, and then eventually tweak the geometry to conform to the outlines of the cat's snout. But we're getting ahead here; let's get back to the basic snout model and the gums and teeth. The only serious point to remember in creating the model is to pay close attention to the overall outside shape; try to match the outside edges of the model to the subject. Of course, if the subject is moving and exposing multiple angles of itself, your model will have to be more accurate, since the snout needs to be precisely motion tracked to the live action subject.

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

1 51

For the most successful motion track, track the length of the shot in segments of movement broken into directions. For example, a segment might start at a slight tilt of the head up and end when the head stops moving up or changes direction while moving up.

Setting Up for Animation Now, for jaw movements and the ability to easily position and track the snout to our subject, we'll insert a short joint chain leading from the base or the back of the snout, to the jaw hinge, where we'll fork into the lower and upper jaws. Figure 5.30 shows the result we're after. You can use R o x _ S n o u t _ M o d e l . m b in the s c e n e s folder of the R o x _ l i p _ s y n c project on the CD-ROM as a starting point. This file includes a basic snout model. It also contains the original curves on which the model was lofted to give you a good idea of how it was created. You can use this model to build your skeleton and the inside of the mouth. Depending on your subject and the angles of view, you might want to include a tongue inside the mouth. For this, insert an extra joint between the jaw hinge and the lower jaw joint to be the attach point for the tongue. Don't worry about attaching a tongue and its subsequent joint structure to the lower jaw by way of this interim joint until you've bound the snout to its bones and painted its weights appropriately. In this exercise, we won't need a tongue. You'll also need to build the inside of the mouth, unless you're trying to lip-synch telepathy. To do this, instead of creating a complicated snout surface that wraps inside to make the gums and so forth, we'll create a simple row of lower jaw gums. Inset into those gums are the basic teeth. These will all be grouped under the lower jaw bone, as opposed to being skinned to them, as shown in Figure 5.31. The file R o x _ S n o u t _ M o d e l _ W i t h _ B o n e s . m b in the scenes folder of the R o x _ l i p _ s y n c project on the CD-ROM will outfit you with the snout model with the gums and teeth and with the skeletal chain in position, but unbound. Simply load this file to group your teeth, bind your skeletal system to the snout, and paint their weights, or continue with your own model.

Figure 5.30: A simple joint structure to animate the jaw movements

Figure 5.31: Group the gums and teeth under the joint system, but don't bind them.

152

C H A P T E R 5 • Lip-Synching Real-World Projects

The only thing that remains is to attach the gum geometry to the inside of the lips. By selecting isoparms on the outside edge of the gums and the inside edge of the lips, we can choose Edit Curves Duplicate Surface Curve with history turned on to make lofts that extend between the two geometries that will deform and fit as the mouth shapes change, as shown in Figure 5.32. Now it's time to bind the geometry to the bones. If you have already grouped the gums and teeth under the joints, go ahead and temporarily ungroup them from their joints. Once we bind the snout to the joint system, we'll regroup the gums and teeth back to their respective joints so that they move properly when the jaw is rotated. We're doing this because it makes no sense to skin them to the joints Figure 5.32: Loft surfaces between the gums and the along with the rest of the snout. model's lips, and keep the history. Select the snout, select the root joint, and then choose Bind Skin Smooth Bind. This attaches our geometry to the joint structure fairly well, but we need to paint some weights to make it perfect. In Shaded mode (click 5 in the persp window), select the snout geometry, and choose Skin Edit Smooth Skin Paint Skin Weights Tool (see Figure 5.33). Choose a round feathered brush, and set a good upper limit radius for your brush shape. In the Influence section of the Tool Settings window, select the very bottom joint of the lower jaw and make sure that the entire snout geometry is painted black. You want no influence coming from the bottom level joint. Do the same for the bottom joint of the upper jaw. You RM click to select the joint in the modeling view to select it for painting, but you can't use the left mouse button.

In this example, paint the weights so that only the lips and front snout move when the jaw joints are rotated. You don't want

Figure 5.33: The Paint Weights tool

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

any unnecessary movement toward the back of the snout, as that will have to blend into the live action plate. On more thorough projects when more than the snout is being replaced, however, it would be wise to paint some weight farther down the jaw to better mimic real movement in muscle and skin. Because this exercise only calls for the jaw joints, and subsequently the painted weights, to make general jaw movement, the weights painting should be relatively straightforward. Figure 5.34 shows the painted weights of the four major bones in the skeletal chain. Notice how only three joints truly control the model: root joint, upper jaw joint, and lower jaw joint. When you've painted all the weights, grab a frosty beverage, put your feet up, rest your wrist, and check out what's cooking on TV. A relaxed animator is a happy animator.

Texturing Setup At this point, before we set up our shading, we're going to duplicate (without history) the snout geometry once. Make sure your joints are at the bind pose, and if not, select the root and choose Skin Go to Bind Pose.

Figure 5.34: View of the four major bones and their painted weights.

1 53

154

C H A P T E R 5 m Lip-Synching Real-World Projects

if you are not at the bind pose before you duplicate your snout for the blend shapes, your blend shapes will not work later in the procedure. It is vital to be at the bind pose before you copy the snout. Otherwise, the deformation chains will be out of order, and your blend shapes will double transform when you animate the blends.

Select the snout geometry and duplicate it (again, without input connections turned on or upstream connections). This will be the base for your blend shapes. Keep it out of the way, hidden or templated, for now. Later we will duplicate that head 11 times and lay out all the heads in a nice grid. Those will be our blend shapes. The file R o x _ F i n a l _ R e a d y _ f o r _ T e x t u r e . m b in the s c e n e s folder of the R o x _ l i p _ s y n c project will catch you up to this point. It has the snout model, inner mouth, bound skeleton with painted weights, and one copy of the blend shapes ready for you. Just add texture, one cup of boiling water, and stir! Creating a Camera Projection Shader To create a texture for the snout, we'll use the background plates as camera projections based right off our renderable camera. Follow these steps: 1. 2. 3. 4. 5.

In the Multilister, or Hypershade if you're a weirdo, create a new Surface Shader node. For its Out Color, click the Map button. Turn on As Projection and select File. On the projection node of this new shader, set the Proj Type to Perspective. Under Camera Projection Attributes, select perspShape node.

For our file node's Image Name attribute, we'll use the live action plate(s) that we're also using as an image plane. Click the Browse File button, and dig out that file or sequence of files and apply it. For this, we'll use R o x . t i f from the CD-ROM and not worry about an image sequence.

Setting Up the Texture Reference Object Select the snout geometry you've created (or the snout geometry named m o d e l in the file R o x _ F i n a l _ R e a d y _ f o r _ T e x t u r e . m b in the s c e n e s folder of the R o x _ l i p _ s y n c project on the

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

1 55

CD) and assign your shader to it. If we were to leave it there, any deformations on this object would make the texture swim on the object, and the effect would not work. We need to make the projected texture "stick" to the object. For that, we'll create a texture reference object, which will make another copy of the snout that Maya will use to reference the texture information to map to the actual rendered snout. Select the snout, and in the Rendering menu, choose Texturing Create Texture Reference Object to make a templated copy of the snout at the exact position of the snout. Now, duplicate the joint structure (preferably without the tongue joints attached if you decided to create them). We'll be attaching that copy to the templated texture reference object with a smooth bind. Now select the renderable snout, select the texture reference object, and in the Animation menu, choose Skin Edit Smooth Skin Copy Skin Weights to duplicate the same skin weights from one snout to the other. We want both snouts to move precisely together when we line them up with the real cat. And indeed, when we track the built snout to a live moving subject. So, to summarize, we'll position and track both the renderable snout and the texture reference object at the same time by manipulating both skeletons. Once we position the snout and the texture reference object using both joints to match the picture of my cat in your persp window (see Figure 5.35 in the next section), we'll be ready to get on to finishing the lip-synch setup. If the model is not lining up precisely with the view, don't fret; we'll need to do the lining up on a component basis. Finessing the Fit Once you have the snout in position, you'll need to fit the snout precisely to the real cat, and for that you will need to select the CVs of both the renderable snout and texture reference object in the areas that need to be nipped and tucked and make clusters of them. Only then move them to fit the cat (in the Animation menu, choose Deform Create Cluster). By using clusters, you're putting these deformations at the end of the deformation chain, allowing the other deformations (the IK and blend shapes) to happen first. Tweaking geometry like this without the benefit of these clusters will produce undesirable results, and it will make Maya angry. You don't want to see Maya angry. See Figure 5.35. If the lip-synch were to be to a sequence as opposed to a still image (like the one for this example), you would need to 3D match move/camera track to the footage. In that case, you need to track both skeletal chains (and hence the models, since they are bound to the chains) to the background image. Figure 5.35: Using clusters to fit the models to the shape of Rox's snout

156

C H A P T E R 5 • Lip-Synching Real-World Projects

You have to make sure that both the renderable skeleton chain and the reference object skeleton chain are tracking precisely together. If one is off, the texture in your final render will slip and swim. If you motion track using only one set of joints, make sure you copy the animation from the Render chain to the reference object chain or vice versa. Otherwise, just be sure to select both joints at once when making your rotations and movements in your tracking. Selecting both joints simultaneously should be fairly easy since the joints are right on top of each other. Just use a marquee selection (drag the mouse over the joints to select them both) to grab both. It seems like a good idea to use a constraint or an expression to make the joints have the same motion and orientation automatically, but you would not want this. Once you have the snout positioned and/or tracked to the background, you'll want to have some measure of independent movement in the render joints, most typically in the lower and upper jaw joints. Having them tied to the reference joints will disallow any independent movement for your animation, and you will be unable to move the upper or lower jaw joints of the render model to lip-synch. We have two skeleton chains so that we can track both the reference object to the moving texture and the renderable snout to the BG plate of the cat's head. We don't simply assign both the renderable and the reference texture object to the same chain because we need the ability to manipulate the renderable snout's joints differently. We will need to animate some of the joints of the renderable snout independently of the reference object snout. For example, we'll need to move our renderable object's jaws to animate to the lip-synch, while leaving our texture reference object's jaws unmoved, if both the renderable snout and its texture reference object were bound to the same skeletal chain, this would be impossible.

As long as the texture reference is tracked properly, the textures will not swim on the renderable object. As long as the track (except for the jaws' movement caused by talking) for the renderable object is also accurate, the third track will be spot on as well, creating a seamless scene in the final comp. See Figure 5.36. The track might involve more than simply rotating the joints to keep the snout in position. It might also involve animating the clusters you've created to tweak the geometry into place.

Creating the Blend Shapes After you conform your model to the start position of the subject or track it to the length of the clip, you're ready to model some morph targets. Hold on to your socks, and call your mom and tell her you love her. Moving CVs around on eight models can be utterly annoying. Let's get back to the duplicated snout. For this scene, we'll need about 8 different mouth shapes. But let's make 12 blend shapes to fit to right now. Duplicate the blank snout 11 times, and arrange the duplicates nicely in a grid, out of the way of the main Perspective view, as in Figure 5.37. It's fairly easy to add more blend shapes into the scene when you need them, but it's not a bad idea to insert a few "blanks" right now for future use, just in

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

1 57

Figure 5.36: Both models conformed to fit Rox with clusters case. If a new mouth position is needed, you can pull up one of the blanks, make the new shape, and, presto, it's already in the blend shapes. Figure 5.37: The grid of different mouths for the With your 12 copies, make 8 different mouth blend shapes shapes for the major vowels and consonants. Make sure you hit two different O shapes and one A, E, U, M, T, and FAV. That should cover you fairly well, though you're more than welcome to make more mouth shapes according to the audio you have to synch to. When you're working with your blend shape objects, be sure not to freeze transforms on them. That will mess up the deformation order and give undesirable results. You can adjust the blank blend shape objects fairly easily by moving the proper CVs on the models. You can also use deformers such as a lattice, but CVs are preferable because they are straightforward for this model and easy to manipulate. For example, to make an O shape, grab the first couple rows of CVs in the middle of the top lip, and move them up. Similarly, grab the first few rows of CVs in the middle of the lower lip, and move them down. It's advisable to create more than one O shape to add variety. We've set up the blend shapes for the file R o x _ F i n a l _ N o _ A n i m . m b in the s c e n e s folder of the R o x _ l i p _ s y n c project on the CD-ROM with two blank O shapes for your modeling use. A U shape is essentially the same as an O, but more sharply curved than an O. For an A shape, grab the first few rows of the upper lip CVs, and move them up little bit. Grab the middle ones, and move them slightly higher. Grab the first few rows of the bottom lip CVs, move them down a bit, and scale them out horizontally slightly. For an E shape, grab the first few rows of CVs on the bottom and top lips, and scale them away from each other a little bit, and scale them out horizontally a little bit. Scaling the group of CVs up and out like this will separate the lips evenly and also elongate the lips slightly horizontally, as if you were stretching your lips to say "cheese." An M shape is essentially like an E shape, but scaled down and in as opposed to scaled up and out. This will close the mouth and slightly purse the lips.

158

C H A P T E R 5 • Lip-Synching Real-World Projects

An F or V shape starts with an E shape. Grab the CVs of the first rows of the bottom lip, and move them up toward the upper lip. A T shape is also like an E shape, but it only involves moving and scaling out the top lip CVs to bring the upper lip slightly higher. Grab the first few CV rows of the edges of the upper lip and bring them slightly higher than the middle, making a bit of a smile. See Figure 5.37 for an example of mouth shapes. The file R o x _ F i n a l _ N o _ A n i m . m b in the scenes folder of the R o x _ l i p _ s y n c project on the CD-ROM will provide you with a fully built and bound snout and skeletal chain that has already been conformed to fit the background plate. The blend shapes are provided and set up, though the task of actually building the mouth shapes is left up to you. It is important to make your own mouth shapes for animation, as it will give you more control over the lip-synch. Be sure not to delete or add any CVs or isoparms to any of the blend shapes. All the blend shapes need to be uniform with the original renderable object in that respect.

As a matter of habit, name all your blend shape snouts according to their letter sound. Select the blend shapes in the order that you would like them to appear in the Blend Shape Editor, select the renderable snout, and choose Deform Create Blend Shape In the Create Blend Shape Options dialog box, make sure that In-Between and Delete Targets are turned off and that Check Topology is on, as in Figure 5.38. By leaving the In-Between check box cleared, we're setting up the Blend Shape Editor to display a separate slider for each mouth shape. In this way, we can combine different mouth shapes for even greater flexibility. And, of course, leaving the Delete Targets check box cleared will keep the original blend shape objects in the scene, in case you need to adjust the mouth shapes later, which you can do. Check Topology to make sure that the renderable snout object and the blend shape objects have the same number of isoparms and CVs. Click the Advanced tab (see Figure 5.39), and switch the blend shape type from Default to Parallel. Switching the blend shape type is important. If you don't do so, the renderable head will blend right off the joint system, forcing one of us to loudly snarl at you, swing our arms around violently, and throw our shoes at you. Nobody wants that to happen. By selecting Parallel, you allow the deformations on this object (namely the joint system, the blend shapes, and any clusters) to behave nicely toward one another. Otherwise, it's a World Wrestling Federation free-for-all. Setting the deformations to Parallel will set up the deformation order so that the blend shape deformations will occur in parallel or in tandem with the other deformations on the object, namely the skeletal deformations we've set up for the snout. Not setting the deformations to Parallel will create strange results when there is animation on the skeleton and the blend shapes. Once your blend shapes are set up, you're in business. Test one of the sliders in the Windows Animation Editors Blend Shapes, and make sure the snout doesn't fly off the joints. If it does, delete the blend shape and try it again, checking your settings. The most common issue will be one of two things. First, it might be that Maya hates you and will do everything it can to make sure your lip-synch doesn't come out right, or second, it could be that your joint chain was not in the bind pose when you duplicated you original renderable

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

Figure 5.38: The Create Blend Shape Options dialog box

Figure 5.39: On the Advanced Tab, be sure to select Parallel Deformation Order.

snout for the initial blend shape. This error is fairly common, but is no less annoying because it basically means you have to go back and redo all that again. At this point, clean up your scene file. Make sure it's all named properly. Make a few display layers and assign the reference object snout and its joints to one layer. Assign all the mouth and tongue stuff into another layer. Assign the blend shapes to a layer that's hidden. Assign the renderable snout and its joints to another layer, and so on. Be organized. The cleaner and easier the file is to work with, the better the result and less likely you'll need a stiff drink after the project. Animating the Lip-Synch This is it now; this is where we separate the men from the boys, the women from the girls. Lipsynch animation can be tricky. You need to keep a few elements in mind when lip-synching a character, the most important of which is that the animation doesn't start and stop with the lips moving in time with the words. First, it is important to gauge properly the intention of the talking animal. This may sound weird, but it's true. "What's my motivation?" whines an actor on set to his director. It's a cliche because it's true. Knowing what your lip-synch subject is saying is only part of the battle. You also need to understand why and how it's talking and what it's saying. These details may seem insignificant, but small details make up 90 percent of believability in an animation. The best way to track down motivation is to repeatedly listen to the track to that you're lip-synching. If possible, see the shot in the context of the entire piece to better understand what is happening before and after your shot. Listen to the tonal variations in the audio. Listen to the voice's cadence. Isolate lilts and other diminutive nuances that will help better flavor your lip-synch. Keep in mind that the purpose of this example is strictly lip-synch. Myriad facial movements accompany most well-done lip-synch animations. You can't move your mouth and make verbal gestures without moving the rest of your face, especially when emoting. Most commonly, 2D warping software is used to augment the type of lip-synch we're implementing here. However, because of space constraints, we'll leave out that facet of this animation. Ok, let's get to it!

1 59

160

C H A P T E R 5 • Lip-Synching Real-World Projects

Figure 5.40: The audio waveform is displayed in the Time Slider. "Do You Understand the Words That Are Coming Out of My Mouth?" Load R o x _ A u d i o . w a v from the CD-ROM into your media player and listen to it. You will be lip-synching about 30 seconds worth of audio. That's a lot of audio for one shot, but this example exposes you to lip-synch using only one setup. When you're comfortable with what the voice is saying and you have a good feel for how she is saying it, load the file into your Maya setup. Now, follow these steps: 1. Set the frame rate at 30fps. 2. Choose File Import. 3. Locate your audio file. It's better to copy the file onto your hard drive, into your s o u n d s directory in the current project if it's on a CD or removable drive.This step imports the file into the scene. 4. RM click the Time Slider, and choose Sound audio filename from the shortcut menu to display a cyan-colored waveform superimposed on your Time Slider, as shown in. Figure 5.40. If the waveform doesn't display, choose Windows Settings/Preferences Preferences. In the Sound section, set Waveform Display to All, as shown in Figure 5.41. 5. RM click the Time Slider again, and choose Sound Rox_Audio to display the Attribute Editor for the sound. 6. Set the offset to 1 instead of 0 to start the audio on frame 1 rather than frame 0. (Honestly, starting at frame 0 just gives me the willies.) 7. RM click the Time Slider (boy, we're sure doing enough of that lately!), and choose Set Range To Sound Length to set the Time Slider range to the exact length of your audio, which should now read frame 1 to 822. 8. Use the range slider to zoom in to a more manageable time range, such as 30-50 frames at a time that correspond to what the voice is saying. 9. RM click the Time Slider again, and choose Playblast (or use your hotkey or the menu selection). Be sure that the playblast will play in Movieplayer and not in fcheck. Windows Media Player or the QuickTime player will play the audio along with the visual playback while fcheck will not. To change from fcheck to Movieplayer, RM the Timeline and choose Playblast Options. Click the Movieplayer radio button. Now notice the audio in the context of your frame range. Once you playblast the scene or even click the Play button, the audio loads into memory, which makes scrubbing the audio back and forth rather speedy. Again, the file R o x _ F i n a l _ N o _ A n i m . m b in the s c e n e s folder of the R o x _ l i p _ s y n c project on the CD-ROM will bring you up to speed. All this file needs are the mouth shapes modeled into the blend shape objects already laid out for you and the final animation. Overall Mouth Movements Grab the slider in the Timeline and scrub the audio to get a sense of the gross or overall movement of Rox's jaw. Grab the lower jawbone and begin rotating it up and down to match the audio. Don't rotate too far down; a little goes a long way. This first pass is to time the gross mouth movement properly. For a slightly more animated or cartoon feel, place some rotations in the upper jawbone as well. Again, a little goes a long way, especially with the upper snout movement. These rotations accentuate the lip-synch overall.

160

C H A P T E R 5 • Lip-Synching Real-World Projects

Figure 5.40: The audio waveform is displayed in the Time Slider. "Do You Understand the Words That Are Coming Out of My Mouth?" Load R o x _ A u d i o . w a v from the CD-ROM into your media player and listen to it. You will be lip-synching about 30 seconds worth of audio. That's a lot of audio for one shot, but this example exposes you to lip-synch using only one setup. When you're comfortable with what the voice is saying and you have a good feel for how she is saying it, load the file into your Maya setup. Now, follow these steps: 1. Set the frame rate at 30fps. 2. Choose File Import. 3. Locate your audio file. It's better to copy the file onto your hard drive, into your s o u n d s directory in the current project if it's on a CD or removable drive.This step imports the file into the scene. 4. RM click the Time Slider, and choose Sound audio filename from the shortcut menu to display a cyan-colored waveform superimposed on your Time Slider, as shown in. Figure 5.40. If the waveform doesn't display, choose Windows Settings/Preferences Preferences. In the Sound section, set Waveform Display to All, as shown in Figure 5.41. 5. RM click the Time Slider again, and choose Sound Rox_Audio to display the Attribute Editor for the sound. 6. Set the offset to 1 instead of 0 to start the audio on frame 1 rather than frame 0. (Honestly, starting at frame 0 just gives me the willies.) 7. RM click the Time Slider (boy, we're sure doing enough of that lately!), and choose Set Range To Sound Length to set the Time Slider range to the exact length of your audio, which should now read frame 1 to 822. 8. Use the range slider to zoom in to a more manageable time range, such as 30-50 frames at a time that correspond to what the voice is saying. 9. RM click the Time Slider again, and choose Playblast (or use your hotkey or the menu selection). Be sure that the playblast will play in Movieplayer and not in fcheck. Windows Media Player or the QuickTime player will play the audio along with the visual playback while fcheck will not. To change from fcheck to Movieplayer, RM the Timeline and choose Playblast Options. Click the Movieplayer radio button. Now notice the audio in the context of your frame range. Once you playblast the scene or even click the Play button, the audio loads into memory, which makes scrubbing the audio back and forth rather speedy. Again, the file R o x _ F i n a l _ N o _ A n i m . m b in the s c e n e s folder of the R o x _ l i p _ s y n c project on the CD-ROM will bring you up to speed. All this file needs are the mouth shapes modeled into the blend shape objects already laid out for you and the final animation. Overall Mouth Movements Grab the slider in the Timeline and scrub the audio to get a sense of the gross or overall movement of Rox's jaw. Grab the lower jawbone and begin rotating it up and down to match the audio. Don't rotate too far down; a little goes a long way. This first pass is to time the gross mouth movement properly. For a slightly more animated or cartoon feel, place some rotations in the upper jawbone as well. Again, a little goes a long way, especially with the upper snout movement. These rotations accentuate the lip-synch overall.

Hands-on Example 2: Photo-Real Facial Replacement and Lip-Synching

Figure 5.41: Adjust the preferences to display the waveform.

161

Figure 5.42: The Blend Shape dialog box with Rox's mouth shapes

When you get to the end of the current time segment, move to the next segments until you're done with the overall jaw movements. Playblast and make sure everything looks okay. Now you're ready for the lip deformations through the blend shapes. Mouth Deformations Once you have the jaw movements timed correctly, the next step is to use the lip deformations to make the different mouth shapes. Choose Window Animation Editors Blend Shape Editor to open the Blend Shape dialog box, as in Figure 5.42. Now comes the fun part. Having spent oodles of time setting up and crafting our blend shapes, we're ready to spend oodles of time pushing some sliders and keyframes around. Basically, and this is about all there is to say about this stage, use the Blend Shape dialog box to match the mouth shape on the model to the sounds in the audio. The more you do it, the better and faster you get, but here are some guidelines: • Use a combination of mouth blend shapes to achieve a particular sound, phoneme, or vowel. • Mouth out the phonemes yourself slowly and pay attention to how your mouth forms before, during, and after the word or sound. Don't worry about looking crazy at your desk as you talk to your keyboard. We all do it. • Mouth shapes will differ between two instances of the same exact word depending on the context in which they are spoken and which words follow or precede them. • Try not to go from one lip shape to another in less than two frames or more than four frames. There are always exceptions to this rule, but be careful. You don't want the lips chattering too fast or moving in slow motion. • If a sound is being held for a while in the audio file, make the mouth shape and hold that shape, but add some slight movement in the lips and/or jaw. Never allow yourself to keyframe between two jaw movements/blend shapes in more than four frames, though. That would make it look as if the lip-synch is animated in slow motion. • Run a first pass for each 30-50 frame section, playblast it with the audio on, and then go back and adjust the joint rotations and blend shape keyframes to finesse your work.

162

C H A P T E R 5 • Lip-Synching Real-World Projects

Rendering the Snout Yikes! That was a lot of convolution. Photo-real mouth replacement is a multistep and fairly complicated process. You might think we're almost done, but there's more! The next task is to render out the snout. Turn off the image plane and render out the sequence you've finished. You'll then need to import your frames into your favorite compositing program, such as After Effects, combustion, Chalice, Shake, and so on. Since this is a book about Maya and not compositing, we'll only get into the concepts of the final comp. You'll need to composite the rendered sequence with its alpha channel over the background plates of the subject. Since you've already tracked the rendered sequence, it should fit over the plates perfectly at all frames. With Rox, we'll fit our rendered frames over a still image. Notice, however, that when the lower lips or jaw moves upward a bit, the cat's closed jaw from the plate beneath it is revealed. This situation forces us to paint parts of the cat's mouth out on the plate so that the moving jaw will reveal open space or the cat's neck. With a single frame, it's easy enough to paint these things out in Adobe Photoshop or another image editor. With a sequence of images for your plate, however, you'll spend a good amount of time painting and tracking bits of the real subject's jaw and mouth out. When you have painted out parts of the live action snout that will be revealed by the moving CG snout, comp the CG back on top. You may need to run some sharpening filters or color correction to match the plates. If you notice your snout rendering out too soft compared with the background plate, try turning off the multipixel filter in the Render Globals and the filter type for the file map of the cat in the model's shader (see Figure 5.43).

Figure 5.43: Turning off the filter type will help sharpen the texture file when it's rendered.

Final Touches You may have noticed that Rox doesn't have any whiskers. Well, we removed them. Before you call the ASPCA on us, we painted them out of the background plate in Photoshop. It would have looked mighty weird doing a mouth replacement without having painted her whiskers out. When the cat begins to talk and the snout deforms, the whiskers won't move, and that would look wrong. Now, however, we need to replace the whiskers with CG whiskers. You can do so with Paint Effects or geometry that is attached to the snout model, among other ways. We'll leave that up to you. What ultimately separates a good job from a bad job is the level of detail. By combining multiple layers of simplicity, you can create a whole of complexity that is elegant and professional looking. This example has taken us through essentially only one-third to one-half the battle in mouth replacement, the

Summary

Figure 5.44: Rox!

setup procedure. The rest of the battle lies in the animation that flows from your heart to your mouse to the screen. Sounds all New Age, but it's true. Only about the third or fourth time doing this example will you start becoming adept, so don't give up. Keep at it as long as it's fun or it pays. Figure 5.44 shows a still from the final animation ( R o x _ T a l k s . m o v ) , which is available on the CD-ROM.

Summary Although lip-synching isn't the "sexiest" animation job, it is extremely visible and difficult to get just right. Fortunately, Maya provides a tool set that makes this job much quicker and more accurate, especially for longer or series projects in which large amounts of dialog are spoken. Lip-synching is time intensive and exacting, but does offer a number of creative choices and is rewarding when done correctly. Whether done as part of a stylized animation, as in our first hands-on example, or to make a "real" animal speak, as in the second, lipsynching is an effect best judged by the way it disappears from our consciousness after a few moments. Like so much in life, if lip-synching is done right, it looks easy and natural, belying the vast work that goes into creating it.

163

Creating Crowd Scenes from a Small Number of Base Models Emanuele D'Arrigo

of3D computer graphics, nothing was scarier than dealing with lots of objects and polygons. The limited and expensive hardware of those years, together with the usually highly experimental, custom software, introduced pioneer artists to the concept of "rendering time." A long pause in the interaction with the console, sometimes minutes, more often hours or nights, was necessary to process the 3D data generated by the artist to produce a 2D array of pixels, the final picture. These pioneers watched with disbelief and amazement as simple objects happily flew around on the monitor after a night of rendering. And rendering time was strictly related to the number of objects and polygons in the scene. Well, I was barely a baby at the time, but what I fust described really hasn't changed all that much. Minutes, hours, and nights of rendering time must pass before we can see our animations. And this time is still primarily related to the number of objects and polygons in the scene. What did change, though, is the output. And what a change! Fueled by individuals and institutions interested in exploiting the potential of3D computer graphics, those early experiments became a billion dollar industry with almost no limits to what talented, creative people can visualize. If displaying a simple sphere on the screen was once a miracle, nowadays

168

C H A P T E R 6 • Creating Crowd Scenes from a Small Number of Base Models

directors, producers, and artists themselves, while constantly fighting budget and time constraints, at least have complete freedom of visual choice. Natural forces such as water in The Perfect Storm and asteroids in Armageddon and Deep Impact unleashed hell on the screen. Dinosaurs with jiggly muscles and wrinkled, colorful skin have been brought to life on live-action background plates in a seamless integration, as in Jurassic Park and Disney's Dinosaurs. With realistic 3D human characters deformed in The Mask, violently crashing cars in Meet Joe Black, and acting in a fully 3D environment in Final Fantasy, the ultimate challenge has been met and defeated. Or has it? Of course not. Many brand-new challenges stemmed at one point or another from the brilliant minds of many individuals and teams involved in the industry, always trying to recreate again and again that sense of amazement from the early days of computer graphics in themselves and in the audience. In some cases, it's "just" a matter of new algorithms being discovered and implemented in the software: inverse kinematics, displacement, radiosity, and other new programs are thrown into the battlefield, allowing unprecedented feats in modeling detail, animation style, and rendering realism. In other cases, however, it's a matter of mass: the collective size and complexity of the sheer number of objects in a scene simply overtaxes computers.

Not Only Big Studios Be it jetfighters versus space fighters as in Independence Day or crawling masses as in AntZ, crowd scenes are now in the range of any production. Not only because the tools offered by currently available software and the relatively cheap hardware allow animators to deal with them, but especially because it doesn't take an army of thousands as in The Lord of the Rings. Consider a "simple" TV commercial production or a music video. The budget is small compared with any feature film such as those mentioned earlier. Nevertheless, the storyboard calls for a shot—maybe more than one, in the characteristic uncertainty of TV productions— with 20 or 30 characters doing something such as running on a street. At first glance, 20 or 30 characters may not seem that many. If they're characters in the most abstract sense, including inanimate items such as cars, it's reasonable to think that a modeler and an animator could handle the shot by simply keyframing each character. Of course, life is rarely so easy: our example shot is not about cars but about two-legged, twoarmed, (luckily) one-headed, colorful aliens running a marathon on a Golden Gate-like bridge. In this situation, it's still not easy to completely exclude a manual approach, in which modeler and animator painfully create and give life to all characters. Twenty or 30 characters is a threshold number, right on the fine line where more complex but more powerful and flexible procedural methods become time and cost effective. How, then, do you decide which method to use in each case? Well, something I learned relatively early in this business is that making a shot is not just a matter of doing it. It's a matter of doing it in a way that it can be changed easily. Directors and supervisors all have ideas about what they want to see from you. Some know exactly what they want—but unfortunately you didn't take Telepathy 101 in high school— while others don't have a precise idea of what they want and will need to see something from you to decide that it's not what they wanted after all. In both cases, a trial-and-error process has begun, and a tradeoff between setup time and the consequent increased flexibility needs to be found. Human resources and money are the biggest elements to consider when dealing with crowds of a few elements, but soon, when the number of characters or their complexity

Heroes

169

(or both) increase, the manual approach simply fades out of range, leaving a procedural approach as the only way to go. As Figure 6.1 shows, four levels can intuitively characterize the complexity scale. At Level I are characters with no moving parts, for example, asteroids or spaceships At Level II are characters that have few moving parts, for example, cars. At Level III are characters that have an articulated spine, such as fish. And at Level IV are fully articulated characters, that have an animated spine and appendages, such as humanlike figures. The good news, though, is that once you take the procedural path, and develop the solutions to a plethora of sub-problems or find the solutions in existing software, the number of characters you need to handle doesn't really matter anymore. Our hypothetical director might come up to you one Number of characters morning and say: "Wow, I saw your shot with the 30 running aliens. Really cool, Figure 6.1: The threshold defining when procedural methods should but... could you make... say... 100? You take over from manual methods is actually a fuzzy line that depends know, it would really help the story!" on the number of characters and their complexity. You notice the grin on his face, and it's clear he enjoys the moment: he's just waiting for you to collapse, your sunny morning ruined by the dark night he thinks you're going spend in the office. But then, with your most genuine and happy smile, you reply: "Sure, no problem. You'll see the new version tomorrow, during dailies." At this point, his jaw should drop somewhere on the carpet, and you can go back to your cappuccino and croissant breakfast.

Heroes A crowd is not just a group of characters. A crowd is a character in and of itself. A crowd acts by itself as a single entity, sometimes as the main character of the shot and sometimes as a background element. For example, let's consider a shot that portrays a stadium filled with people or furry pink elephants with bright yellow dots—never limit your creativity. Let's imagine that two characters are talking to each other in the foreground, well in the frame. Unless there are special needs, they will probably get all the attention, while the audience swiftly discards the crowd as a background element, even if animated. Then, let's imagine a second shot, with no elements other than a wide view of the crowd in the stadium. In this second case, the audience's attention is focused on the crowd as a whole. The process of directing the audience's attention doesn't just happen, though. You must carefully and intentionally mold the process for effective storytelling. Or at the very least, you must be aware of where the attention of the audience is and is not.

170

C H A P T E R 6 • Creating Crowd Scenes from a Small Number of Base Models

For this purpose, two dramatically important perception laws help us understand where our eyes—and minds—tend to go when we look at something: • In a still scene, the human eye focuses on something that moves. • In a moving scene, the human eye focuses on something that is still. These laws, evolutionarily hardwired in our brains (probably from ancient times, when something moving was either something edible or something that considered you edible) give a good indication of what our eye is going to do. For example, if a shot shows a group of running characters, and one of those characters stops, our attention is immediately drawn to that character. On the other hand, if a shot shows a close-up of 50 pink elephants in a football stadium, and one suddenly stands up, screams, and gestures to the referee, you can bet that our attention is immediately drawn to that particular pink elephant. Although these laws apply to the staging of any scene, including live-action films and theatrical presentations, they are effectively inversely important for a crowd: to focus audience attention on a single detail or individual is exactly what you don't want when animating and creating a group of characters. The focus is not supposed to be on a detail, on one individual doing something different from the others. If the story actually requires such a distinction, that character or those characters are not "technically" part of the crowd; instead, they are "heroes," and you must handle them separately, most likely manually, with the standard tools offered by the software. This does not mean, however, that a crowd doesn't need details. Au contraire! Modeling, animation, and rendering can and should add details to the characters in the crowd. Our pink elephants, for instance, could all wear the tiny bright yellow hat of the team they're supporting at the stadium. Or they could all flap their ears continuously, to overcome the intense heat of the hyper technological stadium unfortunately constructed in the middle of the jungle. But none of them should visually stand out, say, with a bright green hat or nonflapping ears, unless there's a reason for them to be the focus. You must visually balance details in an overall uniform fashion, characterizing the crowd, not the individuals that make it up.

Deploying Three Task Forces To deal with a crowd scene means to handle it and treat it on two levels: at the crowd level and at the individual level. Although the crowd is a single entity, it is made out of many characters that supposedly have a life on their own, and somehow you have to show this. For example, a flock of birds normally flies in one direction, but the similar and yet never identical movements of each bird differentiates it from the others, giving a nice, characteristically asynchronous look to the flock. This concept is not limited to animation, but is easily extended to modeling and rendering. For example, each bird in the flock is different in size and proportion, not to mention the color patterns of the feathers that differentiate males from females from juveniles. Therefore, at the crowd level, you must decide how the crowd moves in its entirety; at the individual level, you must decide how each individual looks and moves with the crowd. Although you can treat the crowd level primarily as a single task, being "just" about position and orientation of each individual frame by frame (with some exceptions), at the individual level, you deal with the appearance of individuals and how they propel themselves (legs, tentacles, turbines).

Deploying Three Task Forces

We can then broadly identify three tasks: 1. Creating a flexible crowd system to handle the crowd as a whole, generating position, orientation, and status tags for each frame for each individual 2. Creating and/or differentiating the characters as needed 3. Animating the characters procedurally in any of their properties according to the information provided by the crowd system Once a production group identifies these tasks, it can divide the crew into teams, each assigned to a single specific task. The first team has to think about a set of methods to animate the crowd as a single acting character (task 1). Although they definitely need to know what the crowd is composed of (a platoon of futuristic hovercraft tanks riding some desert sand dunes moves slightly differently from a school of tuna fish), they don't really need to worry about the appearance of each single character, other than maybe considering its volume to avoid unrealistic interpenetration. At this level of abstraction, they'll pre-visualize the shot with simple spheres or boxes of various sizes and proportions. The second team, in the meantime, can start working out the details of the source models—one or many—and their rendering properties (task 2). Once the original model is ready, this team must develop methods to duplicate and differentiate the models. In some cases, this step is simply a matter of minor color differences. In others, the geometry is affected, and major color differences are appropriate. The goal for these variations is to provide enough visual variety to the usually static property of the characters that they seem to be individuals, not duplicates. Team 3 is responsible for animating the individual characters in the crowd (task 3). Although not always necessary—for instance, if the crowd is actually a procedurally driven Formula One race—the animation team is a must if the characters are to have limbs or any other nontrivial moving part. The responsibility of team 3 is to move the body according to the information provided by the crowd system, most notably the speed and rate of turn, easily extrapolated by position and orientation values changing over time. Team 3 must also handle status tags, which I'll discuss later, because of their potential in changing the position of the characters' moving parts. How this is done depends on the typology of the crowd, ranging from a fully procedural to a semi-automatic approach, in which libraries of handanimated character motion are seamlessly blended by procedural means. I'll cover these topics later in this chapter. At this point, you may have noticed that something is missing. Who takes care of the skeletons, constraints, and expressions that compose each character setup? Although the best solution is for a fourth team to take care of that specific task, the schema outlined in this section is just an ideal path to diverge from as soon as the details of a production require it. The first team could handle this task, for instance, because of some strict connection between the crowd system and what each individual does, but most likely the choice will be between the animation team and the modeling team, with a preference for the former. The animation task force is likely to have more experience animating characters, and they're the folks that are supposed to use the character setup. Given this broad overview, it is important to realize that even if we can draw lines between these primary tasks, they are still intertwined. They require a good level of communication between the teams, a need that grows exponentially with the complexity of the individual character and the richness of the crowd behavior. Let's now proceed with the details of each team's to-do list and how to tackle them.

171

172

C H A P T E R 6 • Creating Crowd Scenes from a Small Number of Base Models

The Genesis Team The Genesis team (team 1) is responsible for the modeling, setup, and diversification of the characters. Modeling a character for a crowd is somewhat similar to modeling a character for a video game: the models must have a low polygon count, and the textures provide most of the details. Although in the movie industry, we have some advantages over our cousins in the video-game industry, who are forced to render a relatively high resolution frame in l/30th of a second, it is good practice to keep the overall complexity of a crowd character as low as possible. For the example in this chapter, I set myself a target mesh of about 2000 polygons, knowing that the overall number of individuals I wanted in the final scene is in the 100-200 range, for a worst-case scenario of about 400,000 polygons. These numbers aren't really something I found with a magic formula precisely stating how many characters and polygons my dual 800MHz workstation can handle. But anybody who has worked intensively enough in this business will know about how much can be asked of hardware and human patience. Human patience tends to be the most important issue when working with a crowd scene. During the production of Help! I'm a Fish, a Danish-German animated feature I had the pleasure to work on, some scenes had a loading time of 20 minutes, a change to the crowd—whose properties were mostly expression-based—took another 20 minutes, and saving the scene took an additional 20 minutes—on a then powerful 250Mhz SGI Indigo2, with 300-600 models with 200-400 polygons each. In an ideal 10-hour day (no lunch, no coffee, no nervous breakdown), that's a total of 10 changes, not really many if you're not at the final, polishing-touches stage and you know exactly where you want to get. The biggest problem facing an artist working on a crowd scene is not so much rendering time, which is becoming cheaper and cheaper every day with larger render farms, but the degree of interactivity with the 3D scene, a bottleneck created by the growing but far more limited power of graphic cards. Later in this chapter, I'll discuss modular strategies for overcoming these problems. For now, let's focus on the Zoid, the character we're going to use as the base model for our crowd and shown in Figure 6.2. (You can find the Maya file for this scene, Zoid_base.mb, on the CD-ROM.) The Zoid will be the protagonist of a shot, together with about 200 of his brothers, portraying a crowd sitting on a bleacher in a basketball court and making the wave. As you can see, in Figure 6.2, the polygonal mesh is simple: 2000 polygons, 4000 vertices, and 53 bones. As a rule, I tend to avoid NURBS or subdivision surfaces for crowds, to save the renderer from the tessellation step, given that most of the time polygons are enough for models of this type. A three-finger hand is in place for our Zoid, with bones for each finger, but I could have easily saved another eight bones using two fingers only, one for the thumb and one for the four others. Time is a tyrant, and any step that saves time is worth considering. Some expressions connect two extra attributes on the forearm (elbow joint) to the closure of the hand and thumb in a fist; their purpose is to help the animator pose the character for the animation library. Those expressions though, as any other static output expression, shouldn't end up in the final scene. Each expression is evaluated in every frame, no matter if the result will actually change or move anything. On a handful of characters, leaving expressions in the scene easily might be forgiven. In a crowd of 200 characters, in a 96-frame scene, 12 expressions in the original Zoid (one for each finger joint) means 200 x 96 x 12 = 230,400 evaluations, a rather large waste of processing power if it can be avoided with no loss in the visual output.

Deploying Three Task Forces

Figure 6.2: The skin, skeleton, and shader tree of a Zoid.

As you can see in this simple example, in the creation phase we must be really careful with the apparently small numbers of features of the base character. We must try to limit model and setup to only what's necessary and unavoidable, and we must flag some characteristics as removable by the people downstream in the production pipeline. Additional utilities for the animators are six IK handles—two in each ankle, two at the tip of each foot, and two more in the wrists. Two nulls, or locators (dark green), control the pole vector of each arm's two-bone chain.

1 73

174

C H A P T E R 6 • Creating Crowd Scenes from a Small Number of Base Models

Now, let's look at the shader tree. It too is simple: eight nodes in all. Starting from the top node, a Lambert node, the tree splits in surface colors and a fake rim light. The rim light is given by a Sampler Info node whose facing ratio output is piped in a black to red ramp. Although this might sound complicated, it is actually nothing more than a bare X-ray shader, the only difference being that its output is directed to the incandescent input of the Lambert node instead of to the transparency. In the ramp itself, moving the colorEntry[2] up and down changes the overall thickness of the red rim, faking a back light behind the character. The two surface colors—yellow and blue—are provided by two monochromatic ramps mixed together by a layered texture node. A third input to this node is a texture file, painted on the 3D model with Maya-integrated painting tools and then saved as a 1024 x 1024 . t g a picture ( b a s e _ h u m a n o i d S h a p e . t g a on the CD-ROM). The yellow color is placed on top of the blue background color using this file as a mask and generating the effect of a yellow pattern on the blue skin of the character. Figure 6.3 shows the three colors of a Zoid. The character is encoded as a Maya binary (*. m b ) file. I have a rule of thumb about this, not unusual in the 3D industry, and that's why I'm mentioning this apparently trivial topic. Maya binary files load faster than Maya ASCII files. The Z o i d _ b a s e . m b file loads two to three times faster than the same file saved as Z o i d _ b a s e . m a . Saving your finished model files in Maya binary is a good idea because these files usually contain thousands of coordinates for vertex positions and numbers for topology information. You can then switch to Maya ASCII when you put together your entire scene with all models, especially when the scenes become complex and have references in them. As you know, you can read and edit an ASCII file using a simple text editor. This can help in at least two situations. For example, a scene has 50 references to model files. If you have an ASCII file, you can switch from low-resolution to higher-resolution models without opening the scene. Simply use the Replace function available in any decent text editor, and you can start right away with the highresolution render. (See Figure 6.4.) Here's another example: Something goes horribly wrong, and your extremely precious scene is corrupted. You can open an ASCII file and debug it manually to find Figure 6.3: The three colors characterizing a Zoid and correct the line that generated

Deploying Three Task Forces

Figure 6.4: The first lines in a *. ma file include the path and filenames of the referenced models. Replacing them with the help of a text editor updates the scene without the need to open it in Maya, a time-consuming operation when the crowd of characters is in place. the loading error. In the worst case, you will lose only the corrupted lines instead of the last two hours of work. A Word about Architecture Before we look at the scripts in this chapter, I want to give you some details about their overall architecture and discuss the guidelines I follow when writing a script. First, I require that each script act either on a selected group of characters or, if nothing is selected, on all characters. Such flexibility is important. For example, the crowd is in place, but you don't like a few of the individuals. You can run the script more than once, and only the selected characters will be affected. Sometimes, instead, the overall effect is not right, and in those case you'll need to change everything in the scene by running the script on all the characters. Second, I must be able to run every script in a GUI mode and from the command line. In the Z o i d _ h u e V a r . m e l script, for instance, I can call the global procedure Z o i d _ h u e V a r G U I ( ) and access it through a button on one of the shelves. Clicking the button opens a simple promptDialogue window that displays a tiny prompt line with default reliable values and some hint of their meaning. The user can enter help instead of the values to get a more extensive description.

1 75

1 76

C H A P T E R 6 • Creating Crowd Scenes from a Small Number of Base Models

This script admittedly doesn't have a fantastic GUI. I prefer to keep interfaces as small as possible and focus on writing a robust core procedure, the one actually doing something to the scene, in this case Z o i c L h u e V a r ( ). Once the script is working correctly and is properly debugged, there is no harm going back to the GUI code and improving it or having a GUI programmer take care of it. The command line becomes important when things get slow. After the testing is done and all the useful input values and ranges are known, you can use the interactive GUI version of the script to modify the crowd and all the variations of its individuals. But this can take a while if, for example, you have 1000 Zoids in a scene. Even if the system can handle \ 000 Zoids, it would surely take its time doing so. Suppose that you calculate the runtime at about 6 hours and that it should finish about 2 A.M.. And you need to run another script after the first one, which will also take some time. You don't want to be there at 2 A.M. to run the second script, do you? If the scripts you write are GUI based only, you have no choice but to wait, miss your son's evening basketball game, go home about 3 A.M., and face a spouse who's not exactly happy. Solution: the script must always have a GUI-free "core" procedure, ready to run from the Maya command line, the Maya Script Editor, or from another script. With this method, you can stack two or more scripts to run one after the other, even more than once, without your assistance. The last issue I want to mention about the architecture of these scripts is an important argument regarding anything meant to run for a long time, a usual occurrence with crowds. At least in the interactive, GUI version, a script must generate goodly amount of runtime output (maybe with different "verbose" levels) and statistics about what it is doing and how fast it is doing it. With a crowd scene, a script can easily run for ten minutes, one hour, or all night. Therefore, I usually generate two types of output: • A line of text for each character processed • A report of the start and end times In the main loop of the script, I usually generate a line of text for each character processed, for example, "Processing Zoid27... done! - (27 of50)". The frequency of this output can range from less than a second to a few minutes. If the frequency at which a new line of output is printed to the screen is lower than this, generate additional lines in key points of the code, most notably after the instructions that require the longest time—for example, loading and unloading of big reference files. If the frequency is higher, and the output is literally racing down the screen, it's wise to generate output only every 10, 100, or 1000 loops or every 5, 10, or 25 percent of the total number of loops. Furthermore, at the beginning of the script, I usually set a variable with the start time. When the script finishes, the start time and the end time are reported together so that I can check when and for how long the script has run. Here's what can happen if you don't generate such output. You run the script overnight, and during dailies, the director or the supervisor asks you to make a change. "No problem," you reply, but when they ask how much time it will take and if the executive producer can see it before lunch, you have to answer evasively because the script that started at 8 P.M. could have finished at 9 p.m. or at 7 a.m. the next morning. Generating output prevents this situation. Listing 6.1 is an empty template, the basic framework on which I usually structure my scripts. Easily recognizable are the two main procedures, the user-input handling and the output-generating lines of code. / Listing 6.1: An Empty Template // t e m p l a t e S c r i p t . m e l - v l . 0 0 . 0 0 // by Manu3d - © 2002

Deploying Three Task Forces

global

proc int c o r e P r o c e d u r e ( f l o a t float float int

$arg1, $arg2, $argN, $verbose)

/ / h a n d l i n g the s e l e c t e d o b j e c t s string $obj; s t r i n g $ o b j L i s t [ ] = ' l s - s l -o - s n ' ; int $ o b j N b = ~ s i z e ( $ o b j L i s t ) ' ; string $time1; i f($verbose) {

p r i n t (" - - - \ n") print("Zoid_sizeVar.mel output starts here.\n") print(" - - - \ n") : $timel = "system("time /T")';

// c y c l i n g through the selected objects for($i=0;$i
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF