Gpencil Operators

bpy.ops.gpencil.active_frame_delete()

Delete the active frame for the active Grease Pencil datablock

bpy.ops.gpencil.convert(type='PATH')

Convert the active Grease Pencil layer to a new Object

Parameters:type (enum in [‘PATH’, ‘CURVE’], (optional)) – Type
bpy.ops.gpencil.data_add()

Add new Grease Pencil datablock

Unlink active Grease Pencil datablock

bpy.ops.gpencil.draw(mode='DRAW', stroke=None)

Make annotations on the active data

Parameters:
  • mode (enum in [‘DRAW’, ‘DRAW_STRAIGHT’, ‘DRAW_POLY’, ‘ERASER’], (optional)) –

    Mode, Way to interpret mouse movements

    • DRAW Draw Freehand, Draw freehand stroke(s).
    • DRAW_STRAIGHT Draw Straight Lines, Draw straight line segment(s).
    • DRAW_POLY Draw Poly Line, Click to place endpoints of straight line segments (connected).
    • ERASER Eraser, Erase Grease Pencil strokes.
  • stroke (bpy_prop_collection of OperatorStrokeElement, (optional)) – Stroke
bpy.ops.gpencil.layer_add()

Add new Grease Pencil layer for the active Grease Pencil datablock

Previous topic

Font Operators

Next topic

Graph Operators