Page MenuHome

Python: GreasePencil.active does not accept a GPencilLayer, but GreasePencil type?!
Closed, ResolvedPublic

Description

Blender Version
Broken: 2.72 official

Short description of error
GreasePencil.layers.active should accept GreasePencil.layers[#], but only GreasePencil itself it accepted.

Exact steps for others to reproduce the error
Select default cube, add two GPencil layers, switch to Scripting view and try the following:

C.object.grease_pencil.layers.active = C.object.grease_pencil.layers[0] # fails

C.object.grease_pencil.layers.active = C.object.grease_pencil # succeeds but makes no sense

Related Objects