Bases: MayaInstancePlugin
, OptionalPyblishPluginMixin
Validate meshes don't have lamina faces.
Lamina faces share all of their edges.
Source code in client/ayon_maya/plugins/publish/validate_mesh_lamina_faces.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
43
44
45
46
47
48
49
50
51
52
53 | class ValidateMeshLaminaFaces(plugin.MayaInstancePlugin,
OptionalPyblishPluginMixin):
"""Validate meshes don't have lamina faces.
Lamina faces share all of their edges.
"""
order = ValidateMeshOrder
families = ['model']
label = 'Mesh Lamina Faces'
actions = [ayon_maya.api.action.SelectInvalidAction]
optional = True
description = (
"## Meshes with Lamina Faces\n"
"Detected meshes with lamina faces. <b>Lamina faces</b> are faces "
"that share all of their edges and thus are merged together on top of "
"each other.\n\n"
"### How to repair?\n"
"You can repair them by using Maya's modeling tool `Mesh > Cleanup..` "
"and select to cleanup matching polygons for lamina faces."
)
@staticmethod
def get_invalid(instance):
meshes = cmds.ls(instance, type='mesh', long=True)
invalid = [mesh for mesh in meshes if
cmds.polyInfo(mesh, laminaFaces=True)]
return invalid
def process(self, instance):
"""Process all the nodes in the instance 'objectSet'"""
if not self.is_active(instance.data):
return
invalid = self.get_invalid(instance)
if invalid:
raise PublishValidationError(
"Meshes found with lamina faces: {0}".format(invalid),
description=self.description)
|
process(instance)
Process all the nodes in the instance 'objectSet'
Source code in client/ayon_maya/plugins/publish/validate_mesh_lamina_faces.py
43
44
45
46
47
48
49
50
51
52
53 | def process(self, instance):
"""Process all the nodes in the instance 'objectSet'"""
if not self.is_active(instance.data):
return
invalid = self.get_invalid(instance)
if invalid:
raise PublishValidationError(
"Meshes found with lamina faces: {0}".format(invalid),
description=self.description)
|