1900 textures processed in 40 minutes, worked like a charm! thanks again.
The only tricky part was realizing that the file path in the .bat was feeding noesis.getSelectedFile() and not the function arguments (I first tried to remove toolIndex, then adding another argument, but didn't work)
So, I just modified image swizzler like this
Code: Select all
#srcName = noesis.userPrompt(noesis.NOEUSERVAL_FILEPATH, "Open Image", "Select an image to swizzle.", noesis.getSelectedFile(), nswzValidateInput)
srcName = noesis.getSelectedFile()
#dstName = noesis.userPrompt(noesis.NOEUSERVAL_SAVEFILEPATH, "Save Image", "Select destination path for the swizzled image.", dstDefault, None)
dstName = dstDefault
In case someone needs it, I got all the normal textures in the game folder to create the .bat by copying the console output from this python script (this game has all normal textures with the suffix "_n").
Code: Select all
def readAllFiles(Folder,extension="",suffix=""):
"""
Returns a list of absolute filepaths on the folder and subfolders specified, filtering by extension and suffix (optional).
"""
import os
filepaths = []
for root, dirs, files in os.walk(Folder):
for n in files:
file= os.path.join(root,n)
f_extension = os.path.splitext(os.path.basename(file))[1]
f_suffix = os.path.splitext(os.path.basename(file))[0][-2:]
if extension == "" and suffix =="":
filepaths.append(file)
elif extension !="" and suffix =="" and f_extension == extension:
filepaths.append(file)
elif extension =="" and suffix !="" and f_suffix == suffix:
filepaths.append(file)
elif extension !="" and suffix !="" and f_suffix == suffix and f_extension == extension:
filepaths.append(file)
return filepaths
files = readAllFiles(r"D:\Game_Folder",".dds","_n")
#Could also write the .bat directly, this is for copying the console output to a .bat
for n in files:
print ('Noesis.exe ?runtool "&Normal swizzler Batch" "' + n + '"')
print (len(files))
Cheers
