Pyblish 1.4 Released

Previous releases



Summary of new features.

Management

  • README replaces Wiki
  • Most packages no on PyPI.
  • pyblish is now a PyPI package.

API

  • Full support for Python 3 across all relevant projects
  • Many bugs were squashed in the making of this release
  • Persistent unique IDs for plug-ins and instances via .id.
  • register_gui is now a thing.

GUI




Overview

The main difference you’ll notice is of course Pyblish Lite. For those of you who have waited for, or developed your own alternative to Pyblish QML, this one’s for you. Written in pure Python with a single dependency on any Qt binding. That is, if you have PyQt5 installed, great. If you have PySide installed, that’s ok too and you don’t have to worry about explicitly telling Lite which one to chose, as they are all equally fine.

The focus of Lite is compatibility. Recommended use is to try Pyblish QML, and gracefully fallback to Lite where needed. Which brings me to the next highlight.

register_gui()

Before, when Pyblish QML roamed the world on his own, integrations such as pyblish-maya made a series of assumptions about how to embrace its existence. Which meant that it added bulk where not necessary for those who did not use QML.

register_gui() solves this by promoting a common interface towards every GUI and allowing the user or developer tell Pyblish which he would rather use.

import pyblish.api
pyblish.api.register_gui("pyblish_lite")

From then on, any GUI-related functionality, such as pyblish-maya, can look for what you have registered, and act accordingly.

import pyblish_maya
pyblish_maya.show()
# Viola, pyblish-lite appears.

The only requirement for the GUI, is that it is on the PYTHONPATH at the time of calling show(), and that is exposes a single member function, also called show() at the package-level.

Example

# my_package/__init__.py

def show():
  # your GUI here

Fallback

I mentioned a fallback mechanism. You can register multiple GUIs and have your integration choose the most desirable one. The current behavior is for your integration, such as the File->Publish menu-item in Autodesk Maya, to cycle between those registered and (1) look them up from your PYTHONPATH and (2) query the existence of def show().



README

Up till now, each project has provided documentation through their native GitHub Wiki. This has proven overly complex and unable to stay up to date with changing software; partly due to forgetfulness, but also because the Wiki is simply disconnected from the version control its parent Git repository.

Instead, each project now boasts a minimal yet complete README.md with full details on how to use a project.

The hope is that the README should be more inviting and provide less temptation to nest instructions, adding complexity to what is intended for simplicity.

See here



Installation

As a response to user feedback, all Pyblish projects are now proudly hosted and accessible on PyPI.

Install latest projects individually…

$ pip install pyblish-base
$ pip install pyblish-maya
$ pip install pyblish-lite

Or install a known working combination of primary projects all at once…

$ pip install pyblish

The recommended use of PyPI packages is both for those just getting started, and for integration into a studio via tools such as Rez. Developer should still clone repositories and append to their PYTHONPATHs as usual.

Pyblish QML

Pyblish QML now has full support for Python 3, which means that installing PyQt5 on most platforms is a command away.

Debian

$ apt-get install -y python3-pyqt5 python3-pyqt5.qtquick
$ pip install pyblish-qml
$ python -m pyblish_qml --demo

Windows

  1. Download and install PyQt5
  2. pip install pyblish-qml
  3. python -m pyblish_qml --demo

MacOS

$ brew install pyqt5
$ pip install pyblish-qml
$ python -m pyblish_qml --demo

In light of the simpler alternative (i.e. Lite) Pyblish QML is now more honest about your responsibilities.

It’s a host-agnostic graphical user interface that communicates with your hosts through inter-process communication, and requires to be run independently.

$ python -m pyblish_qml

Once started, your hosts then share this single instance - providing an interface to software not necessarily shipped with Qt bindings. As such, Pyblish QML depends on PyQt5 when started, and no dependencies apart from Python 2 or 3 to use.

Maya

import pyblish_qml
pyblish_qml.show()

