summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--GUI/GUI/GUI/PythonWrapper.cpp13
-rw-r--r--Scripts/generate_shader.py6
-rw-r--r--Scripts/libunity.py10
3 files changed, 7 insertions, 22 deletions
diff --git a/GUI/GUI/GUI/PythonWrapper.cpp b/GUI/GUI/GUI/PythonWrapper.cpp
index 1f6f3dc..9c4fd85 100644
--- a/GUI/GUI/GUI/PythonWrapper.cpp
+++ b/GUI/GUI/GUI/PythonWrapper.cpp
@@ -753,19 +753,6 @@ bool PythonWrapper::GenerateAnimator(
return false;
}
}
-#if 0
- {
- Log(out, "Adding enable/disable toggle... ");
- if (!InvokeWithArgs({ libunity_path, "add_toggle",
- "--fx0", Quote(tastt_fx0_path),
- "--fx_dest", Quote(tastt_fx1_path),
- "--gen_anim_dir", Quote(tastt_animations_path),
- "--guid_map", Quote(guid_map_path), },
- "Failed to add enable/disable toggle", out)) {
- return false;
- }
- }
-#endif
{
Log(out, "Merging with user animator... ");
if (!InvokeWithArgs({ libunity_path, "merge",
diff --git a/Scripts/generate_shader.py b/Scripts/generate_shader.py
index 2348141..80f6704 100644
--- a/Scripts/generate_shader.py
+++ b/Scripts/generate_shader.py
@@ -100,7 +100,7 @@ def generateLetterAccessor(nbytes: int, nrows: int, ncols: int, prefix: str = ""
def applyLineMacro(old_path: str, new_path: str, macro: str, replacement: str) -> bool:
new_lines = []
times_applied = 0
- with open(old_path, 'r') as f:
+ with open(old_path, 'r', encoding="utf-8") as f:
for line in f:
if line[-1] == '\n':
line = line[0:len(line)-1]
@@ -109,13 +109,11 @@ def applyLineMacro(old_path: str, new_path: str, macro: str, replacement: str) -
times_applied += 1
else:
new_lines.append(line)
- with open(new_path, 'w') as f:
+ with open(new_path, 'w', encoding="utf-8") as f:
f.write('\n'.join(new_lines))
return times_applied
if __name__ == "__main__":
- sys.stdout.reconfigure(encoding="utf-8")
-
print("args: {}".format(" ".join(sys.argv)))
parser = argparse.ArgumentParser()
diff --git a/Scripts/libunity.py b/Scripts/libunity.py
index 3fd1011..9168057 100644
--- a/Scripts/libunity.py
+++ b/Scripts/libunity.py
@@ -223,7 +223,7 @@ class Metadata:
path = path + ".meta"
self.guid = None
- with open(path, "r") as f:
+ with open(path, "r", encoding="utf-8") as f:
for line in f:
if line.startswith("guid"):
self.guid = line.split()[1]
@@ -239,7 +239,7 @@ class Metadata:
self.persist(path, guid_map)
def persist(self, path, guid_map):
- with open(path, "w") as f:
+ with open(path, "w", encoding="utf-8") as f:
f.write(str(self))
guid_map[self.guid] = path
@@ -856,11 +856,11 @@ class UnityAnimator():
new_anim_path = "OFF_{}".format(os.path.basename(animation_path))
new_anim_path = "{}/{}".format(generated_anim_dir, new_anim_path)
- with open(new_anim_path, "w") as f:
+ with open(new_anim_path, "w", encoding="utf-8") as f:
f.write(str(anim))
meta = Metadata()
- with open(new_anim_path + ".meta", "w") as f:
+ with open(new_anim_path + ".meta", "w", encoding="utf-8") as f:
f.write(str(meta))
def generateOffAnimationsAnimStates(self, guid_map, generated_anim_dir):
@@ -1086,7 +1086,7 @@ class UnityParser:
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)