Dale Gomez
posted this on February 15, 2010 16:23
The problem is that Maya is trying to create a window that already exists. Even though the ‘myWindow’ window may be closed or not visible, it still exists as an entity. So when you run the script to create it, you get the error. Two ways to get around this are:
1. To check if the window exists and delete it. Then proceed to create it; OR
2. To check if the window exists and try and reuse it.
I recommend deleting because it purges the window and its contents. This mostly helps make your code short because you don’t need to take into account any changes that may have happened to the window itself. In other words, the delete step is a good clean reset. The code to do so is as follows:
if (`window -exists myWindow`) {
deleteUI -window myWindow;}
window -rtf true -title “My Window Title” myWindow;