In the previous example, you might have gotten the reverse output.
# hello from plugin2# hello from plugin1
That's because plug-ins are sorted by the class attribute order
, and we didn't change it.
import pyblish.apiclass FirstPlugin(pyblish.api.ContextPlugin):order = 0def process(self, context):print("hello")class SecondPlugin(pyblish.api.ContextPlugin):order = 1def process(self, context):print("world")pyblish.api.register_plugin(FirstPlugin)pyblish.api.register_plugin(SecondPlugin)import pyblish.utilpyblish.util.publish()# hello# world
They now run in the expected order.