32
$\begingroup$

In my scene it is required to position the lights close to the main object like this:

enter image description here

How I can make the light source invisible to the camera?

$\endgroup$
47
$\begingroup$

In the object properties, you can turn off Ray Visibility of the 'emission object' for the camera:

enter image description here


As of Blender 2.76 the Ray Visibility panel was renamed to Cycles Settings:

enter image description here


As of Blender 2.8x, Ray Visibility panel is now part of the new Visibility Panel:

enter image description here


You can also run this script to toggle the Camera Ray Visibility for selected objects (updated for 2.8x):

import bpy

for obj in bpy.context.selected_objects:

    # toggle mesh lights
    if obj.type == 'MESH':
        for slot in obj.material_slots:
            if slot.material:
                for node in slot.material.node_tree.nodes:
                    if node.type == "EMISSION":
                        obj.cycles_visibility.camera = not obj.cycles_visibility.camera

    # toggle light types
    if obj.type == 'LIGHT':
        obj.cycles_visibility.camera = not obj.cycles_visibility.camera
$\endgroup$
  • 3
    $\begingroup$ Both of the answers produce the same result, but just to add that in the node setup you have much more control over things. $\endgroup$ – Vladimir Oct 18 '14 at 13:10
  • 4
    $\begingroup$ @Vladimir Note that disabling visibility in the object settings is slightly more efficient performance wise than a node setup. $\endgroup$ – gandalf3 Oct 18 '14 at 18:49
  • $\begingroup$ @gandalf3 I didn't know that. But, maybe the node setup can be more useful if the performance is here there the same. Thanks for the tip. $\endgroup$ – Vladimir Oct 19 '14 at 11:32
  • 1
    $\begingroup$ Does not work correctly, it still appears in the bake $\endgroup$ – Black Nov 29 '17 at 20:01
19
$\begingroup$

You can setup the emission material in cylcles like this:

enter image description here

Note: @gandalf3 mentioned that disabling visibility is slightly more efficient performance wise than this node setup.

$\endgroup$
0
$\begingroup$

enter image description here

Well, in Blender 2.79 just turning the camera ray off did not work as I expected. So I did a new trick. It Works fine for me.

$\endgroup$
  • 6
    $\begingroup$ Answers should be more in depth than a simple screenshot. What did you do differently? Why was the accepted answer insufficient? FWIW, the accepted answer still works fine in 2.79, something else must be different in your scene. Is your light behind glass, for example? That would cause rays hitting it to be transmissions rays rather than camera rays. $\endgroup$ – JtheNinja Jun 27 '18 at 5:44

protected by cegaton Mar 12 at 20:32

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.