I have this problem, in which I am trying to check if this particular
exists, it will delete the current ui and re-generates a new ui of the same
application.
So basically what happens here is that when user imports in a particular
format, this ui will then pops up.
So supposedly if the user import in again while the ui is still opened, it
will simply kills off the former window and 'reboot' it again.
Thus it keeps printing out "no existence window"
However, as I tried to execute it, it seems to be unable to read the
existence of the window, and as a result I have 2 windows instead.
Adding on, this script is part of a plugin execution but I do not think so
it affects the window naming, i guess.
Any ideas?
win_name = "Import chan"
...
...
class CustomNodeTranslator(OpenMayaMPx.MPxFileTranslator):
def reader(self, fileObject, optionString, accessMode):
if cmds.window(win_name, exists = True):
cmds.deleteUI(win_name)
print "The application is already opened!"
else:
print "no existence window"
self.initialWindow()
...
...
def initialWindow(self, *args):
self.window = cmds.window(title="Import chan", menuBar=True,
iconName='.chanFileImport', widthHeight=(335, 221), sizeable=False)
...
...
--
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/8274b1fe-3962-496e-ad9f-33548d835861%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.