mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
docstrings and cosmetics
This commit is contained in:
parent
a3e704e5bb
commit
e9cf2e964b
4 changed files with 11 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue