From bb2c97d177c35795c8c1f52f3eafce9aa64b1250 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 12 Sep 2024 12:16:34 +0800 Subject: [PATCH] ported from openpype --- client/ayon_unreal/api/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/ayon_unreal/api/plugin.py b/client/ayon_unreal/api/plugin.py index 6d50b69f..b7724d4a 100644 --- a/client/ayon_unreal/api/plugin.py +++ b/client/ayon_unreal/api/plugin.py @@ -3,6 +3,7 @@ import collections import sys import six +import json from abc import ( ABC, ABCMeta, @@ -77,9 +78,9 @@ def _default_collect_instances(self): 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['creator_attributes'] = json.loads( instance.get('creator_attributes', '{}')) - instance['publish_attributes'] = ast.literal_eval( + instance['publish_attributes'] = json.loads( instance.get('publish_attributes', '{}')) instance['members'] = ast.literal_eval( instance.get('members', '[]'))