Skip to main content
3 of 6
Added python code to toggle all objects in scene
p2or
  • 16.1k
  • 10
  • 87
  • 146

In the object properties, you can turn off the Ray Visibility of the Emission object for the camera.

enter image description here


You can also run this script to enable or disable the Camera Ray Visibility for all objects in the scene:

import bpy

for obj in bpy.data.objects:
    
    # toggle mesh lights
    if obj.type == 'MESH':
        nodes = obj.data.materials[0].node_tree.nodes
        for node in nodes:
            if node.type == "EMISSION":
                obj.cycles_visibility.camera = not obj.cycles_visibility.camera
     
    # toggle lamps
    if obj.type == 'LAMP':
        obj.cycles_visibility.camera = not obj.cycles_visibility.camera
jasperge
  • 1.9k
  • 14
  • 17