Forum

Author Topic: Import photos from a file list  (Read 6809 times)

Ubi

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Import photos from a file list
« Reply #15 on: March 17, 2020, 04:07:56 PM »
Thank You very much Alexey!!!

The problem is solved.
Here the whole code i used:

import Metashape

doc = Metashape.app.document
chunk = doc.addChunk()
chunk.label = "Traliccio"
sourcepath = r"D:\\LAVORI\\ADRIREEF\\DA_PROCESSARE\\Meta-to-RC\\Tralicciotxt"
file = open(sourcepath, "rt")
photo_list = file.readlines()
file.close()
photodir = "D:\\LAVORI\\ADRIREEF\\DA_PROCESSARE\\Meta-to-RC\\cc\\"
photo_list = [photodir + photo.split()[0] for photo in photo_list]
print (photo_list)
chunk.addPhotos(photo_list)
Metashape.app.update()

print

- end of code -

Many thanks again!

Best greetings

Ubi



Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Import photos from a file list
« Reply #16 on: March 17, 2020, 05:02:40 PM »
Glad to hear that the issue is resolved now.

The latest problem has been related to the missing "slash" in path, which results in in the incorrect image paths.

As for the original problem, I still think it has been related to some incorrect symbols appeared during copying to the Console pane (or due to the regular - non-rich, Python console used).
Best regards,
Alexey Pasumansky,
Agisoft LLC