Created
April 11, 2020 13:04
-
-
Save minexew/480984467fa374335581b6d833fb3817 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import os | |
for f in sorted(os.listdir("AllModel")): | |
if f.endswith(".mtl"): | |
with open(f"AllModel/{f}", "rt") as file: | |
for line in file: | |
if line.startswith("\tmap_Kd "): | |
texture = line.rstrip()[-6:] | |
print(f"INSERT INTO \"model_texture\" VALUES('Stalker','{f.replace('mtl', 'mbac')}','{texture}');") | |
break | |
else: | |
raise Exception(f"WTF {f}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment