OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

[QUAD] Bug: Replace ast.literal_eval with json.loads to avoid crashes on Unreal

Open ccaillot opened this issue 1 year ago • 1 comments

ccaillot avatar Sep 11 '24 12:09 ccaillot

@ccaillot in the ayon-unreal, some attributes from instance data (and these are not dict value) are also converted. Have you tried the implementation below as json.loads would error out these attributes with the non-dict type value?

            instance['creator_attributes'] = json.loads(
                instance.get('creator_attributes', '{}'))
            instance['publish_attributes'] = json.loads(
                instance.get('publish_attributes', '{}'))
            instance['members'] = ast.literal_eval(
                instance.get('members', '[]'))
            instance['families'] = ast.literal_eval(
                instance.get('families', '[]'))
            instance['active'] = ast.literal_eval(
                instance.get('active', ''))

moonyuet avatar Sep 12 '24 04:09 moonyuet