Rigging for Games Rigging for Games: A Primer for Technical Artists Using Maya and Python is not just another step- by-step manual of loosely related tutorials. Using characters from the video game Tin, it takes you through the real-world creative and technical process of rigging characters for video games and cinematics, allowing readers a complete inside look at a single project. You’ll explore new ways to write scripts and create modular rigs using Maya and Python and automate and speed up the rigging process in your creative pipeline. Finally, you’ll learn the most efficient ways of exporting your rigs into the popular game engine Unity. This is the practical, start- to-finish rigging primer you’ve been waiting for! Enhance your skill set by learning how to efficiently rig characters using techniques applicable to both games and cinematics Keep up with all the action with behind-the-scenes images and code scripts Refine your rigging skills with tutorials and project files available on the companion website Eyal Assaf is a Technical Artist currently living and working in Toronto, Canada. A graduate from the Ontario College of Art and Design, Eyal has been involved in the animation, gaming and broadcast industries since the mid-90s when digital dinosaurs began to roam the big screens. His wide range of experience led him to positions such as Visual Effects Supervisor on an award-winning animated 3D television show as well as other lead positions in a variety of commercials, broadcast, film, and game projects. He is also an internationally published illustrator in various trade publications and teaches 3D and Design at college level. Rigging for Games A Primer for Technical Artists Using Maya and Python Eyal Assaf CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487–2742 © 2016 Taylor & Francis CRC Press is an imprint of the Taylor & Francis Group, an informa business This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging-in-Publication Data Assaf, Eyal. Rigging for games : a primer for technical artists using Maya and Python / Eyal Assaf. pages cm Includes bibliographical references and index. 1. Rigging (Computer animation) 2. Video games—Design. 3. Computer games—Design. 4. Python (Computer program language) 5. Maya (Computer file) I. Title. TR897.77.A87 2016 006.6'96—dc23 2015015031 ISBN: 978-0-415-74304-4 (hbk) ISBN: 978-0-415-74305-1 (pbk) ISBN: 978-1-315-81391-2 (ebk) Typeset in Myriad Pro by Apex CoVantage, LLC Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Contents Acknowledgments Introduction Chapter 1: The Creative Cycle From Page to Screen Where Do Ideas Come From? The Production Cycle Pre-Production Step 1: Planning the Story / Game Outline Step 2: The Script / Game Design Document Step 3: Concept Art Step 4: Storyboards Planning the Storyboard Scenes Color Scripts Step 5: Asset Lists Step 6: Asset Management and Organization Step 7: Animatic / First Playable Prototype Production Modeling Surfacing Rigging Animation Post-Production Chapter 2: Concept Art and Modeling Concept Art References Character Sheets 3D Modeling Output Medium Level of Detail and Topology Square Is Good—Polygon Types to Use and Avoid Alternatives to Mesh Density Sculpting Pitfalls UV Maps File Referencing Chapter 3: Rigging Concepts An Overview of Rigging The Basics Nodes and Connections Parenting Constraints Direct Connections Deformers Joints Joint Orientation Kinematics Attaching Meshes to Joints Smooth Binding Rigid Binding Introduction to Scripting Scripting in Maya MEL The Script Editor MEL 101 Anatomy of a Script Saving the Script Python Our First Python Script—tgpGears Creating the GUI Querying the GUI Values Creating the Gears String Formatting in Python Chapter 4: Scripting Mechanics Engineering the Fantastic Python’s Object-Oriented Programming Classes in Python Building a GUI Framework Defining the UI Class Adding Button Functionality Creating tgpMechanix Referencing the UI Class Error Checks Creating a Utility Section The Connectors Making the Spring Assign Functionality to the Buttons Making the Piston And Now for a Lite Version of the GUI Framework … Chapter 5: Rigging Mechanoids Rigging Meep Rigging Pre-Flight Sketching Out the Rig Which Rig? Bind vs. Control Analyzing the Rig Behavior Rigging the Legs Placing the Leg Joints IK/FK Leg Setup Setting Up the Switch Creating FK Leg Controls Scripting tgpControlOrient Stretchy FK Joints Creating IK Leg Controls Knee Controls Stretchy IK Joints The Condition Node Going the Distance Setting Up the Wings Neck Building the Head Putting Together the Body Finishing Touches Global Scale Chapter 6: Rigging Humanoids Rigging Leaf Analyzing the Bind Skeleton To T-Pose or not to T-Pose? Human IK Overview Creating the Bind Skeleton Rotate Order Scripting tgpRotateOrder Binding Leaf’s Mesh to the Skeleton Smooth Bind Overview Weight Assignment and Painting Chapter 7: The Control Rig The Control Rig snapAB Script Building the IK Leg Automating the Limb Creation—the Limb Class Using a Dictionary Coding tgpLimb Building the Spine Hips, Shoulders … Stretching the Spine The Neck and Head Building the Arms Setting Up the Clavicles Driven Keys After You! No, After You—Polite Space Switching Space Switching Using Parent Constraints IK/FK Redux Snappy Logic Part 1—FK to IK Snappy Logic Part 2—IK to FK (with a dash of pole vector magic) Finalizing the Rig Adding Global Scale to the Rig Cleaning Up the Channels And …? Chapter 8: Game On! Exporting to Unity Animating for Games Prepping the Rig in Maya Methods of Exporting Animation from Maya to Unity Baking the Animation Keys Exporting to the FBX Format Importing Animation Files in Unity Blending the Animation Cycles Epilogue Appendix Index
Description: