I am trying to use an if command but Maya will keep telling me there is a syntax error. I think I use the wrong symbols around the condition of the if command, but i can't figure out whats the correct one.
The script is supposed to check if the Window "rigWindow" exists, and if the answer is yes i want to close it.
The script that does not work:
if ('window -exists rigWindow')
(
deleteUI rigWindow;
)
I tried multiple different things but its frustrating as this seems like a minor mistake. Can someone tell me what the correct syntax for this command would be? Greatly appreciating any help.
Solved! Go to Solution.
I am trying to use an if command but Maya will keep telling me there is a syntax error. I think I use the wrong symbols around the condition of the if command, but i can't figure out whats the correct one.
The script is supposed to check if the Window "rigWindow" exists, and if the answer is yes i want to close it.
The script that does not work:
if ('window -exists rigWindow')
(
deleteUI rigWindow;
)
I tried multiple different things but its frustrating as this seems like a minor mistake. Can someone tell me what the correct syntax for this command would be? Greatly appreciating any help.
Solved! Go to Solution.
Solved by brentmc. Go to Solution.
Hi,
You need to enclose the window command in backticks (`) not single quotes. (')
Hi,
You need to enclose the window command in backticks (`) not single quotes. (')
Thanks for the Reply! Its working now. I also exchanged the normal brackets with {}.
For anyone who has the same problem this is what the correctly working script looks like:
if ( `window -exists rigWindow` )
{
deleteUI rigWindow;
}
Thanks for the Reply! Its working now. I also exchanged the normal brackets with {}.
For anyone who has the same problem this is what the correctly working script looks like:
if ( `window -exists rigWindow` )
{
deleteUI rigWindow;
}
Can't find what you're looking for? Ask the community or share your knowledge.