PySide GUI For Pyblish


#1

Hello.
As we taked with @marcus, i like to start creating a great PySide GUI for Pyblish that works fine like qml GUI (maybe better) :slight_smile:

I will start from scratch and i will share my mock-ups first, i like we all contribute to sharing ideas to create a good GUI that be inside hosts.

Happy New Year!

Let’s Begin!


#2

Go go go!

And if I can make one suggestion, it would be to enable the GUI to be dockable (I know, I sound like a broken record by now!).


#3

Dockable is a good idea.
we will work on it
:wink:


#4

We should unify the style with QStyle style sheet. This way regardless the host app the PySide GUI will have similar looks and feel.

Would we want to build a UI abstraction framework on top of the GUI (similar to what Shotgun is doing with Engine) so the same GUI can be used on multiple app(Maya, Max, Nuke, etc.) or currently it will be app specific only?


#5

Sounds interesting! I’m not familiar with how this works in Shotgun, could you elaborate a bit on how that could work for us? I think @Mahmoodreza_Aarabi is aiming for the GUI to be usable across hosts with support for PySide.


#6

Here is the Shotgun Toolkit Platform API Reference:

If you look into the Application and Engine base class you will find that they provide an consistent API framework for creating Shotgun application that runs on multiple hosts (Maya, Max, etc.).

Engine base class is responsible for 1. Creating UI widget (usually menus but can be any widgets that host support) that can be used to launch the a Shotgun app. 2. Initialize any necessary boilerplate or scaffolding code for host app.

So host specific code should (ideally) run by Engine while Application should only consist application logic

In practice though many host specific code were also ran by the host specific hooks (another abstraction) that allow application writer to mostly write abstracted codes.


#7

@dshlai ATM, we focus on working of the GUI on Main Hosts (Maya, Nuke, Houdini (PySide Support), …) then we will work on look & feel of it.

please share your ideas.
thank you.


#8

###Progress [Working GUI on All Hosts Similarly]

Hey guys, i hope be all right.

In first days of creating the PySide GUI for Pyblish i focus on working GUI similarly on all hosts.
here there is some Gif images that will show them as a little program that will stay on top of Host.

We will continue on the project gradually.

Maya

Nuke

Houdini

I don’t have any other softwares to test, but if any host support PySide this GUI will appear on it.


#####Share your Ideas With Me!


#9

This should be top priority to minimize maintenance and to keep the look and functionality consistent.

@Mahmoodreza_Aarabi It would be nice to make this into a github repo soon, so we can follow and potentially help out. I’d for one, love to add to this, even though I’ve been a bit swamped in work for the past few months.


#10

The temporary repo for the GUI is Repo Until we add it to Main Pyblish repos

Any help will be appriciated.
Atm, i’m working on it seriously.


#11

Great work @Mahmoodreza_Aarabi, very clearly presented and great to see it working across apps! Perhaps tell us a bit about what your upcoming steps are?


#12

Sure @marcus

I’m glad you liked it.

We have a repo here pyblish-pyside

there is an app.py file that is very basic, actually i just work on how to show the window in host in this version. [initial Release]

code is this that i will explain it:

# [1.]
from PySide import QtGui

# [2.]
class PyblishGUI(QtGui.QDialog):

    """The main Window of Pyblish GUI [is not Singleton]"""

    def __init__(self, parent=None):
        super(PyblishGUI, self).__init__(parent)

        self.resize(400, 400)
        self.setWindowTitle("Pyblish")

# [3.]
def getMainWindow():
    mainWindow = QtGui.QApplication.activeWindow()
    while True:
        lastWin = mainWindow.parent()
        if lastWin:
            mainWindow = lastWin
        else:
            break
    return mainWindow

# [4.]
def show():
    win = PyblishGUI(parent=getMainWindow())
    win.show()

  1. importing QtGui from PySide
  2. A little QDialog as a class that we want to show it as Pyblish window
  3. This is main part that will get main window of host as parent of our Pyblish window:
    first it get the active window that when we run the app.show because we are in Script Editor, ctive window would be script editor, then in a loop it will reach to top parent of windows and lastly will return the main window
  4. in show() function we will create the Pyblish GUI window with setting main window of host as its paret, then show it.

There is some downside with this way, and it, this is that every time i call app.show() we have a new Pyblish window, i mean it is not Singleton window, i will work on it in next versions.

Gradually other disadvantages of this method will be appear that we will fix them.

If there is any question please ask, i will answer.


#13

One way of solving the “singleton” problem, is by storing a handle to the window in a variable somewhere and then checking for it when you show.

import pyblish_pyside

# Maintain reference to single window
pyblish_pyside.window = None

def show():
  if pyblish_pyside.window is not None:
    pyblish_pyside.window.show()
  else:
    # Create and show window,
    # then store it in pyblish_pyside.window

Now the window will only appear once. Take care to not destroy the window when closing it, but rather hide it instead. That way, you won’t have to recreate it, which can take some time. To avoid destroying it, you may have to override the closeEvent.


#14

Yes, i tried destory method, but i don’t use it, and because it is QDialog it automatically will hide
i will use closeEvent.

i’m working on it.


#15

I’m slightly confused as to why you are developing a GUI when there already is an existing one?

Don’t get me wrong, I’m all for the ease of use of PySide.


#17

Good question.

I made the suggestion to Mahmood to help develop a new GUI with tighter integration with a host; especially the docking part. I was looking for a minimalistic GUI to complement the more feature-rich QML equivalent, for times when you aren’t looking for flexibility or features, but rather quick results.

The GUI, at least to my mind, could be a mere progress bar to the side of a host, like Maya, where a user could publish or validate things quickly.

Secondary, it would also enable those who are looking for a more lightweight alternative to Pyblish than QML. I’ve had users come to me and say they simply don’t like QML or that they don’t like the fact that the GUI doesn’t stay on-top of their host. All reasonable concerns that a separate GUI could address.

And thirdly, I suppose, is to enable a separate flow of ideas that introduce a form of competition. Seeing this coming to fruition certainly pushes me to think of enhancements the QML GUI and it is relatively straightforward to implement the things from QML into PySide, and vice versa.

At the end of the day I would consider the QML interface to get a more feature rich, and eventually contain more than is required for everyday publishing tasks and better suited for in-depth control and customisability, whereas the PySide GUI could potentially take on introductory level and everyday publishing tasks.

Where this goes exactly I’ll leave to circumstance. Maybe it’ll replace QML. It certainly has greater potential for contribution as many of you already know PySide. On the other hand, by the looks of it, this year or the next will be the year of Qt 5 in which case QML might get easier to develop for and integrate with.

All in all, I’m in favour of alternatives and more minds at the table!


#18

For now Singleton feature works fine. i will work more on it in the future.


#19

Hello again
After a few days( more than a few days ) :slight_smile:
I start pyblish-pyside GUI today, and i hope it continue to reach to a good integrated GUI.
So for start i will create a GUI like the QML one. Then we will develop it based on new ideas.
Let’s Go.


#20

Hey men
Fortunately or Unfortunately i got a job in a studio and continuing on Pyblish-PySide is intrruppted for a period of time.
as we talked with @marcus we set a plan on 3 months for reaching to a good GUI with pyside, but i have to work now on pipeline of the studio and it takes all of my time. but when i set a good base for them i will back to creating the PySide GUI, because i love to develop it.

btw, i hope this comment reaches you well.
thanks


#21

No problem @Mahmoodreza_Aarabi, congratulations on your new job and the GUI will be here for you or future developers to pick back up when ready.