mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
asset_entity check moved back since nukestudio instances may have not set value
This commit is contained in:
parent
6ef1a7e176
commit
1dcdac7ae0
1 changed files with 25 additions and 1 deletions
|
|
@ -102,13 +102,37 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
def register(self, instance):
|
||||
# Required environment variables
|
||||
anatomy_data = instance.data["anatomyData"]
|
||||
asset_entity = instance.data["assetEntity"]
|
||||
avalon_location = api.Session["AVALON_LOCATION"]
|
||||
|
||||
io.install()
|
||||
|
||||
context = instance.context
|
||||
|
||||
project_entity = instance.data["projectEntity"]
|
||||
|
||||
asset_name = instance.data["asset"]
|
||||
asset_entity = instance.data.get("assetEntity")
|
||||
if not asset_entity:
|
||||
asset_entity = io.find_one({
|
||||
"type": "asset",
|
||||
"name": asset_name,
|
||||
"parent": project_entity["_id"]
|
||||
})
|
||||
|
||||
assert asset_entity, (
|
||||
"No asset found by the name \"{0}\" in project \"{1}\""
|
||||
).format(asset_name, project_entity["name"])
|
||||
|
||||
instance.data["assetEntity"] = asset_entity
|
||||
|
||||
# update anatomy data with asset specific keys
|
||||
# - name should already been set
|
||||
hierarchy = ""
|
||||
parents = asset_entity["data"]["parents"]
|
||||
if parents:
|
||||
hierarchy = "/".join(parents)
|
||||
anatomy_data["hierarchy"] = hierarchy
|
||||
|
||||
stagingdir = instance.data.get("stagingDir")
|
||||
if not stagingdir:
|
||||
self.log.info((
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue