[Maya-Python] Closing PySide windows in Maya

2013-07-10 Thread Mike Malinowski (LIONHEAD)
Hey All, I'm getting an issue whereby my PySide windows are not being properly destroyed when they're closed. code import pymel.core as pm from PySide.QtCore import * from PySide.QtGui import * import shiboken import maya.OpenMayaUI as mui def getMayaWindow(): ptr =

Re: [Maya-Python] Closing PySide windows in Maya

2013-07-10 Thread Jan:
Hi Mike, I ran into the same problem and the easiest way I came up with was just by forcing the window to be destroyed every time the script ran. Just like you would do in the old days with mel :) if pm.window( 'testWindow', query = True, exists = True ) : pm.deleteUI( 'testWindow' ) So

Re: [Maya-Python] Closing PySide windows in Maya

2013-07-10 Thread Jan:
Oh you can also add a check for visibility so it doesn't destroy any windows that are still in the users view. i.e. if pm.window( 'testWindow', query = True, exists = True ) : print 'exists' if not pm.window( 'testWindow', query = True, visible = True ) :