mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Only collect resource files from instance collection
This commit is contained in:
parent
cbbb3dc804
commit
2a748047ed
1 changed files with 18 additions and 7 deletions
|
|
@ -124,15 +124,26 @@ class ExtractXgenCache(publish.Extractor):
|
|||
|
||||
cmds.delete(duplicate_nodes + [collection])
|
||||
|
||||
# Setup transfers.
|
||||
xgen_dir = os.path.join(
|
||||
os.path.dirname(instance.context.data["currentFile"]), "xgen"
|
||||
# Collect all files under palette root as resources.
|
||||
data_path = xgenm.getAttr(
|
||||
"xgDataPath", instance.data["xgenPalette"].replace("|", "")
|
||||
).split(os.pathsep)[0]
|
||||
data_path = data_path.replace(
|
||||
"${PROJECT}",
|
||||
xgenm.getAttr(
|
||||
"xgProjectPath", instance.data["xgenPalette"].replace("|", "")
|
||||
)
|
||||
)
|
||||
transfers = []
|
||||
for root, _, files in os.walk(xgen_dir):
|
||||
for root, _, files in os.walk(data_path):
|
||||
for file in files:
|
||||
source = os.path.join(root, file)
|
||||
destination = os.path.join(instance.data["resourcesDir"], file)
|
||||
transfers.append((source, destination))
|
||||
source = os.path.join(root, file).replace("\\", "/")
|
||||
destination = os.path.join(
|
||||
instance.data["resourcesDir"],
|
||||
"collections",
|
||||
os.path.basename(data_path),
|
||||
source.replace(data_path, "")[1:]
|
||||
)
|
||||
transfers.append((source, destination.replace("\\", "/")))
|
||||
|
||||
instance.data["transfers"] = transfers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue