Developer Guide


#1

Hi all,

I’ve been working this past week on a developer guide for you to learn more about how you can improve and extend upon Pyblish on your own.

The goal of this guide is to bring someone completely unfamiliar with Pyblish up to speed in implementing issues and features. It’s a bit rough around the edges still and some information is missing, but it should hopefully be enough get you started.

Share what you feel is wrong, lacking, missing or too verbose here or make an issue for it in the book’s repository.


Table of contents


Next steps

Now either get creative and invent something smart or get smart and head over to the issues to implement something creative!


Found something wrong in the guide?

Got a spelling error or missing information? Let me know here, or fork it and submit a pull-request on GitHub!


#2

#3

Wanted to look at some GUI development, and got into trouble:s

Have all the repos setup, and I launched Atom with this;

set PYTHONPATH=%CD%\python-qt5;%CD%\pyblish;%CD%\pyblish-modo;%CD%\pyblish-hiero;%CD%\pyblish-houdini;%CD%\pyblish-nuke;%CD%\pyblish-maya;%CD%\pyblish-integration;%CD%\pyblish-rpc;%CD%\pyblish-qml;%CD%\pyblish-standalone;%PYTHONPATH%
atom %CD%

I then proceeded to try and launch pyblish-standalone;

import subprocess

subprocess.Popen(['python', '-m', 'pyblish_standalone'])

This resulted in a continuous opening and closing of the Pyblish GUI, ending with having to restart the machine.

  • Why would this happen?
  • Should I be using pyblish-standalone for GUI development?

#4

Hey Toke,

The path looks good, and running Atom like that is fine. However you should not be running pyblish-standalone, but instead you should be running pyblish-qml/app.py directly.

cd pyblish-qml/pyblish_qml
python app.py

That will launch a debug-session of Pyblish QML where you will have a bunch of plug-ins to play around with. You can also run it directly from Atom, one you have your path set-up the way you have.

Thanks for pointing this out, it really should have been in the guide, so I added a chapter about it.

Have a look there for more thorough information.

Edit: Oh, and about the recursion you experienced, that sounds like an unrelated (and dangerous) bug. Is standalone working elsewhere, such as in your Ftrack scripts?

Edit: You’ll notice that when you close the GUI in debug-mode, the Python process might still be running. It’s safe to either kill this via CTRL-X or similar means through Atom. Or you can pull the commit I just made to make this more friendly.

cd pyblish-qml
git pull

One of the benefits of running repos individually like this as opposed to using pyblish-win, is that you can more safely update them. :slight_smile:


#5

Its works in both the Ftrack script, and in stand-alone dependent hosts. Will try repro here today, to make sure.


#6

Thanks for working on this.

The main thing I’ve struggled with trying to get in to Pyblish is getting my head wrapped around how all of the abstraction layers are intended to interact with each other. In isolation the individual components are straight forward enough, but my high level understanding of how the system is designed is to work still has enough gaps that it feels like there is an awful lot of …A Miracle Happens… connecting them. Having more documentation will definitely help with that.


#7

Thanks for saying that @jedfrechette, this was my initial goal when starting to work on this.

It can be difficult for me to clearly see where such gaps are at, so if you encounter any let me know and I’ll try to fill them in best I can.


#8

Thinking about the way I learn, having a tutorial that builds a simple complete demo application that touches all parts of the ecosystem would be really helpful. Say a standalone app that collects images from a directory, validates their sizes, and integrates them somewhere else.

Magenta is great, but is necessarily complex since it’s trying to solve real problems. It’s a pretty big step for “Learning Pyblish by Example” to Magenta and it would be nice to have something concrete to look at that sits in the middle.


#9

Thanks @jedfrechette. I’ll have a think about that.


#10

@jedfrechette, I know you were asking for a more complete example of how plug-ins can work together, but as a first step towards better understanding the framework I added an example of how all of Pyblish can be implemented in about 200 lines of Python.


#11

Nice, thanks again for working on this stuff.


#12

Hey Guys.
I hope you be good. and Happy New Year!
I hope 2016 be a fantastic year for all.

Honestly i want to start developing a full PySide GUI for Pyblish. i study the developer guide and i will study it more. and work seriously on it.

about this snippet i have some words to say:

@contextlib.contextmanager
def application():
    """Enable running from within and outside host"""
    if not QtGui.qApp:
        app = QtGui.QApplication(sys.argv)
        yield
        app.exec_()
    else:
        yield

@marcus This is a good way to run a gui inside and outside of host but there is 2 problem:

  1. When we run the gui for example in maya it is not yet child of maya main window and does not stay on top (like qml one)
  2. If we run another GUI that use same app pyblish window will gone!

There is other ways that i will use in my code and i will share with you. and i know that our method should work on other hosts too, not just maya.

I want to start another Thread on pyblish forum named “PySide GUI For Pyblish”

Let’s make it grate!
:slight_smile:


#13

Yes, that is true. You are free to implement this in any way you like, this was made so as to enable users to run the code anywhere, without focusing too much on the details therein, but instead focus on making the GUI itself small and easily digestible.


#14

Just a heads up, this guide is doesn’t cover Pyblish 1.4 onwards (notice the version in the top-left corner, 1.3) and is due for an update with regards to new install instructions, pyblish-lite and the upcoming engine.