MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

parent GUI to Motionbuilder's window, pyQt

1 REPLY 1
Reply
Message 1 of 2
madcarrot2007
1284 Views, 1 Reply

parent GUI to Motionbuilder's window, pyQt

def getMainWindow():
    ptr = ????
    return sip.wrapinstance(long(ptr), QtCore.QObject)

class testGUI(base_class, form_class):
    def __init__(self, parent=getMainWindow() ): 
        super(base_class, self).__init__(parent)
        self.setupUi(self)

hi guys,

I have managed to create a GUI outside of Motionbuilder 2013x64, but now I am having trouble to parent the UI to the Motionbuilder's window. Does anyone know how to do that? 

Thanks!

1 REPLY 1
Message 2 of 2
AnthonyLeDu
in reply to: madcarrot2007

[Edit : Incomplete answer]

 

It seems to be :

parent = QtGui.QApplication.activeWindow()
while parent.parentWidget() != None:
    parent = parent.parentWidget()

 

 Source:

http://www.marcuskrautwurst.com/2013/09/building-motionbuilder-tools-using-qt.html

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report