16
Python and Java API / Re: Find cameras by time
« on: May 18, 2018, 09:54:11 AM »
I've trying to modify it and still nothing , did somebody can check it please have a lot images to do , and Im stuck with and have to finish it today , Alexey are You there my god of python ??
Code: [Select]
import os, PhotoScan
import datetime
chunk = PhotoScan.app.document.chunk
time_table = list()
for camera in chunk.cameras:
time = camera.photo.meta['Exif/DateTimeOriginal'].split(" ")[1][:-3].replace(":", ".")
time = float(time)
time = time // 1 + (time - time // 1) * 100 / 60
time_table.append(time)
time_table.sort()
limits = (time_table[0], time_table[-1])
#limits = time[0], time[-1]
interval = 08.02
interval1 = 08.03
start = limits[0]
while True:
finish = start + interval
time = float(camera.photo.meta['Exif/DateTimeOriginal'].split(" ")[1][:-3].replace(":", "."))
time = time // 1 + (time - time // 1) * 100 / 60
if start <= time < start + interval1:
camera.selected = True
empty = False
start += interval