Hi,

What it looks like is that you are doing this check:

    if 'pipeDock' not in cmds.lsUI(ctl=1) :

​

And you only create the dock if it doesn't exist. But, closing it doesn't
necessary mean it is deleted. So you have a hidden dock still in Maya. Now
you end up just creating more widgets with no dock that aren't shown. Try
adding something like this:

...
        # I needed to add this for subsequent launches to make sure
        # the initial parent is set
        cmds.setParent(self.parentWidget().objectName())

        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)

        # No matter what, make sure we make the dock visible
        cmds.dockControl('pipeDock', e=True, vis=True)

...

​

Does that help?

On Fri, Jun 30, 2017 at 9:41 PM <[email protected]> wrote:

> 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
>
> --
> 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/45b5e20e-27c5-412d-9805-d9da488df7ad%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA3C_PG1wpAx9%2BymiMYxG3tQP_i0Q%3DkKgR2K12TtUSbo6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to