Agisoft Metashape
Agisoft Metashape => General => Topic started by: mwillis on January 08, 2019, 06:30:47 AM
-
Hi, I am hoping someone can point me in the right direction. I have a text file with a large number of photos that I would like to add to a new project. The images are scattered across several partitions and for reasons that are complicated, I need to leave the images in their current directors.
Is there a way to automatically add files from a text file with the following syntax?
I:\Projects\Marsoulas\D31-D42.5\Wall_Base_Gilles\D37-39_Mos releve 2018Willis.jpg
I:\Projects\Marsoulas\D31-D42.5\Wall_Base_Gilles\D37_38_Connector releve 2018Willis.jpg
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8246.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8003.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8004.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8005.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8006.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8007.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8008.JPG
G:\Projects\Marsoulas\2014\Photos\Right\D33-39\9M7A8009.JPG
... files continue for hundreds of lines
Thanks for any help you can share.
Mark
-
Hello Mark,
You can do it with the Python script:
import PhotoScan
path = PhotoScan.app.getOpenFileName("Specify the location of the text file with the paths:")
file = open(path, "rt")
lines = file.readlines()
lines = [line.strip() for line in lines]
chunk = PhotoScan.app.document.addChunk()
chunk.addPhotos(lines)
file.close()
-
Thank you, sir!