Isometric Camera Script for Maya

Isometric Camera Script for Maya

UPDATED: New script, see below.

Sometimes it’s useful to render 3-D objects in ways that will tile very well in 2-D.  Some uses for this are when making web site backgrounds or in making 2.5-D artwork for games.

The easiest way to do this is Isometric Projection — which results in all parallel lines in the scene being parallel in the image.  This is different from a Perspective Projection, which results in vanishing points, and generally looks more like how your eyeballs see the regular world.

Perpsective Projection of an object

Isometric Projection of an object

 

 

 

 

 

 

 

 

 

 

 

Isometric graphics are used common in games like Diablo, Civilization, and SimCity.

Setting up a camera to render isometric images in Maya requires a standard orthographic camera and some understanding of how its settings relate to the scene space.

For now, you can just use this Isometric Camera Maya python script.

 

This python module is dead simple to use.  Unzip it and drop it into your maya scripts folder.

1) Select an object (Or group a bunch of objects)

2) run:

import isometricCamera
isometricCamera.fitIsometricCamera(setRenderHeight=1)

3) (updated) The script will create an orthographic camera that will frame the selection.  (Usually these cameras are named “camera1”).  You can switch your viewport to these cameras under the Panels->Orthographic-> menu.  Rendering through this camera will create a tileable image of your selection.

 

NOTE:  In order to make the render resolution exactly fit your object for tiling, the render aspect ratio may need to change.  Setting setRenderHeight to True (or 1) will change your global render resolution.  The script will always print out the suggested render height to match your current render width, as well as the suggested render aspect ratio necessary to fit your object.

Good luck, and happy isometric tiling!

UPDATED: At a reader’s request, I’ve updated the isometric camera script to accept any passed-in angle.  My default is 30 degrees, but not everyone wants that.  This way you can pass in any angle you want.  Also, if you pass in an angle less than zero, the angle will be set to 35.264389682754654, which will set the camera so that it looks perfectly through both corners of a cube-shaped object.  But because that number is a pain to remember, just set the angle to be -1, and the script will know what you mean.

 

2 Responses to Isometric Camera Script for Maya

  1. Chris says:

    Thank you for this script,I’m trying to set up some isometric grid for some time.

    I downloaded the script but don’t know how to use it in Maya.
    Unfortunately it’s not so simple at all.

    The file is unpacked in scripts directory and executed through python editor in Maya 2015 but nothing happens.
    If you please help me.
    What do I need to do next ?

    THX Chris

    • Tony says:

      Chris,

      This script works best when you’ve selected some objects to fit the camera to. This creates an ortho camera that you can switch your viewport to, and/or render through. The output in the Script Editor also helps you choose a good render resolution height and width to use the output for tiled image.

      Sorry for the slow reply.

      -T

Leave a Reply to Chris Cancel reply