Tweak logging for attribute validation check + clean-up splitting logic

This commit is contained in:
Roy Nieterau 2022-09-09 14:09:38 +02:00
parent 056a237c84
commit 1dee7ceb64

View file

@ -257,14 +257,18 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
# go through definitions and test if such node.attribute exists.
# if so, compare its value from the one required.
for attr, value in OrderedDict(validation_settings).items():
# first get node of that type
cls.log.debug("{}: {}".format(attr, value))
node_type = attr.split(".")[0]
attribute_name = ".".join(attr.split(".")[1:])
if "." not in attr:
cls.log.warning("Skipping invalid attribute defined in "
"validation settings: '{}'".format(attr))
node_type, attribute_name = attr.split(".", 1)
# first get node of that type
nodes = cmds.ls(type=node_type)
if not isinstance(nodes, list):
cls.log.warning("No nodes of '{}' found.".format(node_type))
if not nodes:
cls.log.info("No nodes of type '{}' found.".format(node_type))
continue
for node in nodes: