Hello together,
i have the same problem with my small script now in v.1.1.0:
Where is my error?
-------------------
import PhotoScan, math
def main():
doc = PhotoScan.app.document
chunk = doc.chunk
if chunk.model:
x = PhotoScan.app.getInt("Input number of smoothing steps:", 3)
chunk.smoothModel(x)
print("Smoothing by script finished.")
return 1
else:
print("No model. Script aborted.")
return 0
PhotoScan.app.addMenuItem("Cavi_Ing/Smooth model", main)
def rotateBb():
doc = PhotoScan.app.document
chunk = doc.chunk
T = chunk.transform
v = PhotoScan.Vector( [0,0,0,1] )
v_t = T * v
v_t.size = 3
m = chunk.crs.localframe(v_t)
m = m * T
s = math.sqrt(m[0,0]**2 + m[0,1]**2 + m[0,2]**2) #scale factor
R = PhotoScan.Matrix( [[m[0,0],m[0,1],m[0,2]], [m[1,0],m[1,1],m[1,2]], [m[2,0],m[2,1],m[2,2]]])
R = R * (1. / s)
reg = chunk.region
reg.rot = R.t()
chunk.region = reg
PhotoScan.app.addMenuItem("Cavi_Ing/Bounding box to coordinate system", rotateBb)
-------------------
The first part - smooth model - works. the second part not.
Thx