GreasePencil(ID)

base classes — bpy_struct, ID

class bpy.types.GreasePencil(ID)

Freehand annotation sketchbook

after_color

Base color for ghosts after the active frame

Type:

mathutils.Color of 3 items in [0, 1], default (0.12549, 0.082353, 0.529412)

animation_data

Animation data for this data-block

Type:

AnimData, (readonly)

before_color

Base color for ghosts before the active frame

Type:

mathutils.Color of 3 items in [0, 1], default (0.145098, 0.419608, 0.137255)

curve_edit_corner_angle

Angles above this are considered corners

Type:

float in [0, 3.14159], default 1.5708

curve_edit_threshold

Curve conversion error threshold

Type:

float in [0, 10], default 0.1

edit_curve_resolution

Number of segments generated between control points when editing strokes in curve mode

Type:

int in [1, 256], default 32

edit_line_color

Color for editing line

Type:

float array of 4 items in [0, 1], default (0.6, 0.6, 0.6, 0.5)

ghost_after_range

Maximum number of frames to show after current frame (0 = don’t show any frames after current)

Type:

int in [0, 120], default 1

ghost_before_range

Maximum number of frames to show before current frame (0 = don’t show any frames before current)

Type:

int in [0, 120], default 1

grid

Settings for grid and canvas in the 3D viewport

Type:

GreasePencilGrid, (readonly, never None)

is_annotation

Current data-block is an annotation

Type:

boolean, default False, (readonly)

is_stroke_paint_mode

Draw Grease Pencil strokes on click/drag

Type:

boolean, default False, (readonly)

is_stroke_sculpt_mode

Sculpt Grease Pencil strokes instead of viewport data

Type:

boolean, default False, (readonly)

is_stroke_vertex_mode

Grease Pencil vertex paint

Type:

boolean, default False, (readonly)

is_stroke_weight_mode

Grease Pencil weight paint

Type:

boolean, default False, (readonly)

layers
Type:

GreasePencilLayers bpy_prop_collection of GPencilLayer, (readonly)

materials
Type:

IDMaterials bpy_prop_collection of Material, (readonly)

onion_factor

Change fade opacity of displayed onion frames

Type:

float in [0, 1], default 0.5

onion_keyframe_type

Type of keyframe (for filtering)

  • 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.

Type:

enum in [‘ALL’, ‘KEYFRAME’, ‘BREAKDOWN’, ‘MOVING_HOLD’, ‘EXTREME’, ‘JITTER’], default ‘KEYFRAME’

onion_mode

Mode to display frames

  • 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:

enum in [‘ABSOLUTE’, ‘RELATIVE’, ‘SELECTED’], default ‘ABSOLUTE’

pixel_factor

Scale conversion factor for pixel size (use larger values for thicker lines)

Type:

float in [0.1, 30], default 0.0

stroke_depth_order

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

  • 2D 2D Layers – Display strokes using grease pencil layers to define order.

  • 3D 3D Location – Display strokes using real 3D position in 3D space.

Type:

enum in [‘2D’, ‘3D’], default ‘2D’

stroke_thickness_space

Set stroke thickness in screen space or world space

  • WORLDSPACE World Space – Set stroke thickness relative to the world space.

  • SCREENSPACE Screen Space – Set stroke thickness relative to the screen space.

Type:

enum in [‘WORLDSPACE’, ‘SCREENSPACE’], default ‘WORLDSPACE’

use_adaptive_curve_resolution

Set the resolution of each editcurve segment dynamically depending on the length of the segment. The resolution is the number of points generated per unit distance

Type:

boolean, default True

use_autolock_layers

Automatically lock all layers except the active one to avoid accidental changes

Type:

boolean, default False

use_curve_edit

Edit strokes using curve handles

Type:

boolean, default False

use_ghost_custom_colors

Use custom colors for ghost frames

Type:

boolean, default False

use_ghosts_always

Ghosts are shown in renders and animation playback. Useful for special effects (e.g. motion blur)

Type:

boolean, default False

use_multiedit

Edit strokes from multiple grease pencil keyframes at the same time (keyframes must be selected to be included)

Type:

boolean, default False

use_onion_fade

Display onion keyframes with a fade in color transparency

Type:

boolean, default False

use_onion_loop

Display onion keyframes for looping animations

Type:

boolean, default False

use_onion_skinning

Show ghosts of the keyframes before and after the current frame

Type:

boolean, default True

use_stroke_edit_mode

Edit Grease Pencil strokes instead of viewport data

Type:

boolean, default False

zdepth_offset

Offset amount when drawing in surface mode

Type:

float in [0, 1], default 0.15

clear()

Remove all the Grease Pencil 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