Use Pivot As Local Space

david | animation,mel script,tutorials | Friday, September 28th, 2007

Maya 2008 introduces some new camera attributes. Here is a snapshot of the "Movement Options" in the  camera attribute editor.

cameraMovementAttributes

What this means is that if you select "Use Pivot As Local Space" then the camera will pivot around the "Tumble Pivot" instead of the "Center Of Interest" when you are tumbling around in the viewport. The default "Tumble Pivot" of 0,0,0 means you are just rotating around the camera's own local pivot, and there will be no translation of the camera.

I think this is a very useful option for positioning cameras, but I dont like the idea of having to dig down into the attribute editor everytime I want to use it, so I wrote some mel script to make it easy to toggle the option on and off. Actually I wrote two scripts; one to be used as a marking menu toggle, the other to be integrated with Hamish McKenzies zooCam.mel script.

djToggleUsePivotAsLocalSpace.mel is for use in a marking menu. Just add the command "djToggleUsePivotAsLocalSpace" and give it a name like "ToggleUsePivotAsLocalSpace". You should get something that looks like this (the rest of you menu will be up to you of course).

toggleUsePivotAsLocalSpaceMenu

When you invoke this menu in a camera viewport the script will work out which camera it is and toggle the state of the "Use Pivot As Local Space" attribute.

Download here.

djToggleUsePivotAsLocalSpaceMenu.mel is an alternative script that was written to be integrated into the zooCam menu (which works in conjunction with the zooShots camera switching system - see http://www.macaronikazoo.com/ for more info). The integrated menu looks like this.

switchToCenterOfInterest

switchToLocal

If you want to use this style of menu you need to add a call to djToggleUsePivotAsLocalSpaceMenu and provide the camera name, which is very simple in zooCam.mel. If you download my script you also get a copy of zooCam.mel which I modified, but you will need to get the rest of the zoo tools if you want to use it.

Download here.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck