In the Sketchup exporter plugin I’m writing, I want to be able to write out the camera lens that’s being used.
Ideally, I’d be able to query that in the API, but even without it, I can almost get it… The other piece of information I need is the “image_width” of the particular advanced camera that the user is using. If I reach into the cameras.csv file I can read it, but that assumes I know which camera they’ve chosen.
Given the horizontal field of view and the image_width in mm, I can calculate the focal length of the lens with a little trig:
focalLength = (width/2) / tan(hFOV/2)
so… Does anyone know how to read and of the following:
- the particular “advanced camera” that is being used for a given scene
- the “image_width” field of that camera
- the focal length of the camera
SketchUp knows all three of these, but as far as I can tell, there’s no API for me to get that info.