Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: jnb on November 08, 2018, 02:23:10 PM

Title: Select cameras by extension
Post by: jnb 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 !
Title: Re: Select cameras by extension
Post by: Alexey Pasumansky 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
Title: Re: Select cameras by extension
Post by: jnb on November 09, 2018, 12:28:08 PM
Thank you very much !