user: What is Grease Pencil Operators and how is it used in Blender Python scripting?

assistant:  Reset vertex color for all or selected strokes

    Parameters:
    :   **mode** (enum in [`'STROKE'`, `'FILL'`, `'BOTH'`], (optional)) – Mode

bpy.ops.grease_pencil.stroke_simplify(*\**, *factor=0.01*, *length=0.05*, *distance=0.01*, *steps=1*, *mode='FIXED'*)
:   Simplify selected strokes

    Parameters:
    :   - **factor** (*float in* *[**0**,* *100**]**,* *(**optional**)*) – Factor
        - **length** (*float in* *[**0.01**,* *100**]**,* *(**optional**)*) – Length
        - **distance** (*float in* *[**0**,* *100**]**,* *(**optional**)*) – Distance
        - **steps** (*int in* *[**0**,* *50**]**,* *(**optional**)*) – Steps
        - **mode** (enum in [`'FIXED'`, `'ADAPTIVE'`, `'SAMPLE'`, `'MERGE'`], (optional)) –

          Mode, Method used for simplifying stroke points

          - `FIXED`
            Fixed – Delete alternating vertices in the stroke, except extremes.
          - `ADAPTIVE`
            Adaptive – Use a Ramer-Douglas-Peucker algorithm to simplify the stroke preserving main shape.
          - `SAMPLE`
            Sample – Re-sample the stroke with segments of the specified length.
          - `MERGE`
            Merge – Simplify the stroke by merging vertices closer than a given distance.

bpy.ops.grease_pencil.stroke_smooth(*\**, *iterations=10*, *factor=1.0*, *smooth_ends=False*, *keep_shape=False*, *smooth_position=True*, *smooth_radius=True*, *smooth_opacity=False*)
:   Smooth selected strokes

    Parameters:
    :   - **iterations** (*int in* *[**1**,* *100**]**,* *(**optional**)*) – Iterations
        - **factor** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Factor
        - **smooth_ends** (*boolean**,* *(**optional**)*) – Smooth Endpoints
        - **keep_shape** (*boolean**,* *(**optional**)*) – Keep Shape
        - **smooth_position** (*boolean**,* *(**optional**)*) – Position
        - **smooth_radius** (*boolean**,* *(**optional**)*) – Radius
        - **smooth_opacity** (*boolean**,* *(**optional**)*) – Opacity

bpy.ops.grease_pencil.stroke_split()
:   Split selected points to a new stroke

bpy.ops.grease_pencil.stroke_subdivide(*\**, *number_cuts=1*, *only_selected=True*)
:   Subdivide between continuous selected points of the stroke adding a point half way between them

    Parameters:
    :   - **number_cuts** (*int in* *[**1**,* *32**]**,* *(**optional**)*) – Number of Cuts
        - **only_selected** (*boolean**,* *(**optional**)*) – Selected Points, Smooth only selected points in the stroke

bpy.ops.grease_pencil.stroke_subdivide_smooth(*\**, *GREASE_PENCIL_OT_stroke_subdivide=None*, *GREASE_PENCIL_OT_stroke_smooth=None*)
:   Subdivide strokes and smooth them

    Parameters:
    :   - **GREASE_PENCIL_OT_stroke_subdivide** (`GREASE_PENCIL_OT_stroke_subdivide`, (optional)) – Subdivide Stroke, Subdivide between continuous selected points of the stroke adding a point half way between them
        - **GREASE_PENCIL_OT_stroke_smooth** (`GREASE_PENCIL_OT_stroke_smooth`, (optional)) – Smooth Stroke, Smooth selected strokes

bpy.ops.grease_pencil.stroke_switch_direction()
:   Change direction of the points of the selected strokes

bpy.ops.grease_pencil.stroke_trim(*\**, *path=None*, *use_smooth_stroke=False*, *smooth_stroke_factor=0.75*, *smooth_stroke_radius=35*)
:   Delete stroke points in between intersecting strokes

    Parameters:
    :   - **path** (`bpy_prop_collection` of `OperatorMousePath`, (optional)) – Path
        - **use_smooth_stroke** (*boolean**,* *(**optional**)*) – Stabilize Stroke, Selection lags behind mouse and follows a smoother path
        - **smooth_stroke_factor** (*float in* *[**0.5**,* *0.99**]**,* *(**optional**)*) – Smooth Stroke Factor, Higher values gives a smoother stroke
        - **smooth_stroke_radius** (*int in* *[**10**,* *200**]**,* *(**optional**)*) – Smooth Stroke Radius, Minimum distance from last point before selection continues

