Skip to content

create_maya_royalrender_job

Submitting render job to RoyalRender.

CreateMayaRoyalRenderJob

Bases: BaseCreateRoyalRenderJob

Source code in client/ayon_royalrender/plugins/publish/create_maya_royalrender_job.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class CreateMayaRoyalRenderJob(lib.BaseCreateRoyalRenderJob):
    label = "Create Maya Render job in RR"
    hosts = ["maya"]
    families = ["renderlayer"]

    def update_job_with_host_specific(self, instance, job):
        job.Software = "Maya"
        job.Renderer = "arnold-maya"
        job.Version = "{0:.2f}".format(MGlobal.apiVersion() / 10000)
        if instance.data.get("cameras"):
            job.Camera = instance.data["cameras"][0].replace("'", '"')
        workspace = instance.context.data["workspaceDir"]
        job.SceneDatabaseDir = workspace

        return job

    def process(self, instance):
        """Plugin entry point."""
        super(CreateMayaRoyalRenderJob, self).process(instance)

        expected_files = instance.data["expectedFiles"]
        first_file_path = next(iter_expected_files(expected_files))
        output_dir = os.path.dirname(first_file_path)
        instance.data["outputDir"] = output_dir

        layer = instance.data["setMembers"]  # type: str
        layer_name = layer.removeprefix("rs_")

        job = self.get_job(
            instance, self.scene_path, first_file_path, layer_name
        )
        job = self.update_job_with_host_specific(instance, job)

        instance.data["rrJobs"].append(job)

process(instance)

Plugin entry point.

Source code in client/ayon_royalrender/plugins/publish/create_maya_royalrender_job.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def process(self, instance):
    """Plugin entry point."""
    super(CreateMayaRoyalRenderJob, self).process(instance)

    expected_files = instance.data["expectedFiles"]
    first_file_path = next(iter_expected_files(expected_files))
    output_dir = os.path.dirname(first_file_path)
    instance.data["outputDir"] = output_dir

    layer = instance.data["setMembers"]  # type: str
    layer_name = layer.removeprefix("rs_")

    job = self.get_job(
        instance, self.scene_path, first_file_path, layer_name
    )
    job = self.update_job_with_host_specific(instance, job)

    instance.data["rrJobs"].append(job)