Nuke

import pyblish_qml
pyblish_qml.show()

The recommended way to use it is to launch during login and keep it running in the background.

Refer to the new README for details.



Deprecated

With these new improvements, a number of projects are no longer required.

  • pyblish-rpc - Has been integrated into pyblish-qml, along with…
  • pyblish-integration
  • pyblish-win - Has been superseded by pip install pyblish and that pyblish-qml is compatible with Python 3.
  • pyblish-shell - Primarily intended to help Windows users by providing a pre-compiled PyQt5 distribution, this is no longer needed as PyQt5 is provided natively by the developer.

Enjoy!

As best practices become better, installation and maintenance has changed somewhat since Pyblish was initially released almost 2 years ago. These practices are currently spread out across forum, GitHub issues, Gitter conversation and more.

So I wanted to provide a holistic suggestion on how you can install and manage Pyblish in your pipeline, regardless of size.

From the highest level, there are two user groups.

  • The end-user, applies to most users who aren’t contributing
  • The contributor, applies to users who are both using and contributing

The following is an installation and maintenance guide for the end-user. Contributors, give a shout out if you’d like a similar overview.



End-User Installation and Maintenance

As Pyblish, and pipelines in general, are so diverse, it’s hard to give an exact recipe for how to manage it or on how to integrate external software such as Pyblish. So the following can only be a general guideline for how the project is expected to be used.

Table of contents

  1. Manage
  • Use pip
  • Use git
  1. Install
  2. Integrate
  3. Celebrate

1a. Use pip

Pip enables an easy install, manages dependencies across projects, such as pyblish-base and pyblish-maya and works well with glue software like conda and Rez.

$ pip install pyblish-base

This approach is recommended.

1b. Or use git

Every Pyblish project consistently provides a single Python package as first child of each git repository as well, so if pip is not your cup of tea, or if you prefer the latest versions, or if you develop for/with Pyblish, you may also…

$ git clone https://github.com/pyblish/pyblish-base
$ export PYTHONPATH=$(pwd)/pyblish-base

And you’d have the equivalent of…

$ pip install pyblish-base

Just bear in mind that not all versions of every project is guaranteed (or tested) to work with each other. For example, there may be a new feature in pyblish-base used by the very latest pyblish-maya, but you haven’t yet updated pyblish-base. This is one of the advantages to pip which tracks dependent versions.

If you do still end up using plain git, see the setup.py of the aggregate repository for which combination is supported.

2. Install

Once you’ve picked your poison, it’s time to choose the functionality you are interested in.

In Pyblish, you have the option of (1) going bare metal and stick with pyblish-base, giving you and your tools full flexibility in terms of how it should look, what it should do and where it should do it. This requires the most amount of setup on your part to get going.

Or you may (2) pick one of the available graphical user interfaces, pyblish-lite or pyblish-qml, and integrations such as pyblish-maya and pyblish-nuke, and reap the benefits of the development and best practices gathered throughout the lifetime of Pyblish and its userbase. This is the recommended approach for most users.

3. Integrate

If you picked a graphical user interface, or chose to develop your own, you should register it such that buttons and menus provide you with the right one.

import pyblish.api
pyblish.api.register_gui("pyblish_lite")  # Fallback
pyblish.api.register_gui("pyblish_qml")

Otherwise you can skip this step.

Each integration, such as pyblish-maya, provides an entry-point at module-level called setup().

import pyblish_maya
pyblish_maya.setup()

This will take into consideration your preferred GUI and mould Pyblish into the host application in whatever method makes the most sense for that environment. For example, as a File-menu item or right-click menu item. It also registers a series of generic plug-ins to retrieve typical information about your host, such as context.data["sceneFile"].

4. Celebrate

At this point, it’s up to you to develop your dream publishing pipeline.

Here are a few starting points.

  1. Learn By Example
  2. Developer Guide
  3. API documentation
  4. Chat

Enjoy!