diff --git a/colorbleed/maya/lib.py b/colorbleed/maya/lib.py index 9583cce86b..e14381a5ff 100644 --- a/colorbleed/maya/lib.py +++ b/colorbleed/maya/lib.py @@ -865,7 +865,8 @@ def apply_shaders(relationships, shadernodes, nodes): Args: relationships (dict): relationship data - shadernodes (list): list of nodes of the shading engine + shadernodes (list): list of nodes of the shading objectSets (includes + VRayObjectProperties and shadingEngines) nodes (list): list of nodes to apply shader to Returns: @@ -875,7 +876,7 @@ def apply_shaders(relationships, shadernodes, nodes): attributes = relationships.get("attributes", []) shader_sets = relationships.get("sets", []) - shading_engines = cmds.ls(shadernodes, type="shadingEngine", long=True) + shading_engines = cmds.ls(shadernodes, type="objectSet", long=True) assert len(shading_engines) > 0, ("Error in retrieving shading engines " "from reference") @@ -901,7 +902,7 @@ def apply_shaders(relationships, shadernodes, nodes): shading_engine = shading_engines_by_id[shader_uuid] assert len(shading_engine) == 1, ("Could not find the correct " - "shading engine with cbId " + "objectSet with cbId " "'{}'".format(shader_uuid)) cmds.sets(filtered_nodes, forceElement=shading_engine[0]) diff --git a/colorbleed/plugins/maya/publish/collect_look.py b/colorbleed/plugins/maya/publish/collect_look.py index 4b1a16b194..8f5ff22897 100644 --- a/colorbleed/plugins/maya/publish/collect_look.py +++ b/colorbleed/plugins/maya/publish/collect_look.py @@ -115,6 +115,8 @@ class CollectLook(pyblish.api.InstancePlugin): attributes = self.collect_attributes_changed(instance) looksets = cmds.ls(sets.keys(), absoluteName=True, long=True) + self.log.info("Found the following sets: {}".format(looksets)) + # Store data on the instance instance.data["lookData"] = {"attributes": attributes, "relationships": sets.values(), @@ -124,7 +126,7 @@ class CollectLook(pyblish.api.InstancePlugin): history = cmds.listHistory(looksets) files = cmds.ls(history, type="file", long=True) - # Collect textures, + # Collect textures resources = [self.collect_resource(n) for n in files] instance.data["resources"] = resources @@ -318,11 +320,9 @@ class CollectLook(pyblish.api.InstancePlugin): attribute = "{}.{}".format(node, attr) node_attributes[attr] = cmds.getAttr(attribute) - data = {"name": node, - "uuid": id_utils.get_id(node), - "attributes": node_attributes} - - attributes.append(data) + attributes.append({"name": node, + "uuid": id_utils.get_id(node), + "attributes": node_attributes}) return attributes