eunice...@gmail.com
unread,Jun 30, 2017, 5:42:01 AM6/30/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Programming for Autodesk Maya
Hi
I am having some problems here. I made a Maya UI window with QtDesigner and I'm trying to get it to dock at the side. Everytime I run the script, it will appear. However, once I close the UI window and rerun the script, the window will not appear again. I am thinking maybe I need to reinitialise the script but I'm not sure about that. Any advice on how to fix this? Here is my code.
def getMayaWindow():
ptr = apiUI.MQtUtil.mainWindow()
if ptr is not None:
return shiboken.wrapInstance(long(ptr), QtGui.QMainWindow)
class pipeWindow(formClass,baseClass):
def __init__(self, parent=getMayaWindow()):
super(pipeWindow,self).__init__(parent)
self.setupUi(self)
self.setObjectName('pipe_window')
self.project = ""
try:
cmds.deleteUI('dockPane')
except:
pass
self.pane = cmds.paneLayout('dockPane', cn='single')
if 'pipeDock' not in cmds.lsUI(ctl=1) :
cmds.dockControl('pipeDock', con=self.pane, area='right', allowedArea = ['right','left'], label = "ANMD_Pipeline", w=365)
else:
pass
cmds.control( 'pipe_window', e=True, p=self.pane)
Eunice