I was trying to make the view become to Y up. -z forward, I saw with the code "chunk.crs= None", the View will become to Y up, Z forward , not matter if there is model or not, I would like to change the crs, but it seems like there is no way to control it directly, so I was using the following code to adjust one of my model:
import Metashape as ms
import math
chunk = ms.app.document.chunk
camera = chunk.cameras[0]
mv = ms.app.model_view
vp = mv.viewpoint
vp.fov = 90
angle = math.radians(90)
rotation_matrix_y = ms.Matrix([[math.cos(angle), 0, -math.sin(angle)], [0, 1, 0], [math.sin(angle), 0, math.cos(angle)]])
rotation_matrix_z = ms.Matrix.Diag([-1, -1, 1])
#rotation_matrix_y = ms.Matrix([[1, 0, 0], [0, 0, 1], [0, -1, 0]])
#rotation_matrix_z = ms.Matrix([[1, 0, 0], [0, -1, 0], [0, 0, -1]])
Ro = ms.Matrix([[0.9219497701513975, -0.02682517004569788, 0.38637938812753064],
[-0.020038763625087008, -0.9995662407242738, -0.021581898821031623],
[0.3867907305897642, 0.012154861429187487, -0.922087409128589]])
Trans = ms.Matrix([[0.9219497701513972, -0.02682517004569788, 0.38637938812753064, -4.97564693876466],
[-0.020038763625087004, -0.9995662407242738, -0.021581898821031623, 0.27391026894569304],
[0.3867907305897641, 0.012154861429187487, -0.922087409128589, -0.8262636690645881],
[0.0, 0.0, 0.0, 1.0]])
vp.rot = chunk.transform.matrix.rotation() * Ro * rotation_matrix_y * rotation_matrix_z
center = (chunk.transform.matrix * Trans).translation()
Its actually work but it only works for the model I tested, I would like to if there is simple like chunk.crs=None
to adjust the View directly?
I guess maybe there is something that i might missed,Is anyone know this? Thanks in advance