Skip to content

create_rendersetup

CreateRenderSetup

Bases: MayaCreator

Create rendersetup template json data

Source code in client/ayon_maya/plugins/create/create_rendersetup.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class CreateRenderSetup(plugin.MayaCreator):
    """Create rendersetup template json data"""

    identifier = "io.openpype.creators.maya.rendersetup"
    label = "Render Setup Preset"
    product_type = "rendersetup"
    icon = "tablet"

    def get_pre_create_attr_defs(self):
        # Do not show the "use_selection" setting from parent class
        return []

    def create(self, product_name, instance_data, pre_create_data):

        existing_instance = None
        for instance in self.create_context.instances:
            if instance.product_type == self.product_type:
                existing_instance = instance
                break

        if existing_instance:
            raise CreatorError("A RenderSetup instance already exists - only "
                               "one can be configured.")

        super(CreateRenderSetup, self).create(product_name,
                                              instance_data,
                                              pre_create_data)