PDA

View Full Version : help with script


jaydru
01-05-2008, 03: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

Chadrik
01-05-2008, 05:42 PM
cone;
undoInfo -stateWithoutFlush 0;
sphere;
undoInfo -stateWithoutFlush 1;
undo;


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.

jaydru
01-05-2008, 07:00 PM
thanks alot that was just what i needed

cpan
01-06-2008, 07:57 AM
http://www.highend3d.com/maya/downloads/mel_scripts/modeling/misc/4254.html
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

jaydru
01-06-2008, 04:54 PM
wow that script is the greatist, thanks alot for pointing that out to me

jaydru
01-06-2008, 05: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-06-2008, 05: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.