View Full Version : help with script

01 January 2008, 04:53 PM
the removal of the compass in maya 2008 has realy messed up my work flow but i got this script to toggel the cam in to orthagraphic mode, only problem is when i execute the comand it becomes one of my undo's, does anyone know how to make this script non-undoable,

//this gets the current viewport
string $currentPanel = `getPanel -withFocus`;

//this gets the camera associated with the panel
string $currentCam = `modelPanel -query -cam $currentPanel`;

//this sets the value to be the opposite of whatever it is currently (that's what the '!' is for
setAttr ($currentCam+".orthographic") (!`getAttr ($currentCam+".orthographic")`);

thanks for your help

01 January 2008, 06:42 PM
undoInfo -stateWithoutFlush 0;
undoInfo -stateWithoutFlush 1;

the flag stateWithoutFlush turns undo on and off while preserving the queue. in this example, when undo is called at the very end, the cone command will be undone and the sphere will persist.

01 January 2008, 08:00 PM
thanks alot that was just what i needed

01 January 2008, 08:57 AM
being in the same boat as you, here's a little genious script you may want to try:)
it toggles between persp and ortho but in an inteligent way.. the ortho is chosen
based on the persp camera orientation. much better than both the compass and
this hideous cube.. one little shortcut to rule them all:D

01 January 2008, 05:54 PM
wow that script is the greatist, thanks alot for pointing that out to me

01 January 2008, 06:11 PM
actualy after playing with it a little bit ive noiticed that that script is messing with my image plains i think it would be better if the cam stayed as persp instead of switching to top, side, ect.. thanks anyway though

CGTalk Moderation
01 January 2008, 06:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.