diff --git a/colorbleed/maya/lib.py b/colorbleed/maya/lib.py index 686a08c6fe..a2715863ee 100644 --- a/colorbleed/maya/lib.py +++ b/colorbleed/maya/lib.py @@ -669,10 +669,10 @@ def get_reference_node(path): """ Get the reference node when the path is found being used in a reference Args: - path (str): + path (str): the file path to check Returns: - + node (str): name of the reference node in question """ node = cmds.file(path, query=True, referenceNode=True) reference_path = cmds.referenceQuery(path, filename=True) diff --git a/colorbleed/maya/menu.py b/colorbleed/maya/menu.py index 4b09f87f1b..003c303097 100644 --- a/colorbleed/maya/menu.py +++ b/colorbleed/maya/menu.py @@ -24,6 +24,9 @@ def deferred(): from scriptsmenu import launchformaya import scriptsmenu.scriptsmenu as menu + reload(launchformaya) + reload(menu) + log.info("Attempting to install ...") # load configuration of custom menu diff --git a/colorbleed/plugins/maya/load/load_look.py b/colorbleed/plugins/maya/load/load_look.py index 9dffb3c550..557d18a3c2 100644 --- a/colorbleed/plugins/maya/load/load_look.py +++ b/colorbleed/plugins/maya/load/load_look.py @@ -30,7 +30,7 @@ class LookLoader(api.Loader): """ - reference_node = None + # improve readability of the namespace assetname = context["asset"]["name"] @@ -40,6 +40,9 @@ class LookLoader(api.Loader): format="%03d", suffix="_look") + # try / except here is to ensure that the get_reference_node + # does not fail when the file doesn't exist yet + reference_node = None try: reference_node = lib.get_reference_node(self.fname) except: diff --git a/colorbleed/plugins/maya/publish/collect_look.py b/colorbleed/plugins/maya/publish/collect_look.py index eff9c29f55..8511914313 100644 --- a/colorbleed/plugins/maya/publish/collect_look.py +++ b/colorbleed/plugins/maya/publish/collect_look.py @@ -121,7 +121,7 @@ class CollectLook(pyblish.api.InstancePlugin): "relationships": sets.values(), "sets": looksets} # Collect textures - resources = [self.collect_resources(n) for n in cmds.ls(type="file")] + resources = [self.collect_resource(n) for n in cmds.ls(type="file")] instance.data["resources"] = resources # Log a warning when no relevant sets were retrieved for the look. @@ -322,7 +322,7 @@ class CollectLook(pyblish.api.InstancePlugin): return attributes - def collect_resources(self, node, verbose=False): + def collect_resource(self, node, verbose=False): """Collect the link to the file(s) used (resource) Args: node (str): name of the node