Skip to content

collect_current_file

CollectBlenderCurrentFile

Bases: BlenderContextPlugin

Inject the current working file into context

Source code in client/ayon_blender/plugins/publish/collect_current_file.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
class CollectBlenderCurrentFile(plugin.BlenderContextPlugin):
    """Inject the current working file into context"""

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

    def process(self, context):
        """Inject the current working file"""
        current_file = workio.current_file()
        context.data["currentFile"] = current_file

process(context)

Inject the current working file

Source code in client/ayon_blender/plugins/publish/collect_current_file.py
12
13
14
15
def process(self, context):
    """Inject the current working file"""
    current_file = workio.current_file()
    context.data["currentFile"] = current_file