docstrings and cosmetics

This commit is contained in:
aardschok 2017-07-26 10:54:17 +02:00
parent a3e704e5bb
commit e9cf2e964b
4 changed files with 11 additions and 5 deletions

View file

@ -669,10 +669,10 @@ def get_reference_node(path):
""" """
Get the reference node when the path is found being used in a reference Get the reference node when the path is found being used in a reference
Args: Args:
path (str): path (str): the file path to check
Returns: Returns:
node (str): name of the reference node in question
""" """
node = cmds.file(path, query=True, referenceNode=True) node = cmds.file(path, query=True, referenceNode=True)
reference_path = cmds.referenceQuery(path, filename=True) reference_path = cmds.referenceQuery(path, filename=True)

View file

@ -24,6 +24,9 @@ def deferred():
from scriptsmenu import launchformaya from scriptsmenu import launchformaya
import scriptsmenu.scriptsmenu as menu import scriptsmenu.scriptsmenu as menu
reload(launchformaya)
reload(menu)
log.info("Attempting to install ...") log.info("Attempting to install ...")
# load configuration of custom menu # load configuration of custom menu

View file

@ -30,7 +30,7 @@ class LookLoader(api.Loader):
""" """
reference_node = None
# improve readability of the namespace # improve readability of the namespace
assetname = context["asset"]["name"] assetname = context["asset"]["name"]
@ -40,6 +40,9 @@ class LookLoader(api.Loader):
format="%03d", format="%03d",
suffix="_look") 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: try:
reference_node = lib.get_reference_node(self.fname) reference_node = lib.get_reference_node(self.fname)
except: except:

View file

@ -121,7 +121,7 @@ class CollectLook(pyblish.api.InstancePlugin):
"relationships": sets.values(), "relationships": sets.values(),
"sets": looksets} "sets": looksets}
# Collect textures # 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 instance.data["resources"] = resources
# Log a warning when no relevant sets were retrieved for the look. # Log a warning when no relevant sets were retrieved for the look.
@ -322,7 +322,7 @@ class CollectLook(pyblish.api.InstancePlugin):
return attributes 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) """Collect the link to the file(s) used (resource)
Args: Args:
node (str): name of the node node (str): name of the node