Hey there,
I've been using on the 1.7.3 release a python script to orient cameras based on a csv containing EO. Here is this script (by the way, thanks to Alexey and Paulo) :
import Metashape
chunk = Metashape.app.document.chunk
crs = chunk.crs
T = chunk.transform.matrix
origin = None
for camera in chunk.cameras:
if not camera.type == Metashape.Camera.Type.Regular:
continue
if not camera.reference.location:
continue
if not camera.reference.rotation:
continue
pos = crs.unproject(camera.reference.location)
m = crs.localframe(pos)
rot = Metashape.utils.opk2mat(camera.reference.rotation) * Metashape.Matrix().Diag([1, -1, -1])
R = Metashape.Matrix().Translation(pos) * Metashape.Matrix().Rotation(m.rotation().t() * rot)
if not origin:
origin = pos
chunk.transform.matrix = Metashape.Matrix().Translation(origin)
T = chunk.transform.matrix
camera.transform = T.inv() * R
chunk.updateTransform()
The problem is, since I moved from 1.7.3 to 1.7.4, this script don't works any longer.
Is there any change in the way to script python commands ?