mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Fixed problem with the instance metadata
This commit is contained in:
parent
b54d832478
commit
4f882b9b19
2 changed files with 10 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ class UnrealHost(HostBase, ILoadHost, IPublishHost):
|
|||
if not os.path.isfile(op_ctx):
|
||||
return {}
|
||||
with open(op_ctx, "r") as fp:
|
||||
data = eval(json.load(fp))
|
||||
data = json.load(fp)
|
||||
return data
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import ast
|
||||
import collections
|
||||
import sys
|
||||
import six
|
||||
|
|
@ -89,7 +90,9 @@ class UnrealBaseCreator(Creator):
|
|||
obj = ar.get_asset_by_object_path(member).get_asset()
|
||||
assets.add(obj)
|
||||
|
||||
imprint(f"{self.root}/{instance_name}", instance_data)
|
||||
imprint(f"{self.root}/{instance_name}", instance.data_to_store())
|
||||
|
||||
return instance
|
||||
|
||||
except Exception as er:
|
||||
six.reraise(
|
||||
|
|
@ -102,6 +105,11 @@ class UnrealBaseCreator(Creator):
|
|||
self.cache_subsets(self.collection_shared_data)
|
||||
for instance in self.collection_shared_data[
|
||||
"unreal_cached_subsets"].get(self.identifier, []):
|
||||
# Unreal saves metadata as string, so we need to convert it back
|
||||
instance['creator_attributes'] = ast.literal_eval(
|
||||
instance.get('creator_attributes', '{}'))
|
||||
instance['publish_attributes'] = ast.literal_eval(
|
||||
instance.get('publish_attributes', '{}'))
|
||||
created_instance = CreatedInstance.from_existing(instance, self)
|
||||
self._add_instance_to_context(created_instance)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue