# Active Layer Indicator

I have used Blender regularly for years and don't consider myself a newbie by any means. But I have no idea if there is any way to tell what the active layer is. When creating a new object, linking in an instance from another .blend, etc. the new item will be placed on the active layer. But, as far as I know, there is no way to know which layer that is by looking at the UI.

We've got the little circles in the Layers panel indicating levels containing objects. And we've got the highlighted circle that shows which layer the selected object resides on. But nothing that shows what the active layer is.

Have I been missing something obvious all these years?

• The active layer is one selected last. Still I'm not sure there is some way (without coding) to learn from UI only which one is active without adding objects and looking where they were added to – Mr Zak Sep 3 '15 at 12:45
• A theme option to draw the active_layer in a slightly different color, would be welcome indeed. – zeffii Sep 3 '15 at 13:00

the outliner does show it, and it corresponds with bpy.context.scene.active_layer

Since the active_layer property start from 0, you have to add 1.

Starting from the UI PANEL SIMPLE template and the answer of @zeffii, you can run this script to add a panel in the Tool Shelf:

import bpy

class ActiveLayerPanel(bpy.types.Panel):
"""Creates a Panel in the Tool Shelf"""
bl_label = "Active Layer Panel"
bl_idname = "OBJECT_PT_activelayer"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'

def draw(self, context):
layout = self.layout

obj = context.object
layer = getActiveLayer(context.scene)

row = layout.row()
row.label(text="ACTIVE LAYER", icon='RENDERLAYERS')

row = layout.row()
row.label(text="Active layer is: " + str(layer))

def getActiveLayer(scene):
return scene.active_layer + 1

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

def unregister():
bpy.utils.unregister_class(ActiveLayerPanel)

if __name__ == "__main__":
register()