
- Posts: 5
- Joined: Thu Jun 23, 2016 2:19 pm
Hi all,
In some of my R&D for integrating Fusion 8 into a production pipeline and providing custom tools for comp artist workflow, I have looked into building PyQt GUI dialogs that open from python scripts run from the Fusion 8 "Script" menu.
Is this possible? I looks like Fusion is based on Qt5, so I installed PyQt5 for my Python 2.7 install, and then created this python script to run from the Fusion 8 "Script" menu:
... this script runs once with no errors ... but nothing shows up. If you attempt to run it again, Fusion 8 will hang.
Any assistance or insight on this would be really very appreciated ... many thanks!
In some of my R&D for integrating Fusion 8 into a production pipeline and providing custom tools for comp artist workflow, I have looked into building PyQt GUI dialogs that open from python scripts run from the Fusion 8 "Script" menu.
Is this possible? I looks like Fusion is based on Qt5, so I installed PyQt5 for my Python 2.7 install, and then created this python script to run from the Fusion 8 "Script" menu:
- Code: Select all
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class MyDialog(QDialog):
def __init__(self, parent=None):
super(MyDialog, self).__init__( parent )
self.initUI()
def initUI(self):
self.setFixedSize(200, 100)
self.setWindowTitle('My Dialog')
label = QLabel('Hello')
layout = QVBoxLayout()
layout.addWidget(label)
layout.setAlignment(Qt.AlignCenter)
self.setLayout(layout)
f8_qapp = QApplication.instance()
f8_wdg_list = f8_qapp.allWidgets()
f8_main_window = None
for f8_wdg in f8_wdg_list:
if f8_wdg.windowTitle() == "Preferences":
f8_main_window = f8_wdg.parent() # "Preferences" widget has a QMainWindow parent
f8_my_dialog = MyDialog( f8_main_window )
f8_my_dialog.show()
... this script runs once with no errors ... but nothing shows up. If you attempt to run it again, Fusion 8 will hang.
Any assistance or insight on this would be really very appreciated ... many thanks!