I have multiple cameras in a scene. What I want to do is to change which one is active. This way I can view the scene from different angles. How would I do this?
4 Answers
There are a few ways to set the active camera.
Key Binding: select it and press Ctrl+ Numpad 0.
From the menu:
3D Viewport Header -> View -> Cameras -> Set active object as camera.Scene property:
Scene tab in the Properties Editor and pick a camera object from the list:
- Outliner (V2.90+):
You can click the green camera icon beside the camera's name in the outliner to toggle it as active for the scene.
Animation:
To change the active camera during an animation you can use Markers.
- Add a marker where you want to change the active camera (M in the Timeline, or Timeline header > Add marker will add a marker to the current frame):
- Select the object which you want to set as the new active camera and the marker which you want to bind it to, then press CtrlB in the Timeline (or Timeline header > View > Bind camera to markers):
Note that markers behave like keyframes, so you will need at least two markers with cameras bound to them to have any camera switching.
To illustrate this, here is an example with Camera.001
bound to the marker on frame 1
, and Camera
bound to the marker on frame 5
:
Note: If setting the active camera is only effecting a single view, you may have Scene-lock disabled. In the 3D View header (Right hand side of layers buttons), there is a lock icon. This should normally be pushed in, unless you explicitly want to set a camera & layers only to a single view.
-
3$\begingroup$ I just wanted to say that I had problems binding the active camera to a marker then I realized that I had restricted the rendering (the camera symbol on the right next to the camera in the Outliner). Cameras are not visible in the rendered product even if they are right in front of each other. Don't restrict the rendering or the viewport visibility of your cameras. This is a comment to help those noobs who like me were wondering why switching cameras was not working. $\endgroup$ Commented Apr 12, 2018 at 13:48
-
1$\begingroup$ Note that clicking the camera icons to switch active camera will stop working if you are using an edit camera (e.g. you held down the mouse wheel button and rotated the camera). You have to choose an active camera first, e.g.
View -> Camera -> Active Camera
before the icon switching works (Blender v3.3). $\endgroup$– PhrogzCommented Jan 20, 2023 at 16:48 -
$\begingroup$ Oh yes, thank you! Add Marker was the solution for me! I downloaded an Earth model, and it had animation included. Apparently, it was rendering the first frame... which I didn't think was the first frame... Anyway. I scrubbed until I got to the globe location that I needed, then used ADD MARKER (M). Then it rendered the correct view. Whew! $\endgroup$ Commented Apr 28 at 7:49
Another way to achieve camera switching in Blender is through the VSE or Video Sequence Editor.
- Establish multiple cameras in the scene.
- Add a scene strip to the VSE for each camera and set the active camera of the strip to each camera in the scene.
Note: If you cannot add a scene strip (because the menu is empty), just add a new scene and then you can add your original scene into the timeline.
- Add a Multicam effect strip above these scene strips and use the buttons to switch between cameras. With a VSE preview window open you will see the switching occur (but not in the 3D view)
This can be used to feed the compositor with time offset scene renders as well. For example you may want to have a repeated action from alternate angles, simply set up the switching in the VSE then drag the scene strip along the timeline.
In order to change the currently active camera, select the one you want to be active and press Ctrl0. This will also change your view to the new camera.
To change cameras mid-animation, you need to use markers. A marker can be added by hovering with your mouse over the timeline and pressing M. Next you need to bind the second camera change with that marker. You can do it by selecting the camera and pressing CtrlB.
NB: It is important to know that markers behave a bit like keyframes, so it is important to add one at the beginning of your animation and bind it to your first camera.
run the following script:
import bpy
import os
scene = bpy.context.scene
currentcam = bpy.context.scene.camera
setcam = False
for ob in scene.objects:
if ob.type == 'CAMERA':
if ob == currentcam:
setcam = True
elif setcam:
bpy.context.scene.camera = ob
break
if currentcam == bpy.context.scene.camera:
for ob in scene.objects:
if ob.type == 'CAMERA':
bpy.context.scene.camera = ob
break
-
6$\begingroup$ To someone who has no idea how to run a script, how do I run this script and what does it do exactly? Try to add a bit more detail when answering, if the API changes (probably will) then your script will probably become obsolete, a few comments here and there will help. $\endgroup$– iKlsRCommented Jan 21, 2015 at 18:45
-
1$\begingroup$ @iKlsR Of course some more context information would be nice. But I think your requirements would prevent people from posting useful scripts, as it just becomes to tedious. $\endgroup$– tobltobsCommented Jan 20, 2016 at 13:19
-
2$\begingroup$ @tobltobs I agree, however I don't see the harm in appending a line of text to say open the text editor and do this or that or linking to a post that already answers that, it's not time consuming. Could be just me but when I answer I use layman terms and assume you know nothing about Blender. $\endgroup$– iKlsRCommented Jan 20, 2016 at 16:30
-
2$\begingroup$ @iKlsR - I know it's quite old but in blender 2.8x goto the scripting workspace --> new text --> past the above script --> click run script --> that's it. $\endgroup$– yossicoCommented Jun 3, 2020 at 20:36
-
$\begingroup$ I needed this, you saved my life. Thanks!! $\endgroup$– GabrielCommented Mar 17, 2022 at 21:57