From ac69366dccaf377d20f029b4b58bac2314f61159 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 20 Dec 2022 18:21:59 -0800 Subject: Bugfix: animators may now include Unicode characters Completed first end-to-end test on a third party avatar :) --- Scripts/libunity.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Scripts/libunity.py') diff --git a/Scripts/libunity.py b/Scripts/libunity.py index 0c5228a..9ab0f19 100644 --- a/Scripts/libunity.py +++ b/Scripts/libunity.py @@ -1145,7 +1145,7 @@ class UnityParser: class MulticoreUnityParser: def parseFile(self, yaml_file): yaml_str = "" - with open(yaml_file, "r") as f: + with open(yaml_file, "r", encoding="utf-8") as f: yaml_str = f.read() return self.parse(yaml_str) @@ -1211,7 +1211,7 @@ class MulticoreUnityParser: def parseFile(self, yaml_file): yaml_str = "" - with open(yaml_file, "r") as f: + with open(yaml_file, "r", encoding="utf-8") as f: yaml_str = f.read() return self.parse(yaml_str) @@ -1225,7 +1225,7 @@ def getGuidMap(d): continue suffix = ".meta" if path.endswith(suffix): - with open(path, "r") as f: + with open(path, "r", encoding="utf-8") as f: for line in f: if line.startswith("guid"): guid = line.split()[1] @@ -1271,7 +1271,7 @@ if __name__ == "__main__": anim0.merge(anim1) print("Serializing to {}".format(args.fx_dest), file=sys.stderr) - with open(args.fx_dest, "w") as f: + with open(args.fx_dest, "w", encoding="utf-8") as f: f.write(unityYamlToString(anim0.nodes)) elif args.cmd == "guid_map": @@ -1355,7 +1355,7 @@ if __name__ == "__main__": guid_map) print("Serializing to {}".format(args.fx_dest), file=sys.stderr) - with open(args.fx_dest, "w") as f: + with open(args.fx_dest, "w", encoding="utf-8") as f: f.write(str(anim)) with open(args.guid_map, 'wb') as f: @@ -1388,7 +1388,7 @@ if __name__ == "__main__": anim.setNoopAnimations(guid_map, args.gen_anim_dir + "/TaSTT_Do_Nothing.anim") - with open(args.fx_dest, "w") as f: + with open(args.fx_dest, "w", encoding="utf-8") as f: f.write(str(anim)) else: -- cgit v1.2.3