Hello i need a code/script allowing me to export automaticaly the generated model/mesh as obj with JPG (or TIF) texture. Im not a scripter but i found this script that allows a lot of batch process i didnt try it yet but i believe it should work:
import PhotoScan, os
path = PhotoScan.app.getExistingDirectory("Please choose the folder with .psz files:")
print("Script started")
doc = PhotoScan.app.document
doc.clear()
project_list = os.listdir(path)
for project_name in project_list:
if ".PSZ" in project_name.upper():
doc.open(path + "/" + project_name)
chunk = doc.chunks[0]
chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy, preselection=PhotoScan.GenericPreselection)
chunk.alignCameras()
chunk.buildDenseCloud(quality=PhotoScan.HighQuality)
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation)
chunk.buildUV(mapping=PhotoScan.GenericMapping)
chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)
doc.save()
print("Processed project: " + project_name)
else:
continue
print("Script finished.")
Could someone write additional line that after saving the file, it will also export the mesh as obj with generated texture (tif) for each *.psz file (with the same name as the file (or some unique name).
Is this possible?
Thank you a lot :-)!