Remove validate_namespace_empty because it doesn't matter if a work model scene has empty namespaces at all, they will never be extracted anyway since it doesn't contain any meshes anyway.

This commit is contained in:
Roy Nieterau 2017-09-28 14:25:32 +02:00
parent cb0b2611a2
commit 46d007c59a

View file

@ -1,39 +0,0 @@
from maya import cmds
import pyblish.api
import colorbleed.api
class ValidateNamespaceEmpty(pyblish.api.ContextPlugin):
"""Validate there are no empty namespaces in the scene.
This is a scene wide validation that filters out "UI" and "shared"
namespaces that exist by default in Maya and are mostly hidden.
A namespace that has other namespaces in it is *not* considered empty.
Only those that have no children namespaces or nodes is considered empty.
"""
order = colorbleed.api.ValidateSceneOrder
hosts = ["maya"]
families = ["colorbleed.model"]
label = "No Empty Namespaces"
def process(self, context):
"""Process the Context"""
all_namespaces = cmds.namespaceInfo(":",
listOnlyNamespaces=True,
recurse=True)
non_internal_namespaces = [ns for ns in all_namespaces
if ns not in ["UI", "shared"]]
invalid = []
for namespace in non_internal_namespaces:
namespace_content = cmds.namespaceInfo(namespace,
listNamespace=True,
recurse=True)
if not namespace_content:
invalid.append(namespace)
assert not invalid, ("Empty namespaces found: {0}".format(invalid))