Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host registration #177

Closed
mottosso opened this issue May 18, 2015 · 1 comment
Closed

Host registration #177

mottosso opened this issue May 18, 2015 · 1 comment

Comments

@mottosso
Copy link
Member

Goal

Facilitate the inclusion of any host, without needing to alter surrounding libraries.

Motivation

Currently, a few hosts are supported by the core Pyblish library. They are currently hard-coded to look at an executables filename, and only a few are supported. This means that whenever a new host comes along, such as Softimage or Clarisse, the core library must be updated to include them.

Implementation

Integrations will register supported hosts at run-time, and Pyblish will be capable of supporting multiple concurrent hosts; such as maya and python.

This is the full API.

# From the Maya integration
import pyblish.api
pyblish.api.register_host("maya")

As you can see, there is no longer any need for evaluating the executable of the currently running software, instead the host is determined by it's integration. An integration can then register multiple hosts, if needed, where it makes sense to do so, and then have plug-ins operate on individual parts of a software package.

import pyblish.api
pyblish.api.register_host("maya")
pyblish.api.register_host("mayapy")
pyblish.api.register_host("mayabatch")

For which plug-ins could support one or more of these.

class MyPlugin(...):
   hosts = ["maya", "mayapy"]  # Supported when publishing from mayapy and the Maya GUI

The executable environment of Pyblish itself will be registered automatically, e.g. python.

This also means that we need an additional member to the API.

import pyblish.api
pyblish.api.current_hosts()

Which returns a list of hosts as string. current_host() will remain as-is, and will return the last-registered host.

Discussion

See forums.

mottosso added a commit to mottosso/pyblish-base that referenced this issue Jul 17, 2015
@mottosso mottosso mentioned this issue Jul 17, 2015
@mottosso
Copy link
Member Author

mottosso commented Aug 4, 2015

Implemented in 1.1.3.

@mottosso mottosso closed this as completed Aug 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant