Message 1 of 3
Trouble with changing front & rear view port via script

Not applicable
09-08-2010
07:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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 //
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 //