user: How do I use Paint Operators in Blender? Include parameters, examples, warnings and best practices.

assistant: d** (*boolean**,* *(**optional**)*) – Sample Merged, Sample the output display color
        - **palette** (*boolean**,* *(**optional**)*) – Add to Palette

bpy.ops.paint.texture_paint_toggle()
:   Toggle texture paint mode in 3D view

bpy.ops.paint.vert_select_all(*\**, *action='TOGGLE'*)
:   Change selection for all vertices

    Parameters:
    :   **action** (enum in [`'TOGGLE'`, `'SELECT'`, `'DESELECT'`, `'INVERT'`], (optional)) –

        Action, Selection action to execute

        - `TOGGLE`
          Toggle – Toggle selection for all elements.
        - `SELECT`
          Select – Select all elements.
        - `DESELECT`
          Deselect – Deselect all elements.
        - `INVERT`
          Invert – Invert selection of all elements.

bpy.ops.paint.vert_select_hide(*\**, *unselected=False*)
:   Hide selected vertices

    Parameters:
    :   **unselected** (*boolean**,* *(**optional**)*) – Unselected, Hide unselected rather than selected vertices

bpy.ops.paint.vert_select_less(*\**, *face_step=True*)
:   Deselect Vertices connected to existing selection

    Parameters:
    :   **face_step** (*boolean**,* *(**optional**)*) – Face Step, Also deselect faces that only touch on a corner

bpy.ops.paint.vert_select_linked()
:   Select linked vertices

bpy.ops.paint.vert_select_linked_pick(*\**, *select=True*)
:   Select linked vertices under the cursor

    Parameters:
    :   **select** (*boolean**,* *(**optional**)*) – Select, Whether to select or deselect linked vertices under the cursor

bpy.ops.paint.vert_select_more(*\**, *face_step=True*)
:   Select Vertices connected to existing selection

    Parameters:
    :   **face_step** (*boolean**,* *(**optional**)*) – Face Step, Also select faces that only touch on a corner

bpy.ops.paint.vert_select_ungrouped(*\**, *extend=False*)
:   Select vertices without a group

    Parameters:
    :   **extend** (*boolean**,* *(**optional**)*) – Extend, Extend the selection

bpy.ops.paint.vertex_color_brightness_contrast(*\**, *brightness=0.0*, *contrast=0.0*)
:   Adjust vertex color brightness/contrast

    Parameters:
    :   - **brightness** (*float in* *[**-100**,* *100**]**,* *(**optional**)*) – Brightness
        - **contrast** (*float in* *[**-100**,* *100**]**,* *(**optional**)*) – Contrast

