I am trying to learn from a downloaded scene. There are several light emitting surfaces and I want to locate them all so I can understand the lighting technique. However the naming is not helpful and since there is no object type for light (for cycles) just objects with emitting properties, they are hard to locate.
Any method to select them all by their property of emitting light?
You can select by material. If they all have the same material - its job done - if not, you’ll have to select each set of emitters separately be identifying which materials are emitting.
Copy this code to blender’s text editor, and run the script (alt-P when hovering the mouse over the text)
This will select all of the meshes that have materials containing emission shaders:
import bpy
scn = bpy.context.scene
obs = scn.objects
meshes = [o for o in obs if o.type == 'MESH']
not_meshes = [o for o in obs if o.type != 'MESH']
for ob in not_meshes:
ob.select = False
for ob in meshes:
ob.select = False
for slot in ob.material_slots:
mat = slot.material
if mat.node_tree:
do_select = False
for node in mat.node_tree.nodes:
if node.type == 'EMISSION':
do_select = True
break
if do_select:
ob.select = True
scn.objects.active = ob