Now that you know how to arrange plug-ins, let's have a look at how to manage the control flow of publishing.
import pyblish.apiclass MyPlugin(pyblish.api.ContextPlugin):hosts = ["maya"]def process(self, context):from maya import cmdscmds.headsUpMessage("Hello from Pyblish")pyblish.api.register_plugin(MyPlugin)import pyblish.utilpyblish.util.publish()# Hello from Pyblish
hosts is a requirement attribute and limits plug-ins to a particular scenario.
In this case, the plug-in will only run when publishing from within Autodesk Maya. These are some examples of available values for the
You can register your own host, if for example you would like to extend Pyblish for use in additional software, by using