# GreasePencil(ID)

base classes — `bpy_struct`, `ID`

class `bpy.types.``GreasePencil`(ID)

  Freehand annotation sketchbook

  `animation_data`

    Animation data for this data-block

    Type: | `AnimData`, (readonly)

  `draw_mode`
    - `CURSOR` Cursor, Draw stroke at the 3D cursor.
    - `VIEW` View, Stick stroke to the view .
    - `SURFACE` Surface, Stick stroke to surfaces.
    - `STROKE` Stroke, Stick stroke to other strokes.

    Type: | enum in [‘CURSOR’, ‘VIEW’, ‘SURFACE’, ‘STROKE’], default ‘VIEW’

  `layers`

    Type: | `GreasePencilLayers` `bpy_prop_collection` of `GPencilLayer`, (readonly)

  `use_stroke_edit_mode`

    Enable alternative keymap to make editing stroke points easier

    Type: | boolean, default False

  `use_stroke_endpoints`

    Only use the first and last parts of the stroke for snapping

    Type: | boolean, default False

  `clear`()

    Remove all the grease pencil data

Inherited Properties

`bpy_struct.id_data` `ID.name` `ID.users` `ID.use_fake_user` `ID.tag` | `ID.is_updated` `ID.is_updated_data` `ID.is_library_indirect` `ID.library` `ID.preview`

Inherited Functions

`bpy_struct.as_pointer` `bpy_struct.driver_add` `bpy_struct.driver_remove` `bpy_struct.get` `bpy_struct.is_property_hidden` `bpy_struct.is_property_readonly` `bpy_struct.is_property_set` `bpy_struct.items` `bpy_struct.keyframe_delete` `bpy_struct.keyframe_insert` `bpy_struct.keys` | `bpy_struct.path_from_id` `bpy_struct.path_resolve` `bpy_struct.property_unset` `bpy_struct.type_recast` `bpy_struct.values` `ID.copy` `ID.user_clear` `ID.animation_data_create` `ID.animation_data_clear` `ID.update_tag`

References

`BlendData.grease_pencil` `BlendDataGreasePencils.new` `BlendDataGreasePencils.remove` `MovieClip.grease_pencil` `MovieTrackingTrack.grease_pencil` | `NodeTree.grease_pencil` `Object.grease_pencil` `Scene.grease_pencil` `SpaceImageEditor.grease_pencil` `SpaceSequenceEditor.grease_pencil`