Skip to content

validate_glsl_plugin

ValidateGLSLPlugin

Bases: MayaInstancePlugin, OptionalPyblishPluginMixin

Validate if the asset uses GLSL Shader

Source code in client/ayon_maya/plugins/publish/validate_glsl_plugin.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class ValidateGLSLPlugin(plugin.MayaInstancePlugin,
                         OptionalPyblishPluginMixin):
    """
    Validate if the asset uses GLSL Shader
    """

    order = ValidateContentsOrder + 0.15
    families = ['gltf']
    label = 'maya2glTF plugin'
    actions = [RepairAction]
    optional = False

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

    @classmethod
    def repair(cls, instance):
        """
        Repair instance by enabling the plugin
        """
        return cmds.loadPlugin("maya2glTF", quiet=True)

repair(instance) classmethod

Repair instance by enabling the plugin

Source code in client/ayon_maya/plugins/publish/validate_glsl_plugin.py
30
31
32
33
34
35
@classmethod
def repair(cls, instance):
    """
    Repair instance by enabling the plugin
    """
    return cmds.loadPlugin("maya2glTF", quiet=True)