Bases: MayaInstancePlugin
, OptionalPyblishPluginMixin
Validate whether the V-Ray Proxy instance has shape members
Source code in client/ayon_maya/plugins/publish/validate_vrayproxy_members.py
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 ValidateVrayProxyMembers(plugin.MayaInstancePlugin,
OptionalPyblishPluginMixin):
"""Validate whether the V-Ray Proxy instance has shape members"""
order = pyblish.api.ValidatorOrder
label = 'VRay Proxy Members'
families = ['vrayproxy']
actions = [ayon_maya.api.action.SelectInvalidAction]
optional = False
def process(self, instance):
if not self.is_active(instance.data):
return
invalid = self.get_invalid(instance)
if invalid:
raise PublishValidationError("'%s' is invalid VRay Proxy for "
"export!" % instance.name)
@classmethod
def get_invalid(cls, instance):
shapes = cmds.ls(instance,
shapes=True,
noIntermediate=True,
long=True)
if not shapes:
cls.log.error("'%s' contains no shapes." % instance.name)
# Return the instance itself
return [instance.name]
|