bpy.ops.paint.vertex_color_dirt(*\**, *blur_strength=1.0*, *blur_iterations=1*, *clean_angle=3.14159*, *dirt_angle=0.0*, *dirt_only=False*, *normalize=True*)
:   Generate a dirt map gradient based on cavity

    Parameters:
    :   - **blur_strength** (*float in* *[**0.01**,* *1**]**,* *(**optional**)*) – Blur Strength, Blur strength per iteration
        - **blur_iterations** (*int in* *[**0**,* *40**]**,* *(**optional**)*) – Blur Iterations, Number of times to blur the colors (higher blurs more)
        - **clean_angle** (*float in* *[**0**,* *3.14159**]**,* *(**optional**)*) – Highlight Angle, Less than 90 limits the angle used in the tonal range
        - **dirt_angle** (*float in* *[**0**,* *3.14159**]**,* *(**optional**)*) – Dirt Angle, Less than 90 limits the angle used in the tonal range
        - **dirt_only** (*boolean**,* *(**optional**)*) – Dirt Only, Don’t calculate cleans for convex areas
        - **normalize** (*boolean**,* *(**optional**)*) – Normalize, Normalize the colors, increasing the contrast

    File:
    :   [startup/bl_operators/vertexpaint_dirt.py:179](https://projects.blender.org/blender/blender/src/branch/main/scripts/startup/bl_operators/vertexpaint_dirt.py#L179)

bpy.ops.paint.vertex_color_from_weight()
:   Convert active weight into gray scale vertex colors

bpy.ops.paint.vertex_color_hsv(*\**, *h=0.5*, *s=1.0*, *v=1.0*)
:   Adjust vertex color Hue/Saturation/Value

    Parameters:
    :   - **h** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Hue
        - **s** (*float in* *[**0**,* *2**]**,* *(**optional**)*) – Saturation
        - **v** (*float in* *[**0**,* *2**]**,* *(**optional**)*) – Value

bpy.ops.paint.vertex_color_invert()
:   Invert RGB values

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

    Parameters:
    :   - **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.paint.vertex_color_set(*\**, *use_alpha=True*)
:   Fill the active vertex color layer with the current paint color

    Parameters:
    :   **use_alpha** (*boolean**,* *(**optional**)*) – Affect Alpha, Set color completely opaque instead of reusing existing alpha

bpy.ops.paint.vertex_color_smooth()
:   Smooth colors across vertices

bpy.ops.paint.vertex_paint(*\**, *stroke=None*, *mode='NORMAL'*, *pen_flip=False*, *override_location=False*)
:   Paint a stroke in the active color attribute layer

    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
        - **override_location** (*boolean**,* *(**optional**)*) – Override Location, Override the given “location” array by recalculating object space positions from the provided “mouse_event” positions

bpy.ops.paint.vertex_paint_toggle()
:   Toggle the vertex paint mode in 3D view

bpy.ops.paint.visibility_filter(*\**, *action='GROW'*, *iterations=1*, *auto_iteration_count=True*)
:   Edit the visibility of the current mesh

    Parameters:
    :   - **action** (enum in [`'GROW'`, `'SHRINK'`], (optional)) –

          Action

          - `GROW`
            Grow Visibility – Grow the visibility by one face based on mesh topology.
          - `SHRINK`
            Shrink Visibility – Shrink the visibility by one face based on mesh topology.
        - **iterations** (*int in* *[**1**,* *100**]**,* *(**optional**)*) – Iterations, Number of times that the filter is going to be applied
        - **auto_iteration_count** (*boolean**,* *(**optional**)*) – Auto Iteration Count, Use an automatic number of iterations based on the number of vertices of the sculpt

bpy.ops.paint.visibility_invert()
:   Invert the visibility of all vertices

bpy.ops.paint.weight_from_bones(*\**, *type='AUTOMATIC'*)
:   Set the weights of the groups matching the attached armature’s selected bones, using the distance between the vertices and the bones

    Parameters:
    :   **type** (enum in [`'AUTOMATIC'`, `'ENVELOPES'`], (optional)) –

        Type, Method to use for assigning weights

        - `AUTOMATIC`
          Automatic – Automatic weights from bones.
        - `ENVELOPES`
          From Envelopes – Weights from envelopes with user defined radius.

bpy.ops.paint.weight_gradient(*\**, *type='LINEAR'*, *xstart=0*, *xend=0*, *ystart=0*, *yend=0*, *flip=False*, *cursor=5*)
:   Draw a line to apply a weight gradient to selected vertices

    Parameters:
    :   - **type** (enum in [`'LINEAR'`, `'RADIAL'`], (optional)) – Type
        - **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.paint.weight_paint(*\**, *stroke=None*, *mode='NORMAL'*, *pen_flip=False*, *override_location=False*)
:   Paint a stroke in the current vertex group’s weights

    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
        - **override_location** (*boolean**,* *(**optional**)*) – Override Location, Override the given “location” array by recalculating object space positions from the provided “mouse_event” positions

bpy.ops.paint.weight_paint_toggle()
:   Toggle weight paint mode in 3D view

bpy.ops.paint.weight_sample()
:   Use the mouse to sample a weight in the 3D view

bpy.ops.paint.weight_sample_group()
:   Select one of the vertex groups available under current mouse position

bpy.ops.paint.weight_set()
:   Fill the active vertex group with the current paint weight