Make camera view match viewport?

Okay, is there REALLY no way to do this? It just seems insane to me. Lining up the perfect shot with the viewport controls is very easy and intuitive. But then when I snap the camera to my view with ctrl+alt+0, the view is heavily cropped into a tiny rectangle and I have to spend a while moving the camera around from “inside” the camera view trying to get it close to what I had in the viewport. And even then I sometimes have a hard time getting quite the same shot. I have to zoom out to get the same field of view, but then I have to mess with the focal length again because I zoomed out… Yes, I know how to move the camera around from inside the camera view. It still sucks. Compared to the regular viewport controls, it’s just an insanely finicky way to position the camera.

It’s especially crazy to me because of the existence of the render preview inside the viewport. Why can’t I just export THAT as a full resolution render?

I tried to search the web for a solution but I can’t seem to find one. Is there really no way to just… have the camera (and thus the final render) match the viewport window? If not, why the heck not?

1 Like

No out-of-the-box way, no. Try looking for add-ons or script it yourself. As to why, this isn’t the place to ask. But if I had to guess, I’d say it’s because you haven’t made it yet.

1 Like

i guess since now 135 years, you’re the 68734520th user asking for this :stuck_out_tongue:

I also dream of it but am too shitty python dev to make such a simple thing.

Maybe you can find some paid addon on blendermarket ?

happy blending !

I think maybe the issue is that the viewport and the camera are supposed to be different. If you set the viewport settings to that of a camera then it would match. For example a camera has some real world limitations like focal length, sensor size, position and dof. The blender viewport is a magical box with no set framing, focus or fov. I find that since i have some camera operation experince i usually manually type in the numbers for the camera postion as that is pretty true to real photography and videography.

Hi, @WastingPenguins! I didn’t see this mentioned, but why not use the Lock Camera to View option? If you are unfamiliar, it aligns your scene camera with the viewport camera in the 3D Viewport. That way, all the pans, zooms, rotations, etc. that you do in the viewport also happen to your scene camera. It is easy to do. Expand the sidebar by pressing N while you hover your mouse over the 3D Viewport. Then enable the Lock Camera to View option.

Here’s the manual page about that option in the Sidebar:

3 Likes

That’s not what they’re asking. They’re asking about matching camera’s resolution to viewport size, camera’s focal length to that of the viewport, etc. etc.

But when you lock the camera to view, they do match. I understand that I’m answering the inverse of the question, but when approaching the problem with the assumption that there isn’t an easy way to match scene camera to viewport camera after the fact, the best way to make the two cameras match is to lock the view to the camera at the beginning, no?

1 Like

Well, it should be easy enough to copy over Focal Length, and Clip Start and End. Those are in the View tab of the N-panel. Orthographic or Perspective is a given.

The one thing I always wondered is if you could get the position and rotation of the viewport. After Align Camera to View, is the camera set to the viewport position and rotation?

They don’t. Render resolution isn’t even camera’s property, yet camera is using it, not viewport size, lock or no lock. Focal length is taken from the camera’s settings, not viewport settings, when lock is on. Exactly backwards of what the OP is asking for.

This is what you need:
Photographer - Camera Exposure, White balance, Autofocus and Physical Lights - Coding / Released Scripts and Themes - Blender Artists Community

It’s an extremely useful addon, not only for matching the camera to the viewport. There are other nifty features. Highly recommended.

4 Likes

The way I read the post, the question OP asked is basically “match scene camera settings to current viewport camera settings” which isn’t the solution I proposed. But I believe the thing OP really wants is an easy way to “what you see is what you get” in the viewport. That’s what I proposed. Would @WastingPenguins be willing to weigh in and clarify?

2 Likes

All you have to do is make sure the camera focal length matches your viewport settings and then hit control+alternate+0 on the number pad. Then play with the camera sensor (fit:auto) slider until it matches what the viewport was. I get minimal change with a focal length: 32mm and a sensor of 50 mm.

EDIT: 52 mm sensor appears to be just right (no change)

I didn’t know about this, and it pretty much solves my issue. It lets me position the camera view naturally, using the 3d viewport controls. It’s not exactly what I was asking, but after rethinking the issue I realized that this is the main thing I wanted. Unfortunately I’m pretty busy and can’t respond to each person who tried to help with clarifications. Thanks everyone!

1 Like

im in [email protected]

The problem that I was getting at here is that when you lock the camera to your view, the actual field of view is restricted to a rectangle that’s smaller than what the viewport shows. That’s the frustration – you use the viewport controls to find the perfect angle for a render, then snap the camera to your view and oops – the view is now heavily cropped into a smaller camera view window and you have to start adjusting.

The solution, I guess, is to just stop trying to use the viewport view to find a good angle for a render. Instead, I’ll be using “lock camera to view” and finding my angle from inside the camera view in the first place.

1 Like

So, it sounds like we are at the point where we’ve identified the constraints of how Blender’s viewport camera and scene camera’s work. The pie-in-the-sky wish would be some sort of operator that could make the scene camera match any viewport’s arbitrary dimensions/focal length/framing, correct?

Yep, in theory that would be pretty nice!

1 Like

There is a function View > Cameras > Frame Camera Bounds.

EDIT: This just matches the viewport to the camera, not vice versa. However, this helps to achieve a 1:1.

This was asked here: https://blender.stackexchange.com/questions/107365/align-camera-to-view-precisely-and-automatically-without-manual-fiddling

I couldn’t get the script to work. It seems to use a sensor width of 64. For me the magic number seems to be 72. 72 mm appears to be the right sensor width for a full HD image.

Procedure for Full HD image:

Select active camera and go to Object Data Properties. Choose Horizontal Sensor Fit, Width 72 mm.

Hit N. Go to View. Copy the Focal Length and Clip Start and End to your active camera.

Hit Numpad 0 to enter the active camera. Frame Camera Bounds. Adjust the size of the 3D Viewport, Frame Camera Bounds, adjust, frame, adjust, frame… until they are perfectly aligned.

Now Ctrl + Alt + Numpad 0 will be the same as your viewport.

1 Like