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
|
||||
|
@ -1,8 +1,7 @@
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
function(tool_texture target)
|
||||
function(tool_texture target file)
|
||||
# Defaults
|
||||
set(FILE "" )
|
||||
set(FILTER_MIN "")
|
||||
set(FILTER_MAG "")
|
||||
set(WRAP_X "")
|
||||
@ -23,13 +22,13 @@ function(tool_texture target)
|
||||
endforeach()
|
||||
|
||||
# Check for missing args
|
||||
if(NOT DEFINED FILE)
|
||||
if(NOT DEFINED file)
|
||||
message(FATAL_ERROR "Missing FILE input")
|
||||
endif()
|
||||
|
||||
add_custom_target(${target}_texture
|
||||
COMMAND ${DAWN_TOOLS_DIR}/texturetool/texturetool.py
|
||||
--input="${DAWN_ASSETS_SOURCE_DIR}/${FILE}"
|
||||
--input="${DAWN_ASSETS_SOURCE_DIR}/${file}"
|
||||
--output="${DAWN_ASSETS_BUILD_DIR}/${target}.texture"
|
||||
--wrap-x="${WRAP_X}"
|
||||
--wrap-y="${WRAP_Y}"
|
||||
|
Reference in New Issue
Block a user