Hi All ,
I have a main directory with a lot of sub-directories and I would like to load them all to my PhotoScan chunk with a python script, each sub-directory to new camera group ,
Iv got some script with create camera group but i have no Idea how to modify it to create new camera group for next sub-dir etc ...
doc = PhotoScan.app.document
chunk = doc.addChunk()
new_group = chunk.addCameraGroup()
# Ajout de photos -add photos 1st chunk
path_photos = PhotoScan.app.getExistingDirectory("main folder:")
image_list = os.listdir(path_photos)
photo_list = list()
for photo in image_list:
if photo.rsplit(".",1)[1].lower() in ["jpg", "jpeg", "tif", "tiff"]:
photo_list.append("/".join([path_photos, photo]))
chunk.addPhotos(photo_list)
print("- Photos ajoutées")
for camera in list(chunk.cameras):
camera.group = new_group
Did anybody can help pls ?