Unable to click Maya while my UI is open

24 views
Skip to first unread message

Daniel Sidi

unread,
Aug 18, 2020, 8:02:48 AM8/18/20
to Python Programming for Autodesk Maya

Hi all,

I'm new to this group and I can see there is a lot of knowledge here.

I have a UI which is using PySide2
The UI is loaded like this:

import sys
sys.path.append("V:/projects/coding/teamShirts")

from maya import OpenMayaUI as omui
from shiboken2 import wrapInstance
import teamSelector_main
from PySide2 import QtWidgets

reload(teamSelector_main)

ptr = omui.MQtUtil.mainWindow()
widget = wrapInstance(long(ptr), QtWidgets.QWidget)

d = teamSelector_main.TeamSelectorDialog(widget)
d.exec_()

The UI runs fine and does what I need, but it takes complete control of Maya. I cannot click anything in Maya until I have closed my UI.

My question is: How can I have my UI open and still be able to tumble in the viewport, select objects, etc.

I guess it's something to do with the 'parent' window, but I don't know.

Maya 2018

Many thanks!

Dan

vince touache

unread,
Aug 18, 2020, 8:11:44 AM8/18/20
to Python Programming for Autodesk Maya
hello, 

try to use d.show() instead of d.exec_()
Furthermore, make sure you don't have a self.setModal(True) in your UI, or you don't use a widget that is modal by default.

Daniel Sidi

unread,
Aug 18, 2020, 8:20:57 AM8/18/20
to Python Programming for Autodesk Maya
Thanks Vince,

Works perfectly!
Reply all
Reply to author
Forward
0 new messages