Skip to content

collect_current_file

CollectCinema4DCurrentFile

Bases: ContextPlugin

Inject the current working file into context

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

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

    def process(self, context):
        """Inject the current working file"""

        current_file = api.current_file()
        context.data['currentFile'] = current_file
        if not current_file:
            self.log.warning(
                "Current file is not saved. Save the file before continuing."
            )

process(context)

Inject the current working file

Source code in client/ayon_cinema4d/plugins/publish/collect_current_file.py
12
13
14
15
16
17
18
19
20
def process(self, context):
    """Inject the current working file"""

    current_file = api.current_file()
    context.data['currentFile'] = current_file
    if not current_file:
        self.log.warning(
            "Current file is not saved. Save the file before continuing."
        )