diff options
| author | yum <yum.food.vr@gmail.com> | 2023-09-01 00:51:32 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-09-01 00:51:32 -0700 |
| commit | 749854018ff279e3aadd60d89ac7354886d1630d (patch) | |
| tree | 20db682b52919f72fd138d8123ecb6b189bfeb16 /Scripts/remove_audio_sources.py | |
| parent | 833ef96f677a60197abb417651ac306820e225f0 (diff) | |
Check in app_config.py, remove_audio_source.py
Oops, I meant to check these in earlier!
Diffstat (limited to 'Scripts/remove_audio_sources.py')
| -rw-r--r-- | Scripts/remove_audio_sources.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Scripts/remove_audio_sources.py b/Scripts/remove_audio_sources.py new file mode 100644 index 0000000..0b4e566 --- /dev/null +++ b/Scripts/remove_audio_sources.py @@ -0,0 +1,20 @@ +import libunity +import sys + +def removeAudioSources(path: str): + parser = libunity.MulticoreUnityParser() + anim = parser.parseFile(path) + anchors = set() + node = anim.popNodeOfClass("82") + while node: + print("Killed audio source") + anchors.add(node.anchor) + node = anim.popNodeOfClass("82") + for node in anim.nodes: + anim.scrubReferencesByValue(node, values=anchors) + with open(path, "w", encoding="utf-8") as f: + f.write(libunity.unityYamlToString(anim.nodes)) + +if __name__ == "__main__": + removeAudioSources(sys.argv[1]) + |
