Example scene loading

This commit is contained in:
2024-12-02 14:53:41 -06:00
parent ac0f0e86c5
commit 2af55041c8
48 changed files with 698 additions and 38 deletions

View File

@ -27,8 +27,9 @@ if not os.path.exists(os.path.dirname(args.output)):
filesInArchive = []
if os.path.exists(args.output) and False:
# if os.path.exists(args.output):
# Yes, open it
archive = tarfile.open(args.output, 'r:')
archive = tarfile.open(args.output, 'a:')
# Get all the files in the archive
for member in archive.getmembers():
@ -51,11 +52,16 @@ for foldername, subfolders, filenames in os.walk(args.input):
relative_path = os.path.relpath(absolute_path, args.input)
if relative_path in filesInArchive:
# Yes, skip it
continue
# No, add it
print(f"Archiving asset {filename}...")
if relative_path.endswith('.texture'):
print(f"Skipping {filename}...")
continue
else:
print(f"Overwriting {filename}...")
# Does not work in python, throw error
exit (1)
else:
print(f"Archiving asset {filename}...")
archive.add(absolute_path, arcname=relative_path)
# Close the archive