Skip to content

collect_batch_instance

Collect batch instance from current Flame context.

CollectBatchInstance

Bases: InstancePlugin

Collect batch render instances and handle the review attribute.

Source code in client/ayon_flame/plugins/publish/collect_batch_instance.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class CollectBatchInstance(pyblish.api.InstancePlugin):
    """Collect batch render instances and handle the review attribute."""

    order = pyblish.api.CollectorOrder - 0.48
    label = "Collect Batch instance"
    families = ["workfile"]
    hosts = ["flame"]

    def process(self, instance):
        if instance.data.get("batch_name") is None:
            self.log.info(
                "Instance is not a batch workfile, skipping."
            )
            return

        batch_name = instance.data["batch_name"]
        batch = flapi.get_batch_from_workspace(batch_name)
        if not batch:
            raise ValueError(f"Batch group not found: {batch_name}")

        instance.data["version"] = batch.current_iteration_number
        instance.data["followWorkfileVersion"] = False
        self.log.debug(f"Collected batch version: {instance.data['version']}")