Coordination
In the previous example, you might have gotten the reverse output.
1
# hello from plugin2
2
# hello from plugin1
Copied!
That's because plug-ins are sorted by the class attribute order, and we didn't change it.
1
import pyblish.api
2
3
class FirstPlugin(pyblish.api.ContextPlugin):
4
order = 0
5
6
def process(self, context):
7
print("hello")
8
9
class SecondPlugin(pyblish.api.ContextPlugin):
10
order = 1
11
12
def process(self, context):
13
print("world")
14
15
pyblish.api.register_plugin(FirstPlugin)
16
pyblish.api.register_plugin(SecondPlugin)
17
18
import pyblish.util
19
pyblish.util.publish()
20
# hello
21
# world
Copied!
They now run in the expected order.
Last modified 1yr ago
Copy link