/pyblish-qml

Pyblish QML frontend

Primary LanguagePythonGNU Lesser General Public License v3.0LGPL-3.0

Build Status

Pyblish QML

The Pyblish QML project provides a graphical frontend to Pyblish.




Requirements

The Pyblish QML client depends on pyblish-base and Python 2 or 3, whereas the server requires PyQt5.

  • Any platform

PyQt5 is available on PyPI, but only for Python 3.5. For any other distribution, see below.

$ pip install PyQt5
  • Windows

On Windows, you may download and install the binary distribution from the Riverbank Software website.

  • Debian

Like most Linux distribution, Debian will have PyQt5 available via its native package manager.

$ apt-get install python3-pyqt5 python3-pyqt5.qtquick

See yum for Red Hat based distributions.

  • MacOS

Finally, brew provides a pre-compiled distribution for Python 3 as well.

$ brew install pyqt5



Installation

$ pip install pyblish-qml

Test out the installation with..

$ python -m pyblish_qml --demo



Usage

Run Pyblish QML from any terminal, then show it from your favourite digital content creation software.

Server

# From any terminal
$ python -m pyblish_qml

Client

# From your favourite DCC
import pyblish_qml
pyblish_qml.show()



Under the Hood

Pyblish QML runs as an independent process on your computer, and communicates with your host via interprocess communication through remote-procedure calls (RPC).

It uses the standard xmlrpc library and default to responding to calls via port number 9090.

>>> from xmlrpclib import ServerProxy
>>> proxy = ServerProxy("http://127.0.0.1:9090", allow_none=True)
>>> proxy.ping()
{'message': 'Hello, whomever you are'}

When you show Pyblish QML from within a host, you are effectively making an IPC connection and calling show with parameters relative the currently running process.

>>> proxy.show(9001, {})
# GUI appears

The 9001 refers to the port number through which Pyblish QML may reach whomever is asking it to show. When calling pyblish_qml.show(), a listener is automatically started for you to receive calls from Pyblish QML; unless one is already running.

def show():
    if not listener_started:
        start_listener()

    proxy.show()

You can manually start such a listener by calling..

import pyblish_qml
pyblish_qml.install()

This needs only happen once. To shutdown the listener, you may call..

pyblish_qml.uninstall()



Differences to Pyblish Lite

Pyblish QML fills the same gap as Pyblish Lite, with a few notable differences.

Pros

  • Asynchronous operation - use the GUI during intense processing
  • Faster startup time - it's running before you are
  • Smoother visuals - animations galore
  • Inspect individual items - tens of instances, hundreds of plug-ins? no problem
  • Filter terminal via keyword search - thousands of log entries? no problem

Cons

  • Requires PyQt5 (and either Python 2 or 3)
  • Supports only one publish at a time, for one logged on user at a time (#199)

Development wise, Pyblish QML is written in.. you guessed it, QML. Whereas Pyblish Lite is written using classig widgets. QML is a new graphical user interface language for OpenGL developed by the same group, Qt.




Testing

Tests are automatically run at each commit to GitHub via Travis-CI. You can run these tests locally via Docker too.

$ git clone https://github.com/pyblish/pyblish-qml.git
$ cd pyblish-qml
$ docker build -t pyblish/pyblish-qml .
$ docker run --rm -v $(pwd):/pyblish-qml pyblish/pyblish-qml
# Doctest: pyblish_qml.models.Item ... ok
# Doctest: pyblish_qml.util.ItemList ... ok
# Reset works ... ok
# Publishing works ... ok
# ...
# util.chain works with lambdas ... ok
# 
# ----------------------------------------------------------------------
# Ran 20 tests in 1.430s
# 
# OK