Skip to content

collect_current_file

CollectCurrentFile

Bases: ContextPlugin

Inject the current working file into context

Source code in client/ayon_photoshop/plugins/publish/collect_current_file.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class CollectCurrentFile(pyblish.api.ContextPlugin):
    """Inject the current working file into context"""

    order = pyblish.api.CollectorOrder - 0.49
    label = "Current File"
    hosts = ["photoshop"]

    def process(self, context):
        host = registered_host()
        filename: str = host.get_current_workfile() or ""
        if not filename:
            self.log.debug("Current file appears to be unsaved.")

        self.log.debug(f"Collected current file: '{filename}'")
        context.data["currentFile"] = filename