Example scene loading
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user