From d66c2123b60a07cd8d5943b8852074b48785eca5 Mon Sep 17 00:00:00 2001 From: aardschok Date: Thu, 30 Nov 2017 15:52:54 +0100 Subject: [PATCH 1/2] added attribute change uuid check --- .../plugins/maya/publish/validate_look_contents.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/colorbleed/plugins/maya/publish/validate_look_contents.py b/colorbleed/plugins/maya/publish/validate_look_contents.py index c6ea36f9be..5f47ea39cc 100644 --- a/colorbleed/plugins/maya/publish/validate_look_contents.py +++ b/colorbleed/plugins/maya/publish/validate_look_contents.py @@ -71,10 +71,18 @@ class ValidateLookContents(pyblish.api.InstancePlugin): # Validate at least one single relationship is collected if not lookdata["relationships"]: - cls.log.error("Look '{}' has no " - "`relationships`".format(instance.name)) + cls.log.error("Look '%s' has no " + "`relationships`" % instance.name) invalid.add(instance.name) + # Check if attributes are on a node with an ID, crucial for rebuild! + for attr_changes in lookdata["attributes"]: + if not attr_changes["uuid"]: + cls.log.error("Node '%s' has no cbId, please set the " + "attributes to its children if it has any" + % attr_changes["name"]) + invalid.add(instance.name) + return list(invalid) @classmethod From f77c82cd4ff4c1e8088885aaafa6343cf3ed243f Mon Sep 17 00:00:00 2001 From: Wijnand Koreman Date: Thu, 30 Nov 2017 22:39:47 +0100 Subject: [PATCH 2/2] Added creation of new cbId for transform node of Yeti node, explictly add transform node to list to add to container. --- .../plugins/maya/load/load_yeti_cache.py | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/colorbleed/plugins/maya/load/load_yeti_cache.py b/colorbleed/plugins/maya/load/load_yeti_cache.py index 0f58f1d735..31d0782f15 100644 --- a/colorbleed/plugins/maya/load/load_yeti_cache.py +++ b/colorbleed/plugins/maya/load/load_yeti_cache.py @@ -54,10 +54,24 @@ class YetiCacheLoader(api.Loader): yeti_node = cmds.createNode("pgYetiMaya", name=node_name) cmds.connectAttr("time1.outTime", "%s.currentTime" % yeti_node) + # Note: the shape is created, we will need to add a new ID for the + # transform node of the new Yeti node + shapenode_id = settings["cbId"] + asset_id = shapenode_id.split(":", 1)[0] + # Apply colorbleed ID to node - lib.set_id(node=yeti_node, - unique_id=settings["cbId"], - overwrite=True) + lib.set_id(node=yeti_node, unique_id=shapenode_id, overwrite=True) + + # Though singular the generate_ids function needs list and as + # the result is returned as a list we can take advantage of that + # Todo: (Wijnand) double check this behavior! + transform_nodes = cmds.listRelatives(yeti_node, parent=True) or [] + if not transform_nodes: + raise RuntimeError("Something went wrong during creation of" + "the pgYetiMaya node") + + lib.generate_ids(nodes=transform_nodes, asset_id=asset_id) + settings.pop("cbId", None) # Apply settings @@ -86,6 +100,7 @@ class YetiCacheLoader(api.Loader): cmds.setAttr("%s.verbosity" % yeti_node, 2) nodes.append(yeti_node) + nodes.extend(transform_nodes) group_name = "{}:{}".format(namespace, asset["name"]) group_node = cmds.group(nodes, name=group_name)