GPencilLayer(bpy_struct)

base class — bpy_struct

class bpy.types.GPencilLayer(bpy_struct)

Collection of related sketches

active_frame

Frame currently being displayed for this layer

Type

GPencilFrame, (readonly)

annotation_hide

Set annotation Visibility

Type

boolean, default False

annotation_onion_after_color

Base color for ghosts after the active frame

Type

float array of 3 items in [0, 1], default (0.25, 0.1, 1.0)

annotation_onion_after_range

Maximum number of frames to show after current frame

Type

int in [-1, 120], default 0

annotation_onion_before_color

Base color for ghosts before the active frame

Type

float array of 3 items in [0, 1], default (0.302, 0.851, 0.302)

annotation_onion_before_range

Maximum number of frames to show before current frame

Type

int in [-1, 120], default 0

blend_mode

Blend mode

Type

enum in [‘REGULAR’, ‘HARDLIGHT’, ‘ADD’, ‘SUBTRACT’, ‘MULTIPLY’, ‘DIVIDE’], default ‘REGULAR’

channel_color

Custom color for animation channel in Dopesheet

Type

float array of 3 items in [0, 1], default (0.0, 0.0, 0.0)

color

Color for all strokes in this layer

Type

float array of 3 items in [0, 1], default (0.0, 0.0, 0.0)

frames

Sketches for this layer on different frames

Type

GPencilFrames bpy_prop_collection of GPencilFrame, (readonly)

hide

Set layer Visibility

Type

boolean, default False

info

Layer name

Type

string, default “”, (never None)

is_parented

True when the layer parent object is set

Type

boolean, default False, (readonly)

is_ruler

This is a special ruler layer

Type

boolean, default False, (readonly)

line_change

Thickness change to apply to current strokes (in pixels)

Type

int in [-300, 300], default 0

location

Values for change location

Type

float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)

lock

Protect layer from further editing and/or frame changes

Type

boolean, default False

lock_frame

Lock current frame displayed by layer

Type

boolean, default False

lock_material

Avoids editing locked materials in the layer

Type

boolean, default False

mask_layers

List of Masking Layers

Type

GreasePencilMaskLayers bpy_prop_collection of GPencilLayerMask, (readonly)

matrix_inverse

Parent inverse transformation matrix

Type

float multi-dimensional array of 4 * 4 items in [-inf, inf], default ((0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0))

matrix_inverse_layer

Local Layer transformation inverse matrix

Type

float multi-dimensional array of 4 * 4 items in [-inf, inf], default ((0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0)), (readonly)

matrix_layer

Local Layer transformation matrix

Type

float multi-dimensional array of 4 * 4 items in [-inf, inf], default ((0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0)), (readonly)

opacity

Layer Opacity

Type

float in [0, 1], default 0.0

parent

Parent object

Type

Object

parent_bone

Name of parent bone in case of a bone parenting relation

Type

string, default “”, (never None)

parent_type

Type of parent relation

  • OBJECT Object, The layer is parented to an object.

  • ARMATURE Armature.

  • BONE Bone, The layer is parented to a bone.

Type

enum in [‘OBJECT’, ‘ARMATURE’, ‘BONE’], default ‘OBJECT’

pass_index

Index number for the “Layer Index” pass

Type

int in [0, 32767], default 0

rotation

Values for changes in rotation

Type

float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)

scale

Values for changes in scale

Type

float array of 3 items in [-inf, inf], default (1.0, 1.0, 1.0)

select

Layer is selected for editing in the Dope Sheet

Type

boolean, default False

show_in_front

Make the layer display in front of objects

Type

boolean, default False

show_points

Show the points which make up the strokes (for debugging purposes)

Type

boolean, default False

thickness

Thickness of annotation strokes

Type

int in [1, 10], default 0

tint_color

Color for tinting stroke colors

Type

float array of 3 items in [0, 1], default (0.0, 0.0, 0.0)

tint_factor

Factor of tinting color

Type

float in [0, 1], default 0.0

use_annotation_onion_skinning

Display annotation onion skins before and after the current frame

Type

boolean, default False

use_lights

Enable the use of lights on stroke and fill materials

Type

boolean, default False

use_mask_layer

The visibility of drawings on this layer is affected by the layers in its masks list

Type

boolean, default False

use_onion_skinning

Display onion skins before and after the current frame

Type

boolean, default False

use_solo_mode

In Paint mode display only layers with keyframe in current frame

Type

boolean, default False

vertex_paint_opacity

Vertex Paint mix factor

Type

float in [0, 1], default 1.0

viewlayer_render

Only include Layer in this View Layer render output (leave blank to include always)

Type

string, default “”, (never None)

clear()

Remove all the grease pencil layer data

classmethod bl_rna_get_subclass(id, default=None)
Parameters

id (string) – The RNA type identifier.

Returns

The RNA type or default when not found.

Return type

bpy.types.Struct subclass

classmethod bl_rna_get_subclass_py(id, default=None)
Parameters

id (string) – The RNA type identifier.

Returns

The class or default when not found.

Return type

type

Inherited Properties

Inherited Functions

References