Skip to content

create_model

CreateModel

Bases: MayaCreator

Polygonal static geometry

Source code in client/ayon_maya/plugins/create/create_model.py
 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class CreateModel(plugin.MayaCreator):
    """Polygonal static geometry"""

    identifier = "io.openpype.creators.maya.model"
    label = "Model"
    product_type = "model"
    icon = "cube"
    default_variants = ["Main", "Proxy", "_MD", "_HD", "_LD"]

    write_face_sets = True
    include_shaders = False

    def get_instance_attr_defs(self):

        return [
            # TODO: Differentiate this more clearly from the exact Alembic
            #  export feature to 'write face sets'
            #  This particular toggle here implements an additional process
            #  step for exports where ANY shader assignment is turned into an
            #  explicit 'per face' assignment even if it was just a regular
            #  full object material assignment in Maya.
            #  See: https://github.com/ynput/ayon-maya/pull/37
            BoolDef("writeFaceSets",
                    label="Write face sets",
                    tooltip="Write face sets with the geometry",
                    default=self.write_face_sets),
            BoolDef("includeParentHierarchy",
                    label="Include Parent Hierarchy",
                    tooltip="Whether to include parent hierarchy of nodes in "
                            "the publish instance",
                    default=False),
            BoolDef("include_shaders",
                    label="Include Shaders",
                    tooltip="Include shaders in the geometry export.",
                    default=self.include_shaders),
            # TODO: Remove these `attr` and `attrPrefix` attributes to avoid
            #  confusion. This currently does NOT influence the model product
            #  `mayaScene` nor `Alembic` output. It only influences the Maya
            #  USD exported output. Which is confusing, because the attr def
            #  is ALSO exposed in the Alembic export plugin as attr defs.
            #  Preferably we unify them or clean it up some way so they are
            #  not duplicated.
            TextDef("attr",
                    label="Custom Attributes",
                    tooltip="Relevant to Maya USD Export only",
                    default="",
                    placeholder="attr1, attr2"),
            TextDef("attrPrefix",
                    label="Custom Attributes Prefix",
                    tooltip="Relevant to Maya USD Export only",
                    placeholder="prefix1, prefix2"),
        ]