forked from Faraphel/Atlas-Install
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated scripts to create minimap and map image
- Loading branch information
Showing
13 changed files
with
45 additions
and
274 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Note : use this script from the ../scripts/ directory | ||
""" | ||
import glob | ||
import subprocess | ||
import os | ||
import shutil | ||
|
||
from source.wszst import szs | ||
from scripts import obj_to_png | ||
|
||
|
||
def get_track_minimap(directory: str, sha1: str): | ||
os.makedirs(tmp_dir := f"./scripts/tmp/{sha1}/", exist_ok=True) | ||
|
||
szs.extract(f"{directory}{sha1}.szs", tmp_dir + "track.szs") | ||
subprocess.run(["abmatt", "convert", tmp_dir + "track.szs.d/map_model.brres", "to", tmp_dir + "map_model.obj"]) | ||
|
||
try: img = obj_to_png.render_top_view(obj_file=tmp_dir + "map_model.obj") | ||
except Exception as e: | ||
print(e) | ||
return None | ||
finally: | ||
shutil.rmtree(tmp_dir, ignore_errors=True) | ||
|
||
return img | ||
|
||
|
||
directory = "./file/Track/" | ||
|
||
for track in glob.glob("*.szs", root_dir=directory): | ||
sha1 = track.replace(".szs", "") | ||
if (image := get_track_minimap(directory, sha1)) is not None: | ||
image.save(f"./scripts/minimap/{sha1}.png") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
discord.py | ||
pygame | ||
PyOpenGL | ||
pywavefront | ||
numpy | ||
|
||
selenium | ||
keyboard |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ | |
"./version", | ||
"./translation.json", | ||
|
||
"./assets", | ||
"./tools", | ||
"./source", | ||
|
||
sys.exec_prefix + "\\DLLs\\tcl86t.dll", | ||
sys.exec_prefix + "\\DLLs\\tk86t.dll", | ||
|
@@ -22,7 +22,6 @@ | |
"includes": ["tkinter", "requests", "PIL", "distutils"], | ||
"include_msvcr": True, | ||
"packages": ["tkinter", "distutils"], | ||
"excludes": ["source"], | ||
} | ||
} | ||
|
||
|
@@ -37,7 +36,7 @@ | |
license='Apache-2.0', | ||
author='Faraphel', | ||
author_email='[email protected]', | ||
description='Installateur pour Mario Kart Wii Faraphel.', | ||
description='Mario Kart Wii Mod Installer.', | ||
executables=[ | ||
Executable( | ||
"./main.pyw", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from source.wszst import bmg, ctc, img, lec, wstrt, szs, wit | ||
|
||
__all__ = ["bmg", "ctc", "img", "lec", "wstrt", "szs", "wit"] |