def get_invalid(cls, instance): from maya import cmds if not plugins.depended_plugins_succeed(cls, instance): raise Exception("Depended plugin failed. See error log.") invalid = list() for node in cls.get_geometries(instance): if not cmds.nodeType(node) == "transform": invalid.append(node) continue children = cmds.listRelatives(node, children=True, fullPath=True) or [] if not children: invalid.append(node) continue for chd in children: if not cmds.ls(chd, type=("mesh", "locator", "constraint")): invalid.append(node) break return invalid
def get_invalid(cls, instance): if not plugins.depended_plugins_succeed(cls, instance): raise Exception("Depended plugin failed. See error log.") # Validate all controls has_connections = cls.get_invalid_connections(instance) has_unlocked_vis = cls.get_invalid_visibility(instance) has_non_default_values = cls.get_invalid_non_default_values(instance) if has_connections: cls.log.error("Controls have input connections: " "%s" % has_connections) if has_non_default_values: cls.log.error("Controls have non-default values: " "%s" % has_non_default_values) if has_unlocked_vis: cls.log.error("Controls have unlocked visibility " "attribute: %s" % has_unlocked_vis) invalid = [] if (has_connections or has_unlocked_vis or has_non_default_values): invalid = set() invalid.update(has_connections) invalid.update(has_non_default_values) invalid.update(has_unlocked_vis) invalid = list(invalid) cls.log.error("Invalid rig controllers. See log for details.") return invalid
def get_invalid(cls, instance): from maya import cmds invalid = list() if not plugins.depended_plugins_succeed(cls, instance): raise Exception("Depended plugin failed. See error log.") for out_set in instance.data["outSets"]: for node in cmds.ls(cmds.sets(out_set, query=True), type="transform"): shapes = cmds.listRelatives(node, shapes=True, path=True) if (len(shapes) == 1 and cmds.getAttr(shapes[0] + ".intermediateObject")): invalid.append(node) return invalid
def get_invalid(cls, instance): from maya import cmds from reveries.maya import lib invalid = list() if not depended_plugins_succeed(cls, instance): raise Exception("Depended plugin failed. See error log.") for mesh in cls.get_excluded_meshes(instance): node = cmds.listRelatives(mesh, parent=True, fullPath=True)[0] if lib.is_visible(node, displayLayer=False, intermediateObject=False): invalid.append(node) elif cmds.listConnections(node + ".visibility", source=True, destination=False, connections=False): invalid.append(node) return invalid