mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
the resourceDir for texture also supports without image search path
This commit is contained in:
parent
889f86457d
commit
af87fdf657
2 changed files with 23 additions and 22 deletions
|
|
@ -124,19 +124,19 @@ class CollectYetiRig(pyblish.api.InstancePlugin):
|
|||
image_search_paths = [p for p in
|
||||
image_search_paths.split(os.path.pathsep) if p]
|
||||
|
||||
# find all ${TOKEN} tokens and replace them with $TOKEN env. variable
|
||||
image_search_paths = self._replace_tokens(image_search_paths)
|
||||
# find all ${TOKEN} tokens and replace them with $TOKEN env. variable
|
||||
image_search_paths = self._replace_tokens(image_search_paths)
|
||||
|
||||
# List all related textures
|
||||
texture_nodes = cmds.pgYetiGraph(
|
||||
node, listNodes=True, type="texture")
|
||||
texture_filenames = [
|
||||
cmds.pgYetiGraph(
|
||||
node, node=texture_node,
|
||||
param="file_name", getParamValue=True)
|
||||
for texture_node in texture_nodes
|
||||
]
|
||||
self.log.debug("Found %i texture(s)" % len(texture_filenames))
|
||||
# List all related textures
|
||||
texture_nodes = cmds.pgYetiGraph(
|
||||
node, listNodes=True, type="texture")
|
||||
texture_filenames = [
|
||||
cmds.pgYetiGraph(
|
||||
node, node=texture_node,
|
||||
param="file_name", getParamValue=True)
|
||||
for texture_node in texture_nodes
|
||||
]
|
||||
self.log.debug("Found %i texture(s)" % len(texture_filenames))
|
||||
|
||||
# Get all reference nodes
|
||||
reference_nodes = cmds.pgYetiGraph(node,
|
||||
|
|
@ -144,11 +144,6 @@ class CollectYetiRig(pyblish.api.InstancePlugin):
|
|||
type="reference")
|
||||
self.log.debug("Found %i reference node(s)" % len(reference_nodes))
|
||||
|
||||
if texture_filenames and not image_search_paths:
|
||||
raise ValueError("pgYetiMaya node '%s' is missing the path to the "
|
||||
"files in the 'imageSearchPath "
|
||||
"atttribute'" % node)
|
||||
|
||||
# Collect all texture files
|
||||
# find all ${TOKEN} tokens and replace them with $TOKEN env. variable
|
||||
texture_filenames = self._replace_tokens(texture_filenames)
|
||||
|
|
|
|||
|
|
@ -142,12 +142,18 @@ class ExtractYetiRig(publish.Extractor):
|
|||
instance.data['transfers'] = []
|
||||
|
||||
for resource in instance.data.get('resources', []):
|
||||
for file in resource['files']:
|
||||
src = file
|
||||
dst = os.path.join(image_search_path, os.path.basename(file))
|
||||
instance.data['transfers'].append([src, dst])
|
||||
if resource["files"]:
|
||||
for file in resource['files']:
|
||||
src = file
|
||||
dst = os.path.join(image_search_path, os.path.basename(file))
|
||||
instance.data['transfers'].append([src, dst])
|
||||
else:
|
||||
for file in resource['source']:
|
||||
src = file if os.path.isabs(file) else os.path.abspath(file)
|
||||
dst = os.path.join(image_search_path, os.path.basename(file))
|
||||
instance.data['transfers'].append([src, dst])
|
||||
|
||||
self.log.debug("adding transfer {} -> {}". format(src, dst))
|
||||
self.log.debug("adding transfer {} -> {}". format(src, dst))
|
||||
|
||||
# Ensure the imageSearchPath is being remapped to the publish folder
|
||||
attr_value = {"%s.imageSearchPath" % n: str(image_search_path) for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue