Skip to content

collect_current_file

CollectCurrentFile

Bases: ContextPlugin

Inject the current working file into context

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

    order = pyblish.api.CollectorOrder - 0.49
    label = "Current Workfile"
    hosts = ["substancepainter"]

    def process(self, context):
        host = registered_host()
        path = host.get_current_workfile()
        context.data["currentFile"] = path
        self.log.debug(f"Current workfile: {path}")