Book Image

Maya Programming with Python Cookbook

By : Adrian Herbez
Book Image

Maya Programming with Python Cookbook

By: Adrian Herbez

Overview of this book

Maya is a 3D graphics and animation software, used to develop interactive 3D applications and games with stupendous visual effects. The Maya Programming with Python Cookbook is all about creating fast, powerful automation systems with minimum coding using Maya Python. With the help of insightful and essential recipes, this book will help you improve your modelling skills. Expand your development options and overcome scripting problems encountered whilst developing code in Maya. Right from the beginning, get solutions to complex development concerns faced when implementing as parts of build.
Table of Contents (17 chapters)
Maya Programming with Python Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Setting up set-driven key relationships with script


A great deal of rigging is nothing more than setting up connections between attributes. Sometimes, those connections can be very direct, such as making sure that two joints are always in exactly the same position in world space, but in other times, something other than a direct one-to-one mapping is called for.

There are a few different ways to connect attributes in non-linear ways, including using Maya's set-driven key capability to map one arbitrary range of an attribute onto a different arbitrary range of another. In this example, we'll be looking at how to set that up with scripting.

Our example will set up the "Hello World" equivalent for using a set-driven key, a finger that curls all of its joints smoothly at the same time, allowing the animator to keyframe a single attribute per finger instead of three (or possibly even more).

Getting ready

For this example, you'll want to have a simple chain of at least three bones. The output of the...