Skip to content

validate_no_vraymesh

ValidateNoVRayMesh

Bases: MayaInstancePlugin, OptionalPyblishPluginMixin

Validate there are no VRayMesh objects in the instance

Source code in client/ayon_maya/plugins/publish/validate_no_vraymesh.py
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
class ValidateNoVRayMesh(plugin.MayaInstancePlugin,
                         OptionalPyblishPluginMixin):
    """Validate there are no VRayMesh objects in the instance"""

    order = pyblish.api.ValidatorOrder
    label = 'No V-Ray Proxies (VRayMesh)'
    families = ["pointcache"]
    optional = False

    def process(self, instance):
        if not self.is_active(instance.data):
            return
        if not cmds.pluginInfo("vrayformaya", query=True, loaded=True):
            return

        shapes = cmds.ls(instance,
                         shapes=True,
                         type="mesh")

        inputs = cmds.listConnections(shapes,
                                      destination=False,
                                      source=True) or []
        vray_meshes = cmds.ls(inputs, type='VRayMesh')
        if vray_meshes:
            raise PublishValidationError(
                "Meshes that are V-Ray Proxies should not be in an Alembic "
                "pointcache.\n"
                "Found V-Ray proxies:\n\n{}".format(
                    _as_report_list(sorted(vray_meshes))
                ),
                title="V-Ray Proxies in pointcache"
            )