Jump to: Board index » General » Fusion

Fusion 8 - is PyQt5 GUI tools possible?

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Mike Aquino

  • Posts: 5
  • Joined: Thu Jun 23, 2016 2:19 pm

Fusion 8 - is PyQt5 GUI tools possible?

PostThu Jun 23, 2016 10:40 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:

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!
Offline

Mike Aquino

  • Posts: 5
  • Joined: Thu Jun 23, 2016 2:19 pm

Re: Fusion 8 - is PyQt5 GUI tools possible?

PostMon Jun 27, 2016 2:45 pm

I suspect that this isn't possible. I got used to being able to leverage already existing PySide or PyQt UI code in the pipeline for doing interactive tools within Maya. I was hoping that Fusion 8 would provide a similar ability.

I'm shelving the pursuit of this approach, and I've been diving into using the built-in "composition.AskUser(...)" functionality for user dialogs. It's not ideal solution (as it is very limiting in what you can do and present in UI dialogs), but I think it will be sufficient for getting in-Fusion pipeline tools started.
Offline
User avatar

michael vorberg

  • Posts: 943
  • Joined: Wed Nov 12, 2014 8:47 pm
  • Location: stuttgart, germany

Re: Fusion 8 - is PyQt5 GUI tools possible?

PostMon Jun 27, 2016 9:25 pm

i have a PyQt4 script and i'm able to run it once, the second time i start i fusion8 crashes to desktop without any error message. in fusion 7.7 there is no problem
Offline

Chris Wells

  • Posts: 59
  • Joined: Mon Nov 10, 2014 11:25 pm

Re: Fusion 8 - is PyQt5 GUI tools possible?

PostMon Jun 27, 2016 11:01 pm

It's cheap but most times I have two scripts. the one inside fusion launches another script that then runs outside of fusion and talks to fusion from outside. letting it use whatever gui I want.

haven't tried it in 8 but it should still work
Offline
User avatar

michael vorberg

  • Posts: 943
  • Joined: Wed Nov 12, 2014 8:47 pm
  • Location: stuttgart, germany

Re: Fusion 8 - is PyQt5 GUI tools possible?

PostTue Jun 28, 2016 5:24 pm

You need fusion studio for external scripting
Offline

Mike Aquino

  • Posts: 5
  • Joined: Thu Jun 23, 2016 2:19 pm

Re: Fusion 8 - is PyQt5 GUI tools possible?

PostMon Jul 04, 2016 10:12 pm

Many thanks for the feedback and insight!

My client has obtained Fusion Studio licenses and I'm now able to communicate with a Fusion instance using external scripting.

So, I'm now taking the approach of doing my own external PyQt GUI and then using the "BlackmagicFusion" module to execute actions in the interactive Fusion instance that is running.

Not as ideal as adding custom PyQt GUI directly in Fusion 8, but it's very workable.
Offline

Carlos Anguiano

  • Posts: 8
  • Joined: Sun Dec 14, 2014 12:22 am

Re: Fusion 8 - is PyQt5 GUI tools possible?

PostSat Dec 10, 2016 1:19 am

We should request to black magic that provide a working PySide, PySide2 lib...
this wold allow us, read our selfs of Nuke and the cost associated with.

Is BMD receptive to user request? seems this is a pretty basic request that makes a big difference for pipeline integration as far as universal asset management tools :)

Return to Fusion

Who is online

Users browsing this forum: No registered users and 15 guests