# Is there a way to quick toggle cameras?

Let's say I have 4 cameras on a scene:

I would like to render with the first camera, see what it looks like, then switch to the "next" camera quickly and see what that render looks like.

Currently, to switch cameras I have to click on a camera and set it as active and finally I can render (I don't have a number pad so I have to go to the menu and set it each time; else I'd use Ctrl+0). What I would like to know is whether there is a way to switch cameras and set it as active all in one step?

EDIT:
I'm not asking how to set a camera as active, that's doable via menu, what I'm asking for is a guide for a "quick toggle" between cameras; a quick way to switch active cameras without an animation.

• possible duplicate of How can I make a camera the active one? – Ray Mairlot Mar 13 '15 at 18:16
• Well, I wouldn't say that it's a duplicate @RayMairlot as I know how to set a camera as active, but what I'm looking for is a "quick toggle" between cameras. Though the "animation" section from the link above does point me in a simple direction IF I was looking to do an animation. Also, thanks for taking the time and finding that link, if that's the only way I can do it then I'll just create an animation (though I prefer not to). – SoluableNonagon Mar 13 '15 at 18:19
• If you used the 'markers' solution, you would be able to use left and right arrow keys to switch between markers (if markers were 1 frame apart), which would switch the cameras. – Ray Mairlot Mar 13 '15 at 18:25
• Alright, I haven't tried that, still a beginner. Thanks. – SoluableNonagon Mar 13 '15 at 18:28

go in scene settings tab

click on the camera name

choose the camera you want as active and click

• This is pretty easy. Not bad. I was hoping for shortcut keys, like Alt+Tab, but this is a nice quick way. And thanks for the images. – SoluableNonagon Mar 13 '15 at 18:24
• the other method needs more time to set up, but is faster afterwards and gives you a shortcup. – Bithur Mar 13 '15 at 18:32

It's possible with a little addon:

bl_info = {
"name": "Cycle Cameras",
"author": "CoDEmanX",
"version": (1, 0),
"blender": (2, 65, 0),
"location": "View3D > Ctrl + Shift + Left/Right Arrow",
"description": "Switch scene camera to next or previous camera object",
"warning": "",
"wiki_url": "",
"category": "3D View"}

import bpy

class VIEW3D_OT_cycle_cameras(bpy.types.Operator):
"""Cycle through available cameras"""
bl_idname = "view3d.cycle_cameras"
bl_label = "Cycle Cameras"
bl_options = {'REGISTER', 'UNDO'}

direction = bpy.props.EnumProperty(
name="Direction",
items=(
('FORWARD', "Forward", "Next camera (alphabetically)"),
('BACKWARD', "Backward", "Previous camera (alphabetically)"),
),
default='FORWARD'
)

def execute(self, context):
scene = context.scene
cam_objects = [ob for ob in bpy.data.objects if ob.type == 'CAMERA']

if len(cam_objects) == 0:
return {'CANCELLED'}

try:
idx = cam_objects.index(scene.camera)
new_idx = (idx + 1 if self.direction == 'FORWARD' else idx - 1) % len(cam_objects)
except ValueError:
new_idx = 0

context.scene.camera = cam_objects[new_idx]
return {'FINISHED'}

def register():
bpy.utils.register_module(__name__)

wm = bpy.context.window_manager
if kc:
kmi = km.keymap_items.new(VIEW3D_OT_cycle_cameras.bl_idname, 'RIGHT_ARROW', 'PRESS', ctrl=True, shift=True)
kmi.properties.direction = 'FORWARD'
kmi = km.keymap_items.new(VIEW3D_OT_cycle_cameras.bl_idname, 'LEFT_ARROW', 'PRESS', ctrl=True, shift=True)
kmi.properties.direction = 'BACKWARD'

def unregister():
km.keymap_items.remove(kmi)
bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
register()


An operator to cycle through available camera objects is bound to CtrlShiftLeft Arrow to go to (alphabetically) previous camera and CtrlShiftRight Arrow to go to next camera.

• CoDEmanX I am very happy to have found this, it should imho be built in... seems like an obvious Missing Feature. – Tazling Dec 31 '16 at 21:24

I have quickly ported it to Blender 2.8x. Thanks for this addon @CoDEmanX. I was about to write my own script but this was much easier and faster.

### cycle_cameras.py

bl_info = {
"name": "Cycle Cameras",
"author": "CoDEmanX",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "View3D > Ctrl + Shift + Left/Right Arrow",
"description": "Switch scene camera to next or previous camera object",
"warning": "",
"wiki_url": "",
"category": "3D View"}

import bpy

class VIEW3D_OT_cycle_cameras(bpy.types.Operator):
"""Cycle through available cameras"""
bl_idname = "view3d.cycle_cameras"
bl_label = "Cycle Cameras"
bl_options = {'REGISTER', 'UNDO'}

direction : bpy.props.EnumProperty(
name="Direction",
items=(
('FORWARD', "Forward", "Next camera (alphabetically)"),
('BACKWARD', "Backward", "Previous camera (alphabetically)"),
),
default='FORWARD'
)

def execute(self, context):
scene = context.scene
cam_objects = [ob for ob in scene.objects if ob.type == 'CAMERA']

if len(cam_objects) == 0:
return {'CANCELLED'}

try:
idx = cam_objects.index(scene.camera)
new_idx = (idx + 1 if self.direction == 'FORWARD' else idx - 1) % len(cam_objects)
except ValueError:
new_idx = 0

scene.camera = cam_objects[new_idx]
return {'FINISHED'}

def register():
bpy.utils.register_class(VIEW3D_OT_cycle_cameras)

wm = bpy.context.window_manager

if kc:
kmi = km.keymap_items.new(VIEW3D_OT_cycle_cameras.bl_idname, 'RIGHT_ARROW', 'PRESS', ctrl=True, shift=True)
kmi.properties.direction = 'FORWARD'
kmi = km.keymap_items.new(VIEW3D_OT_cycle_cameras.bl_idname, 'LEFT_ARROW', 'PRESS', ctrl=True, shift=True)
kmi.properties.direction = 'BACKWARD'