GreasePencil(ID)

base classes — bpy_struct, ID

class bpy.types.GreasePencil(ID)

Grease Pencil data-block

after_color

Base color for ghosts after the active frame (array of 3 items, in [0, 1], default (0.12549, 0.082353, 0.529412))

Type:

mathutils.Color

animation_data

Animation data for this data-block (readonly)

Type:

AnimData

attributes

Geometry attributes (default None, readonly)

Type:

AttributeGroupGreasePencil[Attribute]

before_color

Base color for ghosts before the active frame (array of 3 items, in [0, 1], default (0.145098, 0.419608, 0.137255))

Type:

mathutils.Color

color_attributes

Geometry color attributes (default None, readonly)

Type:

AttributeGroupGreasePencil[Attribute]

ghost_after_range

Maximum number of frames to show after current frame (0 = don’t show any frames after current) (in [0, 120], default 1)

Type:

int

ghost_before_range

Maximum number of frames to show before current frame (0 = don’t show any frames before current) (in [0, 120], default 1)

Type:

int

layer_groups

Grease Pencil layer groups (default None, readonly)

Type:

GreasePencilv3LayerGroup[GreasePencilLayerGroup]

layers

Grease Pencil layers (default None, readonly)

Type:

GreasePencilv3Layers[GreasePencilLayer]

materials

(default None, readonly)

Type:

IDMaterials[Material]

onion_factor

Change fade opacity of displayed onion frames (in [0, 1], default 0.5)

Type:

float

onion_keyframe_type

Type of keyframe (for filtering) (default 'ALL')

  • ALL All – Include all Keyframe types.

  • KEYFRAME Keyframe – Normal keyframe, e.g. for key poses.

  • BREAKDOWN Breakdown – A breakdown pose, e.g. for transitions between key poses.

  • MOVING_HOLD Moving Hold – A keyframe that is part of a moving hold.

  • EXTREME Extreme – An ‘extreme’ pose, or some other purpose as needed.

  • JITTER Jitter – A filler or baked keyframe for keying on ones, or some other purpose as needed.

  • GENERATED Generated – A key generated automatically by a tool, not manually created.

Type:

Literal[‘ALL’, ‘KEYFRAME’, ‘BREAKDOWN’, ‘MOVING_HOLD’, ‘EXTREME’, ‘JITTER’, ‘GENERATED’]

onion_mode

Mode to display frames (default 'ABSOLUTE')

  • ABSOLUTE Frames – Frames in absolute range of the scene frame.

  • RELATIVE Keyframes – Frames in relative range of the Grease Pencil keyframes.

  • SELECTED Selected – Only selected keyframes.

Type:

Literal[‘ABSOLUTE’, ‘RELATIVE’, ‘SELECTED’]

root_nodes

The root nodes of the layer tree. Ordered by stack order, meaning the first node is the bottom most node in the layer tree. (default None, readonly)

Type:

bpy_prop_collection[GreasePencilTreeNode]

stroke_depth_order

Defines how the strokes are ordered in 3D space (for objects not displayed ‘In Front’) (default '2D')

Type:

Literal[Stroke Depth Order Items]

use_autolock_layers

Automatically lock all layers except the active one to avoid accidental changes (default False)

Type:

bool

use_ghost_custom_colors

Use custom colors for ghost frames (default False)

Type:

bool

use_onion_fade

Display onion keyframes with a fade in color transparency (default False)

Type:

bool

use_onion_loop

Display onion keyframes for looping animations (default False)

Type:

bool

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions

References

  • bpy.context.annotation_data

  • bpy.context.gpencil

  • bpy.context.grease_pencil