for ob in bpy.objects: print(ob.name) for i, lay in bpy.scenes["Scene"].layer: print('%d %d' % i, lay)