Skip to content

create_matte_shapes

CreateMatteShapes

Bases: SilhouetteCreator

Matte Shapes

Source code in client/ayon_silhouette/plugins/create/create_matte_shapes.py
 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
32
33
34
35
36
37
38
39
40
41
42
class CreateMatteShapes(plugin.SilhouetteCreator):
    """Matte Shapes"""

    identifier = "io.ayon.creators.silhouette.matteshapes"
    label = "Matte Shapes"
    description = __doc__
    product_type = "matteshapes"
    icon = "cubes"

    create_node_type = "RotoNode"

    def get_attr_defs_for_instance(self, instance):
        node = instance.transient_data["instance_node"]
        items = [
            {"label": label, "value": shape.id}
            for shape, label in lib.iter_children(node)
            if isinstance(shape, fx.Shape)
        ]
        if not items:
            items.append({
                "label": "<No shapes found>",
                "value": None
            })

        attr_defs = [
            EnumDef(
                "shapes",
                label="Export shapes",
                items=items,
                tooltip="Select shapes to include in matte shapes output. If "
                        "none are selected then all shapes will be included.",
                multiselection=True,
            )
        ]

        return attr_defs