mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
integrate new uses anatomy's used_values
This commit is contained in:
parent
7bdb438522
commit
eacc1ff0be
1 changed files with 19 additions and 18 deletions
|
|
@ -80,6 +80,10 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
||||||
"assembly"
|
"assembly"
|
||||||
]
|
]
|
||||||
exclude_families = ["clip"]
|
exclude_families = ["clip"]
|
||||||
|
repre_context_stable_keys = [
|
||||||
|
"project", "asset", "task", "subset", "version", "representation",
|
||||||
|
"family", "hierarchy", "task", "username"
|
||||||
|
]
|
||||||
|
|
||||||
def process(self, instance):
|
def process(self, instance):
|
||||||
|
|
||||||
|
|
@ -288,7 +292,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
||||||
anatomy.templates[template_name]["path"])
|
anatomy.templates[template_name]["path"])
|
||||||
|
|
||||||
sequence_repre = isinstance(files, list)
|
sequence_repre = isinstance(files, list)
|
||||||
|
repre_context = None
|
||||||
if sequence_repre:
|
if sequence_repre:
|
||||||
src_collections, remainder = clique.assemble(files)
|
src_collections, remainder = clique.assemble(files)
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
|
|
@ -311,10 +315,12 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
||||||
template_data["representation"] = repre['ext']
|
template_data["representation"] = repre['ext']
|
||||||
template_data["frame"] = src_padding_exp % i
|
template_data["frame"] = src_padding_exp % i
|
||||||
anatomy_filled = anatomy.format(template_data)
|
anatomy_filled = anatomy.format(template_data)
|
||||||
|
template_filled = anatomy_filled[template_name]["path"]
|
||||||
|
if repre_context is None:
|
||||||
|
repre_context = template_filled.used_values
|
||||||
|
|
||||||
test_dest_files.append(
|
test_dest_files.append(
|
||||||
os.path.normpath(
|
os.path.normpath(template_filled)
|
||||||
anatomy_filled[template_name]["path"])
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
|
|
@ -394,14 +400,21 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
||||||
|
|
||||||
src = os.path.join(stagingdir, fname)
|
src = os.path.join(stagingdir, fname)
|
||||||
anatomy_filled = anatomy.format(template_data)
|
anatomy_filled = anatomy.format(template_data)
|
||||||
dst = os.path.normpath(
|
template_filled = anatomy_filled[template_name]["path"]
|
||||||
anatomy_filled[template_name]["path"]).replace("..", ".")
|
repre_context = template_filled.used_values
|
||||||
|
dst = os.path.normpath(template_filled).replace("..", ".")
|
||||||
|
|
||||||
instance.data["transfers"].append([src, dst])
|
instance.data["transfers"].append([src, dst])
|
||||||
|
|
||||||
repre['published_path'] = self.unc_convert(dst)
|
repre['published_path'] = self.unc_convert(dst)
|
||||||
self.log.debug("__ dst: {}".format(dst))
|
self.log.debug("__ dst: {}".format(dst))
|
||||||
|
|
||||||
|
for key in self.repre_context_stable_keys:
|
||||||
|
value = template_data.get(key)
|
||||||
|
if not value:
|
||||||
|
continue
|
||||||
|
repre_context[key] = template_data[key]
|
||||||
|
|
||||||
representation = {
|
representation = {
|
||||||
"_id": io.ObjectId(),
|
"_id": io.ObjectId(),
|
||||||
"schema": "pype:representation-2.0",
|
"schema": "pype:representation-2.0",
|
||||||
|
|
@ -413,19 +426,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
||||||
|
|
||||||
# Imprint shortcut to context
|
# Imprint shortcut to context
|
||||||
# for performance reasons.
|
# for performance reasons.
|
||||||
"context": {
|
"context": repre_context
|
||||||
"root": root,
|
|
||||||
"project": {"name": PROJECT,
|
|
||||||
"code": project['data']['code']},
|
|
||||||
'task': TASK,
|
|
||||||
"silo": asset.get('silo'),
|
|
||||||
"asset": ASSET,
|
|
||||||
"family": instance.data['family'],
|
|
||||||
"subset": subset["name"],
|
|
||||||
"version": version["name"],
|
|
||||||
"hierarchy": hierarchy,
|
|
||||||
"representation": repre['ext']
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if repre.get("outputName"):
|
if repre.get("outputName"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue