Paint Operators

bpy.ops.paint.brush_select(paint_mode='ACTIVE', sculpt_tool='BLOB', vertex_paint_tool='MIX', weight_paint_tool='MIX', texture_paint_tool='DRAW', toggle=False, create_missing=False)

Select a paint mode’s brush by tool type

Parameters:
  • paint_mode (enum in [‘ACTIVE’, ‘SCULPT’, ‘VERTEX_PAINT’, ‘WEIGHT_PAINT’, ‘TEXTURE_PAINT’], (optional)) –

    Paint Mode

    • ACTIVE Current, Set brush for active paint mode.
    • SCULPT Sculpt.
    • VERTEX_PAINT Vertex Paint.
    • WEIGHT_PAINT Weight Paint.
    • TEXTURE_PAINT Texture Paint.
  • sculpt_tool (enum in [‘BLOB’, ‘CLAY’, ‘CLAY_STRIPS’, ‘CREASE’, ‘DRAW’, ‘FILL’, ‘FLATTEN’, ‘GRAB’, ‘INFLATE’, ‘LAYER’, ‘MASK’, ‘NUDGE’, ‘PINCH’, ‘ROTATE’, ‘SCRAPE’, ‘SMOOTH’, ‘SNAKE_HOOK’, ‘THUMB’], (optional)) – Sculpt Tool
  • vertex_paint_tool (enum in [‘MIX’, ‘ADD’, ‘SUB’, ‘MUL’, ‘BLUR’, ‘LIGHTEN’, ‘DARKEN’], (optional)) –

    Vertex Paint Tool

    • MIX Mix, Use mix blending mode while painting.
    • ADD Add, Use add blending mode while painting.
    • SUB Subtract, Use subtract blending mode while painting.
    • MUL Multiply, Use multiply blending mode while painting.
    • BLUR Blur, Blur the color with surrounding values.
    • LIGHTEN Lighten, Use lighten blending mode while painting.
    • DARKEN Darken, Use darken blending mode while painting.
  • weight_paint_tool (enum in [‘MIX’, ‘ADD’, ‘SUB’, ‘MUL’, ‘BLUR’, ‘LIGHTEN’, ‘DARKEN’], (optional)) –

    Weight Paint Tool

    • MIX Mix, Use mix blending mode while painting.
    • ADD Add, Use add blending mode while painting.
    • SUB Subtract, Use subtract blending mode while painting.
    • MUL Multiply, Use multiply blending mode while painting.
    • BLUR Blur, Blur the color with surrounding values.
    • LIGHTEN Lighten, Use lighten blending mode while painting.
    • DARKEN Darken, Use darken blending mode while painting.
  • texture_paint_tool (enum in [‘DRAW’, ‘SOFTEN’, ‘SMEAR’, ‘CLONE’], (optional)) – Texture Paint Tool
  • toggle (boolean, (optional)) – Toggle, Toggle between two brushes rather than cycling
  • create_missing (boolean, (optional)) – Create Missing, If the requested brush type does not exist, create a new brush
bpy.ops.paint.clone_cursor_set(location=(0.0, 0.0, 0.0))

Set the location of the clone cursor

Parameters:location (float array of 3 items in [-inf, inf], (optional)) – Location, Cursor location in world space coordinates
bpy.ops.paint.face_select_all(action='TOGGLE')

Change selection for all faces

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.face_select_hide(unselected=False)

Hide selected faces

Parameters:unselected (boolean, (optional)) – Unselected, Hide unselected rather than selected objects
bpy.ops.paint.face_select_inverse()

Invert selection of faces

bpy.ops.paint.face_select_linked()

Select linked faces

bpy.ops.paint.face_select_linked_pick(extend=False)

Select linked faces

Parameters:extend (boolean, (optional)) – Extend, Extend the existing selection
bpy.ops.paint.face_select_reveal(unselected=False)

Reveal hidden faces

