Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Trouble with changing front & rear view port via script

Trouble with changing front & rear view port via script

Anonymous
Not applicable
273 Views
2 Replies
Message 1 of 3

Trouble with changing front & rear view port via script

Anonymous
Not applicable
Hey i don't know if a similar post like this is already up but i nee to figure out why this script isn't working out. I tried using a script to change the view ports when i select either the front or the rear to the opposite but when ever i run the script in the editor i keep getting this error message. Can anyone tell me what i am doing wrong ?



if(('modelPanel -q -cam modelPanel13')=="rear")
{
modelPanel -e -cam front modelPanel13;
setAttr front.visibility 1;
setAttr rear.visibility 0;
}
else
{
modelPanel -e -cam rear modelPanel13;
setAttr front.visibility 0;
setAttr rear.visibility 1;
}

Here is the error message i receive.


editMenuUpdate MayaWindow|mainEditMenu;
if(('modelPanel -q -cam modelPanel13')=="rear")
{
modelPanel -e -cam front modelPanel13;
setAttr front.visibility 1;
setAttr rear.visibility 0;
}
else
{
modelPanel -e -cam rear modelPanel13;
setAttr front.visibility 0;
setAttr rear.visibility 1;
};
// Error: if(('modelPanel -q -cam modelPanel13')=="rear")
//
// Error: Syntax error //
// Error: }
//
// Error: Syntax error //
// Error: }; //
// Error: Syntax error //
0 Likes
274 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
You're using single quotes ' in stead of backquotes `

if((`modelPanel -q -cam modelPanel4`)=="rear")
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you
0 Likes