[Bf-committers] Render resolution question

Campbell Barton ideasman42 at gmail.com
Sun Mar 3 02:44:45 CET 2013


On Sun, Mar 3, 2013 at 10:55 AM, patrick boelens <p_boelens at msn.com> wrote:
>
> Hello,
>
> In working on some sprites I often find the need to change cameras and render dimensions. I figured I'd make a small change in the source to give cameras the option of using their own render dimensions for rendering instead. So far I have added the resolution properties and a flag entry 'CAM_USELOCALRES' to the camera. However, I can't figure out where I would need to switch between using the scene.render dimensions or the active camera's ones. For my purposes it is enough to have it switch when I'm in camera view (so that the view frame shows accordingly) and when rendering (no need for changes in OpenGL rendering, BGE, etc.). Ideally there would be one or two places where I could do something along the lines of:
>
> if(scene.camera.flag & CAM_USELOCALRES){dimension_x = scene.camera.resX}
> else{dimension_x = scene.r.xsch} //at least I think xsch is the one here?
>
> Any help on this would be much appreciated.
>
> Cheers,
> Patrick

Hi, don't think theres any shortcut to this, search for xsch shows 56
results, even discounting game engine and envmap there are still many
references to this.
Not sure this feature would be accepted, but think the correct way to
do this would be to replace scene.r.xsch with a function call that
takes (&scene->r, scene->camera).

If this is only for your own use you could use a
'bpy.app.handlers.render_pre' python callback which sets the render
size from camera properties.


More information about the Bf-committers mailing list