Parameters:unselected (boolean, (optional)) – Unselected, Hide unselected rather than selected objects
bpy.ops.paint.grab_clone(delta=(0.0, 0.0))

Move the clone source image

Parameters:delta (float array of 2 items in [-inf, inf], (optional)) – Delta, Delta offset of clone image in 0.0..1.0 coordinates
bpy.ops.paint.hide_show(action='HIDE', area='INSIDE', xmin=0, xmax=0, ymin=0, ymax=0)

Hide/show some vertices

Parameters:
  • action (enum in [‘HIDE’, ‘SHOW’], (optional)) –

    Action, Whether to hide or show vertices

    • HIDE Hide, Hide vertices.
    • SHOW Show, Show vertices.
  • area (enum in [‘OUTSIDE’, ‘INSIDE’, ‘ALL’, ‘MASKED’], (optional)) –

    Area, Which vertices to hide or show

    • OUTSIDE Outside, Hide or show vertices outside the selection.
    • INSIDE Inside, Hide or show vertices inside the selection.
    • ALL All, Hide or show all vertices.
    • MASKED Masked, Hide or show vertices that are masked (minimum mask value of 0.5).
  • xmin (int in [-inf, inf], (optional)) – X Min
  • xmax (int in [-inf, inf], (optional)) – X Max
  • ymin (int in [-inf, inf], (optional)) – Y Min
  • ymax (int in [-inf, inf], (optional)) – Y Max
bpy.ops.paint.image_from_view(filepath="")

Make an image from the current 3D view for re-projection

Parameters:filepath (string, (optional, never None)) – File Path, Name of the file
bpy.ops.paint.image_paint(stroke=None)

Paint a stroke into the image

Parameters:stroke (bpy_prop_collection of OperatorStrokeElement, (optional)) – Stroke
bpy.ops.paint.mask_flood_fill(mode='VALUE', value=0.0)

Undocumented (contribute)

Parameters:
  • mode (enum in [‘VALUE’, ‘INVERT’], (optional)) –

    Mode

    • VALUE Value, Set mask to the level specified by the “value” property.
    • INVERT Invert, Invert the mask.
  • value (float in [0, 1], (optional)) – Value, Mask level to use when mode is “Value”; zero means no masking and one is fully masked
bpy.ops.paint.project_image(image='')

Project an edited render from the active camera back onto the object

Parameters:image (enum in [], (optional)) – Image
bpy.ops.paint.sample_color(location=(0, 0))

Use the mouse to sample a color in the image

Parameters:location (int array of 2 items in [0, inf], (optional)) – Location, Cursor location in region coordinates
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_inverse()

Invert selection of vertices

bpy.ops.paint.vertex_color_dirt(blur_strength=1.0, blur_iterations=1, clean_angle=180.0, dirt_angle=0.0, dirt_only=False)

Undocumented (contribute)

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, 180], (optional)) – Highlight Angle, Less than 90 limits the angle used in the tonal range
  • dirt_angle (float in [0, 180], (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
File :

startup/bl_operators/vertexpaint_dirt.py:174

bpy.ops.paint.vertex_color_set()

Fill the active vertex color layer with the current paint color

bpy.ops.paint.vertex_paint(stroke=None)

Paint a stroke in the active vertex color layer

Parameters:stroke (bpy_prop_collection of OperatorStrokeElement, (optional)) – Stroke
bpy.ops.paint.vertex_paint_toggle()

Toggle the vertex paint mode in 3D view

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_paint(stroke=None)

Paint a stroke in the current vertex group’s weights

Parameters:stroke (bpy_prop_collection of OperatorStrokeElement, (optional)) – Stroke
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(group='DEFAULT')

Select one of the vertex groups available under current mouse position

Parameters:group (enum in [‘DEFAULT’], (optional)) – Keying Set, The Keying Set to use
bpy.ops.paint.weight_set()

Fill the active vertex group with the current paint weight

Previous topic

Outliner Operators

Next topic

Particle Operators