-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect_something.py
50 lines (40 loc) · 1.27 KB
/
collect_something.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import pyblish.api
from ayon_core.lib import BoolDef
from ayon_core.pipeline import publish
class CollectSomeInstanceAttrs(pyblish.api.InstancePlugin,
publish.AYONPyblishPluginMixin,):
"""A boilerplate to add an attrdef to publish instances."""
label = "Collect Some Instance Attrs"
order = pyblish.api.CollectorOrder
hosts = ["traypublisher"]
families = ["*"]
def process(self, instance):
# do something
pass
@classmethod
def get_attribute_defs(cls):
return [
BoolDef(
"a_toggle_instance",
default=True,
label="A Toggle per instance"
)
]
class CollectSomeContextAttrs(pyblish.api.ContextPlugin,
publish.AYONPyblishPluginMixin,):
"""A boilerplate to add an attrdef to publish context."""
label = "Collect Some Context Attrs"
order = pyblish.api.CollectorOrder
hosts = ["traypublisher"]
def process(self, context):
# do something
pass
@classmethod
def get_attribute_defs(cls):
return [
BoolDef(
"a_toggle_context",
default=True,
label="A Toggle per context"
)
]