Thanks Alexy. I figured out that i'm actually having a different scaling issue. updateTransform works well after adding scalebars programmatically, aftwords, when I go to align the 3d model to the location of the first camera, the scale gets reset.
if not chunk:
print("Empty project, script aborted")
return
T = chunk.transform.matrix
origin = (-1) * camera.center
R = Metashape.Matrix().Rotation(camera.transform.rotation()
* Metashape.Matrix().Diag([1, -1, 1]))
origin = R.inv().mulp(origin)
chunk.transform.matrix = Metashape.Matrix([[1, 0, 0, 0], [0, 0, 1, 0], [
0, 1, 0, 0], [0, 0, 0, 1]]) * Metashape.Matrix().Translation(origin) * R.inv()
If I go and scale model alignment after running the above script, then 0,0,0 is no longer then location of the first camera. Do you have any solutions for this?