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
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)

View file

@ -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

View file

@ -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:

View file

@ -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