Hello matt07lx,
Please check the following script example:
import Metashape, os, glob
path = Metashape.app.getExistingDirectory("Please choose the folder with .psz files:")
print("Script started...")
doc = Metashape.app.document
doc.clear()
TYPE = ".PSZ"
project_list = [file for file in glob.iglob(path + "/**/*.*" , recursive = True) if (file.upper().endswith(TYPE) and os.path.isfile(file))]
for project_name in project_list:
doc.open(project_name)
chunk = doc.chunks[0]
chunk.matchPhotos(accuracy = "high", preselection = "generic", point_limit = 40000)
chunk.alignPhotos()
chunk.buildDenseCloud(quality = "medium", filter = "aggressive", gpu_mask = 1, cpu_cores_inactive = 0)
chunk.buildModel(surface = "arbitrary", source = "dense", interpolation = "enabled", faces = "high")
doc.save()
print("Processed project: " + project_name)
print("Script finished.")