How can I make a camera the active one?
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 tab in the Properties Editor and pick a camera object from the list:
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.001bound to the marker on frame
Camerabound to the marker on frame
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.
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.
Another way to achieve camera switching in Blender is though 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.
- 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
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.
@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.
@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.