Bases: InstancePlugin
Collect online file and retain its file name.
Source code in client/ayon_traypublisher/plugins/publish/collect_online_file.py
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 | class CollectOnlineFile(pyblish.api.InstancePlugin):
"""Collect online file and retain its file name."""
label = "Collect Online File"
order = pyblish.api.CollectorOrder
families = ["online"]
hosts = ["traypublisher"]
def process(self, instance):
file = Path(instance.data["creator_attributes"]["path"])
review = instance.data["creator_attributes"]["add_review_family"]
instance.data["review"] = review
if "review" not in instance.data["families"]:
instance.data["families"].append("review")
self.log.info(f"Adding review: {review}")
instance.data["representations"].append(
{
"name": file.suffix.lstrip("."),
"ext": file.suffix.lstrip("."),
"files": file.name,
"stagingDir": file.parent.as_posix(),
"tags": ["review"] if review else []
}
)
|