help neeeded with script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2007   #1
help neeeded with script

im trying to write a script to toggel the orthagraphic attribute on and off on the defalt perspective cam shape node

i am totaly clueless about mel i assume it would be an if else code but i am having a lot of trouble trying to write it,

these are the atribute values i want to toggel between,

setAttr "perspShape.orthographic" 1;
setAttr "perspShape.orthographic" 0;

if anyone can point me in the right direction i would greatly apprecate it
 
Old 12 December 2007   #2

global proc toggleOrtho()
	{
	//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")`);
	}
 
Old 12 December 2007   #3
thank so much for that, i just upgraded to 2008 and the view cube is just not the same as the compass that ive come to use so much, i dont know why they got rid of it, but this should help my work flow thank you.
 
Old 12 December 2007   #4
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:22 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.