Skip to content

collect_current_file

Collect information about current file.

CollectCurrentFile

Bases: ContextPlugin

Inject the current working file into context.

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

    order = pyblish.api.CollectorOrder - 0.5
    label = "Current File"
    hosts = ["harmony"]

    def process(self, context):
        """Inject the current working file."""
        self_name = self.__class__.__name__

        current_file = harmony.send(
            {"function": f"AyonHarmony.Publish.{self_name}.collect"})["result"]
        context.data["currentFile"] = os.path.normpath(current_file)

process(context)

Inject the current working file.

Source code in client/ayon_harmony/plugins/publish/collect_current_file.py
16
17
18
19
20
21
22
def process(self, context):
    """Inject the current working file."""
    self_name = self.__class__.__name__

    current_file = harmony.send(
        {"function": f"AyonHarmony.Publish.{self_name}.collect"})["result"]
    context.data["currentFile"] = os.path.normpath(current_file)