How to change layer

It’s me again with those very noob questions :smiley:
How do I change the active layer through pyton instead… and by the way, does exists the option to specify multiple active layers?

Already thanks

You know that the tooltips give you the python name of the stuff like ‘Scene.layers’ right?

To turn them all on


for i in range(0, len(C.scene.layers)):
    C.scene.layers[i] = True

goto “Scripting”
Type in the console (only examples)
sc = C.scene
sc.layers[:] #shows which layers are ‘active’
sc.layers[1] = True #makes layer 1 active too!
etc.
In a script you replace C by bpy.context (C is a shortcut in the console!)