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

Creating cameras from code


In this example, we'll be looking at how to use code to create cameras. We'll create a collection of four orthographic cameras, suitable for use in rendering out multiple views of an object for use as assets for an isometric game.

Note

Isometric games have a long history and are characterized by using 2D assets to create a three-quarters overhead view of a game environment. This approach was very common before full 3D games became the norm, and it still shows up often in web and mobile games. Creating assets for isometric games often means rendering out a view for each side of an object and making sure that there is no perspective distortion in the rendering, which is exactly what we'll be doing in this example.

The result of the script-four orthographic cameras, all pointed at the origin

Getting ready

For best results, make sure that you have some geometry in your scene, placed at the origin.

How to do it...

Create a new file and add the following code:

import maya.cmds...