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 Tools Display Modes
  12 December 2007
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
  12 December 2007

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")`);
  12 December 2007
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.
  12 December 2007
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
Society of Digital Artists

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

All times are GMT. The time now is 02:44 PM.

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