You might find something useful in this code I use for my project to fit the camera to bounding box of an object: Fit camera to boundingbox - #4 by ajp specifically the retarget_and_move_camera_to_include_mesh
function at the bottom.
1 Like