bpy.ops.grease_pencil.texture_gradient(*\**, *xstart=0*, *xend=0*, *ystart=0*, *yend=0*, *flip=False*, *cursor=5*)
:   Draw a line to set the fill material gradient for the selected strokes

    Parameters:
    :   - **xstart** (*int in* *[**-inf**,* *inf**]**,* *(**optional**)*) – X Start
        - **xend** (*int in* *[**-inf**,* *inf**]**,* *(**optional**)*) – X End
        - **ystart** (*int in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Y Start
        - **yend** (*int in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Y End
        - **flip** (*boolean**,* *(**optional**)*) – Flip
        - **cursor** (*int in* *[**0**,* *inf**]**,* *(**optional**)*) – Cursor, Mouse cursor style to use during the modal operator

bpy.ops.grease_pencil.trace_image(*\**, *target='NEW'*, *radius=0.01*, *threshold=0.5*, *turnpolicy='MINORITY'*, *mode='SINGLE'*, *use_current_frame=True*, *frame_number=0*)
:   Extract Grease Pencil strokes from image

    Parameters:
    :   - **target** (enum in [`'NEW'`, `'SELECTED'`], (optional)) – Target Object, Target Grease Pencil
        - **radius** (*float in* *[**0.001**,* *1**]**,* *(**optional**)*) – Radius
        - **threshold** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Color Threshold, Determine the lightness threshold above which strokes are generated
        - **turnpolicy** (enum in [`'FOREGROUND'`, `'BACKGROUND'`, `'LEFT'`, `'RIGHT'`, `'MINORITY'`, `'MAJORITY'`, `'RANDOM'`], (optional)) –

          Turn Policy, Determines how to resolve ambiguities during decomposition of bitmaps into paths

          - `FOREGROUND`
            Foreground – Prefers to connect foreground components.
          - `BACKGROUND`
            Background – Prefers to connect background components.
          - `LEFT`
            Left – Always take a left turn.
          - `RIGHT`
            Right – Always take a right turn.
          - `MINORITY`
            Minority – Prefers to connect the color that occurs least frequently in the local neighborhood of the current position.
          - `MAJORITY`
            Majority – Prefers to connect the color that occurs most frequently in the local neighborhood of the current position.
          - `RANDOM`
            Random – Choose pseudo-randomly.
        - **mode** (enum in [`'SINGLE'`, `'SEQUENCE'`], (optional)) –

          Mode, Determines if trace simple image or full sequence

          - `SINGLE`
            Single – Trace the current frame of the image.
          - `SEQUENCE`
            Sequence – Trace full sequence.
        - **use_current_frame** (*boolean**,* *(**optional**)*) – Start At Current Frame, Trace Image starting in current image frame
        - **frame_number** (*int in* *[**0**,* *9999**]**,* *(**optional**)*) – Trace Frame, Used to trace only one frame of the image sequence, set to zero to trace all

bpy.ops.grease_pencil.vertex_brush_stroke(*\**, *stroke=None*, *mode='NORMAL'*, *pen_flip=False*)
:   Draw on vertex colors in the active Grease Pencil object

    Parameters:
    :   - **stroke** (`bpy_prop_collection` of `OperatorStrokeElement`, (optional)) – Stroke
        - **mode** (enum in [`'NORMAL'`, `'INVERT'`, `'SMOOTH'`, `'ERASE'`], (optional)) –

          Stroke Mode, Action taken when a paint stroke is made

          - `NORMAL`
            Regular – Apply brush normally.
          - `INVERT`
            Invert – Invert action of brush for duration of stroke.
          - `SMOOTH`
            Smooth – Switch brush to smooth mode for duration of stroke.
          - `ERASE`
            Erase – Switch brush to erase mode for duration of stroke.
        - **pen_flip** (*boolean**,* *(**optional**)*) – Pen Flip, Whether a tablet’s eraser mode is being used

bpy.ops.grease_pencil.vertex_color_brightness_contrast(*\**, *mode='BOTH'*, *brightness=0.0*, *contrast=0.0*)
:   Adjust vertex color brightness/contrast

    Parameters:
    :   - **mode** (enum in [`'STROKE'`, `'FILL'`, `'BOTH'`], (optional)) – Mode
        - **brightness** (*float in* *[**-1**,* *1**]**,* *(**optional**)*) – Brightness
        - **contrast** (*float in* *[**-1**,* *1**]**,* *(**optional**)*) – Contrast

bpy.ops.grease_pencil.vertex_color_hsv(*\**, *mode='BOTH'*, *h=0.5*, *s=1.0*, *v=1.0*)
:   Adjust vertex color HSV values

    Parameters:
    :   - **mode** (enum in [`'STROKE'`, `'FILL'`, `'BOTH'`], (optional)) – Mode
        - **h** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Hue
        - **s** (*float in* *[**0**,* *2**]**,* *(**optional**)*) – Saturation
        - **v** (*float in* *[**0**,* *2**]**,* *(**optional**)*) – Value

bpy.ops.grease_pencil.vertex_color_invert(*\**, *mode='BOTH'*)
:   Invert RGB values

    Parameters:
    :   **mode** (enum in [`'STROKE'`, `'FILL'`, `'BOTH'`], (optional)) – Mode

bpy.ops.grease_pencil.vertex_color_levels(*\**, *mode='BOTH'*, *offset=0.0*, *gain=1.0*)
:   Adjust levels of vertex colors

    Parameters:
    :   - **mode** (enum in [`'STROKE'`, `'FILL'`, `'BOTH'`], (optional)) – Mode
        - **offset** (*float in* *[**-1**,* *1**]**,* *(**optional**)*) – Offset, Value to add to colors
        - **gain** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Gain, Value to multiply colors by

bpy.ops.grease_pencil.vertex_color_set(*\**, *mode='BOTH'*, *factor=1.0*)
:   Set active color to all selected vertex

    Parameters:
    :   - **mode** (enum in [`'STROKE'`, `'FILL'`, `'BOTH'`], (optional)) – Mode
        - **factor** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Factor, Mix Factor

bpy.ops.grease_pencil.vertex_group_normalize()
:   Normalize weights of the active vertex group

bpy.ops.grease_pencil.vertex_group_normalize_all(*\**, *lock_active=True*)
:   Normalize the weights of all vertex groups, so that for each vertex, the sum of all weights is 1.0

    Parameters:
    :   **lock_active** (*boolean**,* *(**optional**)*) – Lock Active, Keep the values of the active group while normalizing others

bpy.ops.grease_pencil.vertex_group_smooth(*\**, *factor=0.5*, *repeat=1*)
:   Smooth the weights of the active vertex group

    Parameters:
    :   - **factor** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Factor
        - **repeat** (*int in* *[**1**,* *10000**]**,* *(**optional**)*) – Iterations

bpy.ops.grease_pencil.vertexmode_toggle(*\**, *back=False*)
:   Enter/Exit vertex paint mode for Grease Pencil strokes

    Parameters:
    :   **back** (*boolean**,* *(**optional**)*) – Return to Previous Mode, Return to previous mode

bpy.ops.grease_pencil.weight_brush_stroke(*\**, *stroke=None*, *mode='NORMAL'*, *pen_flip=False*)
:   Draw weight on stroke points in the active Grease Pencil object

    Parameters:
    :   - **stroke** (`bpy_prop_collection` of `OperatorStrokeElement`, (optional)) – Stroke
        - **mode** (enum in [`'NORMAL'`, `'INVERT'`, `'SMOOTH'`, `'ERASE'`], (optional)) –

          Stroke Mode, Action taken when a paint stroke is made

          - `NORMAL`
            Regular – Apply brush normally.
          - `INVERT`
            Invert – Invert action of brush for duration of stroke.
          - `SMOOTH`
            Smooth – Switch brush to smooth mode for duration of stroke.
          - `ERASE`
            Erase – Switch brush to erase mode for duration of stroke.
        - **pen_flip** (*boolean**,* *(**optional**)*) – Pen Flip, Whether a tablet’s eraser mode is being used

bpy.ops.grease_pencil.weight_invert()
:   Invert the weight of active vertex group

bpy.ops.grease_pencil.weight_sample()
:   Set the weight of the Draw tool to the weight of the vertex under the mouse cursor

bpy.ops.grease_pencil.weight_toggle_direction()
:   Toggle Add/Subtract for the weight paint draw tool

bpy.ops.grease_pencil.weightmode_toggle(*\**, *back=False*)
:   Enter/Exit weight paint mode for Grease Pencil strokes

    Parameters:
    :   **back** (*boolean**,* *(**optional**)*) – Return to Previous Mode, Return to previous mode