Skip to content

validate_instance_camera_data

Plugin to validate if instance has camera data.

ValidateInstanceCameraData

Bases: InstancePlugin

Check if instance has camera data.

There might not be any camera associated with the instance and without it, the instance is not valid.

Source code in client/ayon_equalizer/plugins/publish/validate_instance_camera_data.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class ValidateInstanceCameraData(pyblish.api.InstancePlugin):
    """Check if instance has camera data.

    There might not be any camera associated with the instance
    and without it, the instance is not valid.
    """

    order = ValidateContentsOrder
    hosts: ClassVar[list] = ["equalizer"]
    families: ClassVar[list] = ["matchmove"]
    label = "Validate Instance has Camera data"

    def process(self, instance: pyblish.api.Instance) -> None:
        """Process the validation."""
        try:
            _ = instance.data["cameras"]
        except KeyError as e:
            error_msg = "No camera data found"
            raise PublishValidationError(error_msg) from e

process(instance)

Process the validation.

Source code in client/ayon_equalizer/plugins/publish/validate_instance_camera_data.py
21
22
23
24
25
26
27
def process(self, instance: pyblish.api.Instance) -> None:
    """Process the validation."""
    try:
        _ = instance.data["cameras"]
    except KeyError as e:
        error_msg = "No camera data found"
        raise PublishValidationError(error_msg) from e