Hello, I’m trying to display a window at the start of motion builder with Python. Thanks to this autodesk’ site : http://docs.autodesk.com/MOBPRO/2016/ENU/MotionBuilder-Developer-Help/files/GUID-391A97C9-35B9-4C98-A8CE-5CD718A7D70A.htm
I managed to launch my script before the app was even ready. My window is perfectly displaying but this blocks motion builder from opening until I closed my generated window.
So I tried to look for events that I could use to execute my script and failed.
The event that I tried to use is FBApplication.OnFileOpenCompleted. I put my script into a def and run with the event, and now my def is not calling at all.
Here is the script.
from PySide2 import QtCore, QtGui, QtWidgets import sys sys.path.append('D:/Python/MOBU/fodderTest') import interface.testInterface as uiInterfaceTest from pyfbsdk import * class MainWindow(QtWidgets.QWidget, uiInterfaceTest.Ui_Dialog): def __init__(self): super(MainWindow, self).__init__() self.setupUi(self) self.show() def launchApp(pCaller, pEvent): print "launchApp enter" myApp = QtWidgets.QApplication.instance() window = MainWindow() myApp.exec_() mobuApp = FBApplication() mobuApp.OnFileOpenCompleted.Add(launchApp)
If you have any ideas of “how to run a script that opens a window proprely at the start of MB” that would be appreciate! Thank you for your time.