Hey,
i just want to write a script which iterates through a given folder an all subfolders, opens psx files, export the model and then delete the psx files.
The following script always end in an Runtime Error:
import PhotoScan
import os
#def psx_to_obj_converter():
doc = PhotoScan.app.document
path = PhotoScan.app.getExistingDirectory("Bitte wählen Sie den Zielordner mit den *.psx Projekten in Ordner und Unterordnern")
for root, dirs, files in os.walk(path):
for filename in files:
if ".PSX" in filename.upper():
doc.open(os.path.join(root, filename))
chunk = doc.chunk
chunk.exportModel(root, binary = False, precision = 6, texture_format = PhotoScan.ImageFormatJPEG, texture = True, normals = False, colors = False, cameras = False, udim = False, strip_extensions = False, format = PhotoScan.ModelFormatOBJ, projection = PhotoScan.CoordinateSystem("EPSG::31467"))
#os.remove(path + "/" + filename)
The following error occures every time i tested it:
2017-10-05 13:49:16 File "C:/Users/ArchaeoBW/AppData/Local/Agisoft/PhotoScan Pro/scripts/psx to obj converter.py", line 13, in <module>
2017-10-05 13:49:16 chunk.exportModel(path, binary = False, precision = 6, texture_format = PhotoScan.ImageFormatJPEG, texture = True, normals = False, colors = False, cameras = False, udim = False, strip_extensions = False, format = PhotoScan.ModelFormatOBJ, projection = PhotoScan.CoordinateSystem("EPSG::31467"))
2017-10-05 13:49:16 RuntimeError: Can't create file: Permission denied (13): P:/2017_Maßnahmen/2017_258_Ludwigsburg_Schlosstr_29_31_Schmiedgaessle_5/Vermessung/Drone_3D
Thanks for your help!