Page MenuHome

[WIP] UI: Support switching to any camera
Needs ReviewPublic

Authored by David Friedli (hlorus) on Fri, Aug 28, 5:41 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary
NOTE: This patch aims to implement roughly what was in the 2.8 mockups: https://developer.blender.org/T57234#617574. However, as far as i know there's no proper design defined yet so it's outlined here.

Design

Currently a viewport can be toggled into cameramode which shows either the scene's active camera or the viewport's local camera (when use_local_camera is enabled). This means it's not possible to directly view a camera without also activating it or setting it as the local camera first.

This can be improved by allowing to view any camera which is available in the viewport. A selector to choose which camera to show could replace the viewport name that is already displayed and make it interactive instead. This would make it something like a enum menu of what the viewport can display which could also present different view options like the viewpoints or persp/otho toggle.

Open questions

  • When rendering from the cameraview it might be confusing that the active camera is used. Maybe it should be easily possible to render the camera that is currently viewed?

Implementation

This patch allows the view3d.view_camera operator to switch to any camera by accepting a camera_id string. The operator won't affect the scene's active camera but rather store the camera local per viewport with the already existing view3d.camera property.

As the viewport then always uses a local camera the use_local_camera option becomes obsolete.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D8746 (branched from master)
Build Status
Buildable 9945
Build 9945: arc lint + arc unit

Event Timeline

David Friedli (hlorus) requested review of this revision.Fri, Aug 28, 5:41 PM
David Friedli (hlorus) created this revision.
David Friedli (hlorus) retitled this revision from UI: Add Camera view popover to [WIP] UI: Add Camera view popover.Fri, Aug 28, 6:32 PM
David Friedli (hlorus) edited the summary of this revision. (Show Details)

Very strange design. The menu label says "User Perspective",
it looks like a persp/ortho switch, but inside the camera selection.

It should be more like this:

"Toggle the camera view" + "Camera selection popup".

Or it can be a regular menu:

Also note that there can be a very large number of cameras.
Or there may not be any. See, for example, Add > Collections.

Currently it's only possible to view the scene's active camera.

Is that wording confusing or wrong? 3D views already allow you to change to another camera per 3D view. Sidebar >View tab> View panel> Use Local Camera. Thus it's better to word it as an UI change instead of a feature, or am I missing something else new here?

@Yevgeny Makarov (jenkm) @Wo!262 (wo262) I've updated the description, it should be a bit clearer now.

Very strange design. The menu label says "User Perspective",
it looks like a persp/ortho switch, but inside the camera selection.

I think it can be more than simply a camera selector but rather something like the viewport's "viewmode". That's also why it's placed next to the mode enum. So it would communicate the hierarchy in the editor header: Editor Type > Interaction Mode > Viewmode.

Or it can be a regular menu:

Also note that there can be a very large number of cameras.
Or there may not be any. See, for example, Add > Collections.

Indeed it might be possible to display it differently, however the design should be approved on first i guess..

Very strange design, more convenient to use ~ key, but hope in outline editor, double-click the camera to switch.

This also allows to remove the camera and persp/otho toggles from viewport,
as these are buttons rather than draggable gizmo, they shouldn't be there.

Very strange design, more convenient to use ~ key,

It's not ment to replace the tilde menu.

but hope in outline editor, double-click the camera to switch.

I agree with that. With the changes to the operator that would also be possible.

Such a toggle alone doesn't really communicate which camera is shown. That way the text in the 3dview would still be needed...

-Rebase
-Use Menu instead of popover
-Add icon toggle to quickly switch to active camera
-Add return button when inside a cameraview
-Add sideview's to menu

David Friedli (hlorus) retitled this revision from [WIP] UI: Add Camera view popover to [WIP] UI: Support switching to any camera.Wed, Sep 2, 9:31 PM
David Friedli (hlorus) edited the summary of this revision. (Show Details)