Hello all,

Last week I finally figured out how to successfully stop multiple Qt window 
classed from being open inside Maya.

I checked the window existed and if it did I ignore and pass on the 
condition.

I overrode the close event for my class and when the window was closed the 
class was deleted. This allowed the window to be re-opened which was 
exactly what I was after...however.

When an error occurs in the script and I close the window to re-boot it, 
regardless of the close event override the script says the window still 
exists.

Is this the window being stuck in memory because of the error in the script?

The below code seems to work brilliantly except for when an error occurs. 
When this happens I close the window and try to re-open it but the "already 
exists" condition pops up and I have to re-start Maya

Code is below:

def main():
        winName = 'EXPORTER'
        if pm.windows.window(winName, exists=True):
                print 'Already exists, passing'
                pass
        else:
                window = ColladaExporterUI()
                window.setObjectName(winName)
                window.show()


def closeEvent(self, event):
        print 'CLOSED'
        del self.mainDialog
        del self
        event.accept()

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/dcd4ecdf-ac70-411c-8ef9-d32337b96e89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to