Pyblish workings bird's eye view

I’m trying to get a bird’s eye view of how everything Pyblish work together and then to figure out the gist of it all so I can start approaching the basics here at our studio - for starters, just publish an asset/model to a specific location and have a loader be aware of it (a loader like in pyblish-starter which of course is up to me to program my own fancy one.)

If I understand it all correctly it basically works like this:

Pyblish is the primary API.

Pyblish-base (which includes a lot of other DCCs but I"m mainly interested in Pyblish-maya) is the “middle-man” between Maya and the primary Pyblish API

Pyblish-starter is an example pipeline to show on a basic level how Pyblish works.

Initially I thought that you just needed Pyblish and Pyblish-maya and that you expand Pyblish-maya to do what you need to happen during the publishing of an asset. Now I’m starting to think that on our server we will have Pyblish, Pyblish_maya, and then Pyblish_enter_custom_pipeline_name_here.

To my understanding, for the most part, the plugins (like sublime packages) are were most of the work gets done.

1.) This is how you deal with the type of asset

2.) The contents of the file and the things to check for before making it public

3.) the location it will be shared

Please correct me if I’m wrong. As I said, for starters I literally just want to figure out how to tailor things so that I can define where assets are stored and versioned up as they are published.

Lastly, while setting everything up on my home machine for practice I saw that if you use pip to bring in Pyblish, pyblish-base (which bring in pyblish for nuke, houdini, maya etc) the Pyblish interface in Maya looks different to what I had working on my work computer. I presume that if you use your python-qt5 that will be the case and that the former setup would simply use the “lite” interface by default?

About schema, I’m not sure I understand that correctly. Is this where you define, in those JSON files, how assets related to each other and the folder structure?

I will continue experimenting, but I just wanted to hear from you how these different packages relate to each other. Perhaps I’m completely wrong and you literally fork Pyblish and expand that one repo without the need for anything else.

Hey @mwessels

You are right to ask, cause there aren’t really a good overview of how to develop and work with Pyblish.

Pyblish is the primary API.

pyblish-base is the api. Or more specifically its what is exposed in https://github.com/pyblish/pyblish-base/blob/master/pyblish/api.py

Pyblish-base (which includes a lot of other DCCs but I"m mainly interested in Pyblish-maya) is the “middle-man” between Maya and the primary Pyblish API

pyblish-maya and family like pyblish-nuke, pyblish-houdini etc. are the middleware exposes pyblish to the user in the DCCs.

Pyblish-starter is an example pipeline to show on a basic level how Pyblish works.

Yup, its just a showcase of what can be done. A more advanced case built on Pyblish is https://getavalon.github.io/2.0/ (also used by many of the Pyblish developers). Again this is meant to be a framework and not an entire pipeline. An example of an Avalon pipeline configuration would be https://github.com/Colorbleed/colorbleed-config.

Initially I thought that you just needed Pyblish and Pyblish-maya and that you expand Pyblish-maya to do what you need to happen during the publishing of an asset. Now I’m starting to think that on our server we will have Pyblish, Pyblish_maya, and then Pyblish_enter_custom_pipeline_name_here.

Yeah, the preferred method of working is to make your own repository of plugins for Pyblish. If you want to follow the naming convention of Pyblish, your repository would be named something like pyblish-{organization}.

To my understanding, for the most part, the plugins (like sublime packages) are were most of the work gets done.

Spot on. Its in the plugins where you define you pipeline.

Lastly, while setting everything up on my home machine for practice I saw that if you use pip to bring in Pyblish, pyblish-base (which bring in pyblish for nuke, houdini, maya etc) the Pyblish interface in Maya looks different to what I had working on my work computer. I presume that if you use your python-qt5 that will be the case and that the former setup would simply use the “lite” interface by default?

Yeah, think the pip installation will use pyblish-lite, which is not dependent on the Qt varient/version. Pyblish-qml does have more features though.

About schema, I’m not sure I understand that correctly. Is this where you define, in those JSON files, how assets related to each other and the folder structure?

Are you referring to https://github.com/pyblish/pyblish-starter/blob/master/pyblish_starter/schema.py ?
I haven’t used pyblish-starter myself, but I guessing its similar to how Avalon works https://getavalon.github.io/2.0/reference/#schemas

1 Like

Hi @mwessels!

pyblish-base is what the API is called and can either be used independently, or alongside pyblish-maya for a Maya integration or pyblish-qml for a GUI and so forth. These all build on pyblish-base where the core, or “base”, functionality lies.

For example, you can publish using just base like this.

from pyblish import util
util.publish()

This will run through all plug-ins in exactly the same way as a GUI would, and yet does not require one.

I’m a little unsure of what you’re referring to here, Pyblish is the name of the overall project, but there is no software specifically called “Pyblish”. Are you referring to pip install pyblish or https://github.com/pyblish/pyblish? That repository contains a known working combination of Pyblish projects along with exact versions, such as pyblish-base and pyblish-maya, and when installed would install those automatically. But it is optional, and most people use base and maya etc. as-is.

I think your best bet is having a look at the plug-ins provided with Starter, here and from there have a look at some other, production examples such as this or this, and you can find more by searching on GitHub for just pyblish, like this.

There are two optional GUIs for Pyblish, one called pyblish-lite and the other pyblish-qml, what you saw could have been one and then the other?

Can you be more specific? Where are you finding mention of a schema?

In a nutshell, you only need pyblish-base, and then add what you find missing, such as a GUI or a Maya integration.

1 Like

Thanks for the reply @marcus and @tokejepsen.

The statement “Pyblish is the primary API.” came from a misunderstanding of what https://github.com/pyblish/pyblish is. The name of the repo made me believe it’s the core of Pyblish, but then there was also Pyblish-base, which made it seem like the latter is a simpler even more bare bones version of Pyblish. You cleared that up for me by pointing out that it’s a combination of pyblish projects, pyblish-base and pyblish-maya.

I have been looking at Starter, and it has been helpful. For the life of me I cannot find the doc that outlined the “schema”. It must have been the Starter docs. Apologies, I have been jumping through a lot of different links on the forum, the api docs the learn by example docs and the starter docs., can’t recall if this was used elsewhere. But the sound of it, it’s not a fundamental thing, and people are getting by without it?

In the meantime I have also figured out that it was indeed pyblish-lite that runs when you are only using “Pyblish” (the combination repo).

Then I think I will do my setup to use, Pyblish-base, Pyblish-maya and Pyblish-qml. And as @tokejepsen pointed out I will make my studio pyblish repo pyblish-{organization} and start building my plugins to go through the CVEI steps.

Thanks again for all the links and clarification.

For inspiration on plugins have a look on Github; https://github.com/search?q=pyblish-

1 Like

Woah, I completely missed that Toke had also answered. Great minds think alike! :smiley:

2 Likes