Forum

Author Topic: Select cameras by extension  (Read 232 times)

jnb

  • Newbie
  • *
  • Posts: 14
    • View Profile
Select cameras by extension
« on: November 08, 2018, 02:23:10 PM »
Hi,

I am working with both dng and tiff cameras in the same project and I would like to select only tiff in Metashape.
Is there a way to do it in python ?

Thank you !

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 9878
    • View Profile
Re: Select cameras by extension
« Reply #1 on: November 08, 2018, 04:50:42 PM »
Hello jnb,

Please try this one:

Code: [Select]
import Metashape
chunk = PhotoScan.app.document.chunk

for camera in chunk.cameras:
    if camera.photo.path.upper().endswith((".TIF", ".TIFF")):
        camera.selected = True
    else:
        camera.selected = False
Best regards,
Alexey Pasumansky,
AgiSoft LLC

jnb

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Select cameras by extension
« Reply #2 on: November 09, 2018, 12:28:08 PM »
Thank you very much !