1.1.3
Version 1.1.3
- Feature: Dict-like getting of instances from Context (#208)
- Feature: Host registration (#177)
collect
andintegrate
now available via pyblish.util- "asset" available in context.data("result") for forwards compatibility
- Bugfix: Decrementing order actually works now. (#206)
Context getter
You can now reference Instance
's by "id" directly from a Context
.
import pyblish.api
context = pyblish.api.Context()
context.create_instance("MyInstance")
my_instance = context["MyInstance"]
id
is generally the same as an Instance
's name
.
Host integration
This replaces the current behaviour and use of pyblish.api.current_host()
.
Practically, everything will still work, including current_host()
(which is now deprecated, read on) with the added requirement that an integration must be loaded for plug-ins to filter against it.
For example, when you load Maya, it's the Pyblish for Maya integration that registers the host, maya
. If this doesn't happen, then plug-ins filtered by hosts = ["maya"]
won't run.
You have most likely already done this, as it's how Pyblish QML automatically registers itself as well, but in the rare case where you are using a host, along with plug-ins filtered by that host, but haven't registered the integration, you will notice a change in behaviour.
New functions
Like mentioned above, current_host
is still alive and well, but is to be considered deprecated, as it will only return the last registered host. I've made it so that Maya, for example, registers mayapy
, mayabatch
, and maya
in this order, meaning current_host
will still return the expected maya
for backwards compatibility.
Henceforth, registered_hosts()
is the official method with which to query which hosts are currently supported.
>>> import pyblish.api
>>> pyblish.api.registered_hosts()
["python", "mayabatch", "mayapy", "maya"]
python
is automatically registered during initialisation, but can be removed, along with every other hosts, should you need, via deregister_all_hosts()
.
Here are all the new functions related to this functionality.
register_host
registered_hosts
deregister_host
deregister_all_hosts