mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merged in hotfix/assum-dest-ftrack-hierarchy (pull request #345)
Hotfix/assum dest ftrack hierarchy Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
d40ba5ebbd
2 changed files with 13 additions and 7 deletions
|
|
@ -44,7 +44,15 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin):
|
||||||
|
|
||||||
input_data = context.data["hierarchyContext"]
|
input_data = context.data["hierarchyContext"]
|
||||||
|
|
||||||
self.import_to_ftrack(input_data)
|
# self.import_to_ftrack(input_data)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.import_to_ftrack(input_data)
|
||||||
|
except Exception as exc:
|
||||||
|
import sys
|
||||||
|
import traceback
|
||||||
|
self.log.info(traceback.format_exc(sys.exc_info()))
|
||||||
|
raise Exception("failed")
|
||||||
|
|
||||||
def import_to_ftrack(self, input_data, parent=None):
|
def import_to_ftrack(self, input_data, parent=None):
|
||||||
for entity_name in input_data:
|
for entity_name in input_data:
|
||||||
|
|
@ -66,9 +74,9 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin):
|
||||||
|
|
||||||
# try to find if entity already exists
|
# try to find if entity already exists
|
||||||
else:
|
else:
|
||||||
query = '{} where name is "{}" and parent_id is "{}"'.format(
|
query = 'TypedContext where name is "{0}" and project.full_name is "{1}"'.format(
|
||||||
entity_type, entity_name, parent['id']
|
entity_name, self.ft_project["full_name"]
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
entity = self.session.query(query).one()
|
entity = self.session.query(query).one()
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ class IntegrateAssumedDestination(pyblish.api.InstancePlugin):
|
||||||
"""Create a filepath based on the current data available
|
"""Create a filepath based on the current data available
|
||||||
|
|
||||||
Example template:
|
Example template:
|
||||||
{root}/{project}/{silo}/{asset}/publish/{subset}/v{version:0>3}/
|
{root}/{project}/{asset}/publish/{subset}/v{version:0>3}/
|
||||||
{subset}.{representation}
|
{subset}.{representation}
|
||||||
Args:
|
Args:
|
||||||
instance: the instance to publish
|
instance: the instance to publish
|
||||||
|
|
@ -95,7 +95,6 @@ class IntegrateAssumedDestination(pyblish.api.InstancePlugin):
|
||||||
|
|
||||||
assert asset, ("No asset found by the name '{}' "
|
assert asset, ("No asset found by the name '{}' "
|
||||||
"in project '{}'".format(asset_name, project_name))
|
"in project '{}'".format(asset_name, project_name))
|
||||||
silo = asset['silo']
|
|
||||||
|
|
||||||
subset = io.find_one({"type": "subset",
|
subset = io.find_one({"type": "subset",
|
||||||
"name": subset_name,
|
"name": subset_name,
|
||||||
|
|
@ -126,7 +125,6 @@ class IntegrateAssumedDestination(pyblish.api.InstancePlugin):
|
||||||
template_data = {"root": api.Session["AVALON_PROJECTS"],
|
template_data = {"root": api.Session["AVALON_PROJECTS"],
|
||||||
"project": {"name": project_name,
|
"project": {"name": project_name,
|
||||||
"code": project['data']['code']},
|
"code": project['data']['code']},
|
||||||
"silo": silo,
|
|
||||||
"family": instance.data['family'],
|
"family": instance.data['family'],
|
||||||
"asset": asset_name,
|
"asset": asset_name,
|
||||||
"subset": subset_name,
|
"subset": subset_name,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue