mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #191 from tokejepsen/feature/integrate_additional_metadata
Enable additional metadata on representations
This commit is contained in:
commit
32355c74dc
1 changed files with 9 additions and 5 deletions
|
|
@ -9,7 +9,7 @@ import six
|
|||
|
||||
from pymongo import DeleteOne, InsertOne
|
||||
import pyblish.api
|
||||
from avalon import api, io
|
||||
from avalon import io
|
||||
from avalon.vendor import filelink
|
||||
|
||||
# this is needed until speedcopy for linux is fixed
|
||||
|
|
@ -44,6 +44,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
"frameStart"
|
||||
"frameEnd"
|
||||
'fps'
|
||||
"data": additional metadata for each representation.
|
||||
"""
|
||||
|
||||
label = "Integrate Asset New"
|
||||
|
|
@ -376,9 +377,10 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
index_frame_start += 1
|
||||
|
||||
dst = "{0}{1}{2}".format(
|
||||
dst_head,
|
||||
dst_padding,
|
||||
dst_tail).replace("..", ".")
|
||||
dst_head,
|
||||
dst_padding,
|
||||
dst_tail
|
||||
).replace("..", ".")
|
||||
|
||||
self.log.debug("destination: `{}`".format(dst))
|
||||
src = os.path.join(stagingdir, src_file_name)
|
||||
|
|
@ -451,13 +453,15 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
if repre_id is None:
|
||||
repre_id = io.ObjectId()
|
||||
|
||||
data = repre.get("data") or {}
|
||||
data.update({'path': dst, 'template': template})
|
||||
representation = {
|
||||
"_id": repre_id,
|
||||
"schema": "pype:representation-2.0",
|
||||
"type": "representation",
|
||||
"parent": version_id,
|
||||
"name": repre['name'],
|
||||
"data": {'path': dst, 'template': template},
|
||||
"data": data,
|
||||
"dependencies": instance.data.get("dependencies", "").split(),
|
||||
|
||||
# Imprint shortcut to context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue