Render From View


This is my first python script as well as one for Blender. I was at the Blender BOF at Siggraph and I got inspired from some of the demos. Thanks guys.

Right now, when you use it, it will move the camera to match the view of your viewport and then render an image from it and then move the camera back. You can also click move camera and it will move the camera to match the viewport and stay there.

Right now, there are some bugs that I don’t know how to fix. For one, if you try to use the script and you are in an orthographic viewport, then it gets all wonkey. I tried makeing the camera orthorgraphic, but that didn’t work. Does anyone know how to make the viewport not orthographic?

The other is once i do the render camera, i don’t know how to reset the viewport back.

I would love some feedback and suggestions and possible ways to fix these things.

Great script as it is besides being a little wacky- does what I want Blender to do, render from a viewport for tests without dealing with the camera. Nice job!

One thing I just noticed though that has a workaround but with odd behavier- if the camera is moved using the script and then the view is zoomed in or out using the mouse wheel the camera can’t be moved (with the script button) again unless (the workaround) the view is rotated or moved a slight bit then zoomed or another view is chosen, the camera moved with the script then the original view reselected, zoomed and setting camera sets the camera right.

But the script doesn’t crash and the workarounds are simple enough that even using it to set an intial camera position for a scene it’s great as-is.

Using Blender 2.34.

ah…thank you for pointing that out and for your comments. I’m also glad it was helpful for you.

Right now it is a little wonkey and hopefully I can find a solution or someone can help.

I should also include something so that you can select the camera to do this. If there is no camera in the scene and if you don’t have it named “Camera” this doesn’t work.

Actually works pretty darn good for me. Thanks much!

OMG!!! I just found a much easier way to do this.

Okay, this version is a little nicer. It doesn’t crap out if the view is orthagonal and if you zoom out then it readjusts like it’s nothing.

This was done through better use of Blender.Window.CameraView()

I’m still looking for a way to get out of the Camera View and back to the Viewport.

Oh heck yeah, that’s ALOT nicer. It goes right where you expect it to now. Brilliant!

Don’t worry about getting out of the camera view and back to viewport. It’s only one click and we’re not THAT lazy :stuck_out_tongue:

I hate myself.

I just noticed that if I hit shift + numPad 0 it will align the camera to the view. So I guess I didn’t have to make this.

oh well…at least I learned something…I guess

That hotkey still doesn’t work in windows (though you can do it thru the menus), besides your script(s) will still be useful for multiple cameras.


Hehe Pope, I just learned that too. I still like your script though :stuck_out_tongue:

Hotkey doesn’t work for me which is just as well since I simply want a viewport rendered at different spots and zooms to check geometry, textures and possible camera position angles- I hate camera line overlays when I’m not the least bit concerned about what the camera can see and not see as it’s just unnecessary distracting lines on the screen that in pre-setup serve no purpose but to get in the way. Thank you for this script, it’s simple and does the job. It’s flakey, even with the update, but does what I want without breaking anything.

And naturally, turns out Blender 2.34 does what I want in 1 button click on the graphic scale looking deal (last button to the right on each view window- render view). Oh well…sigh.