[Closed] Camera Frame to BBox
Hello peeps, i have a small problem with a tool of my own.
I’m creating a script to render Art Asset for an Iso Game.
It create all the camera just fine everything is good. But sometime if my object is too be or too small i want to have it framed.
How can i do so that the camera FOV is set according to the object BBox? i get the object Min, Max… but after that i<m lost.
anyone can help me out with this? or if you know a script somewhere that can help me on the render process, that’ll be good too.
thanks in advance
in you case it’s easer to go another way.
You have to know what you want to render… so, select all what you want to render… set camera view in active viewport…
-- get view TM and FOV (camera)
tm = getViewTM()
fov = viewport.getFOV()
-- set perspective view
viewport.setType #view_persp_user
viewport.setTM tm
viewport.setFOV fov
-- zoom ext to selection
max zoomext sel
… render from active view (not from camera)
Thanks for your help denisT there where some really good tips but i’ll still have to work a bit more on it since with your solution i can’t have a “guide” for my rendering
thanks again