Hi all,
I have a script in version 1.5 that prints out the rotation angles of model viewpoint for this I used following code:
chunk = doc.chunk
T = chunk.transform.matrix
vp = PhotoScan.app.viewpoint
R = vp.rot
m = chunk.crs.localframe(vp.center).rotation()
X, Y, Z = chunk.crs.project(vp.center)
opk = PhotoScan.utils.mat2opk(m*R)
ypr = PhotoScan.utils.mat2ypr(m*R)
Since in 1.6.2 viewpoint has changed I modified script as follows:
chunk = doc.chunk
T = chunk.transform.matrix
vp = PhotoScan.app.ModelView.viewpoint
R = vp.rot
m = chunk.crs.localframe(vp.center).rotation()
X, Y, Z = chunk.crs.project(vp.center)
opk = PhotoScan.utils.mat2opk(m*R)
ypr = PhotoScan.utils.mat2ypr(m*R)
But now I get following error when running script:
Error: 'getset_descriptor' object has no attribute 'rot'
Any help will be appreciated...
Found solution, correct line of code is
vp = PhotoScan.app.model_view.viewpoint
instead of
vp = PhotoScan.app.ModelView.viewpoint