Skip to content

Commit

Permalink
Remove requirement of using Python 3.10 and below
Browse files Browse the repository at this point in the history
 - I added a 'legacy mode' flag to revert HearthSim/UnityPack#101 as it caused problems on Rei
 - I tested the new setup (using custom unitypack) vs old one, and the output .asset files were bit-for-bit identical
  • Loading branch information
drojf committed Jan 25, 2024
1 parent bb2ac64 commit 33d24e3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions build.py
Expand Up @@ -274,9 +274,6 @@ def save(self):
print(">>>> ERROR: This script does not work on Python 2.7")
exit(-1)

if not (sys.version_info < (3, 11)):
print(">>>> WARNING: This script probably does not work on Python 3.11 because unitypack uses old version of decrunch which does not build. Use Python 3.10 or below if you have this error.")

Globals.SEVEN_ZIP_EXECUTABLE = findWorkingExecutablePath(["7za", "7z"], ['-h'])
if Globals.SEVEN_ZIP_EXECUTABLE is None:
print(">>>> ERROR: Can't find 7zip as '7z' or '7za'")
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
@@ -1,3 +1,4 @@
numpy
Pillow
unitypack
unitypack @ git+https://github.com/drojf/UnityPack@master # custom build of unitypack which does not require 'decrunch'
setuptools # required for unitypack or else get `pkg_resources` error
2 changes: 1 addition & 1 deletion scripts/EMIPGenerator.py
Expand Up @@ -185,7 +185,7 @@ def generateHeader(numEdits):
bundle = assetsFile.read()
unityVersion = [int(x) for x in bundle[20:28].decode("utf-8").rstrip("\0").split(".")[:2]]
assetsFile.seek(0)
assets = Asset.from_file(assetsFile)
assets = Asset.from_file(assetsFile, legacy_mode=True)
for edit in edits:
edit.getAssetInfo(assets, bundle)
edits = [x for x in edits if x.id != None]
Expand Down
2 changes: 1 addition & 1 deletion scripts/UnityTextModifier.py
Expand Up @@ -133,7 +133,7 @@ def __str__(self):
edits = newEdits

assetsFile.seek(0)
assets = Asset.from_file(assetsFile)
assets = Asset.from_file(assetsFile, legacy_mode=True)
for id, obj in assets.objects.items():
for edit in edits:
edit.checkObject(id, obj, bundle)
Expand Down

0 comments on commit 33d24e3

Please sign in to comment.