Sculpt Operators

bpy.ops.sculpt.brush_stroke(stroke=None, mode='NORMAL', ignore_background_click=False)

Sculpt a stroke into the geometry

Parameters
  • stroke (bpy_prop_collection of OperatorStrokeElement, (optional)) – Stroke

  • mode (enum in ['NORMAL', 'INVERT', 'SMOOTH'], (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.

  • ignore_background_click (boolean, (optional)) – Ignore Background Click, Clicks on the background do not start the stroke

bpy.ops.sculpt.detail_flood_fill()

Flood fill the mesh with the selected detail setting

bpy.ops.sculpt.dirty_mask(dirty_only=False)

Generates a mask based on the geometry cavity and pointiness

Parameters

dirty_only (boolean, (optional)) – Dirty Only, Don’t calculate cleans for convex areas

bpy.ops.sculpt.dynamic_topology_toggle()

Dynamic topology alters the mesh topology while sculpting

bpy.ops.sculpt.face_set_change_visibility(mode='TOGGLE')

Change the visibility of the Face Sets of the sculpt

Parameters

mode (enum in ['TOGGLE', 'SHOW_ACTIVE', 'HIDE_ACTIVE', 'INVERT', 'SHOW_ALL'], (optional)) –

Mode

  • TOGGLE Toggle Visibility, Hide all Face Sets except for the active one.

  • SHOW_ACTIVE Show Active Face Set, Show Active Face Set.

  • HIDE_ACTIVE Hide Active Face Sets, Hide Active Face Sets.

  • INVERT Invert Face Set Visibility, Invert Face Set Visibility.

  • SHOW_ALL Show All Face Sets, Show All Face Sets.

bpy.ops.sculpt.face_sets_create(mode='MASKED')

Create a new Face Set

Parameters

mode (enum in ['MASKED', 'VISIBLE', 'ALL', 'SELECTION'], (optional)) –

Mode

  • MASKED Face Set From Masked, Create a new Face Set from the masked faces.

  • VISIBLE Face Set From Visible, Create a new Face Set from the visible vertices.

  • ALL Face Set Full Mesh, Create an unique Face Set with all faces in the sculpt.

  • SELECTION Face Set From Edit Mode Selection, Create an Face Set corresponding to the Edit Mode face selection.

bpy.ops.sculpt.face_sets_init(mode='LOOSE_PARTS', threshold=0.5)

Initializes all Face Sets in the mesh

Parameters
  • mode (enum in ['LOOSE_PARTS', 'MATERIALS', 'NORMALS', 'UV_SEAMS', 'CREASES', 'BEVEL_WEIGHT', 'SHARP_EDGES', 'FACE_MAPS'], (optional)) –

    Mode

    • LOOSE_PARTS Face Sets From Loose Parts, Create a Face Set per loose part in the mesh.

    • MATERIALS Face Sets From Material Slots, Create a Face Set per Material Slot.

    • NORMALS Face Sets From Mesh Normals, Create Face Sets for Faces that have similar normal.

    • UV_SEAMS Face Sets From UV Seams, Create Face Sets using UV Seams as boundaries.

    • CREASES Face Sets From Edge Creases, Create Face Sets using Edge Creases as boundaries.

    • BEVEL_WEIGHT Face Sets From Bevel Weight, Create Face Sets using Bevel Weights as boundaries.

    • SHARP_EDGES Face Sets From Sharp Edges, Create Face Sets using Sharp Edges as boundaries.

    • FACE_MAPS Face Sets From Face Maps, Create a Face Set per Face Map.

  • threshold (float in [0, 1], (optional)) – Threshold, Minimum value to consider a certain attribute a boundary when creating the Face Sets

bpy.ops.sculpt.face_sets_randomize_colors()

Generates a new set of random colors to render the Face Sets in the viewport

bpy.ops.sculpt.mask_expand(invert=True, use_cursor=True, update_pivot=True, smooth_iterations=2, mask_speed=5, use_normals=True, keep_previous_mask=False, edge_sensitivity=300, create_face_set=False)

Expands a mask from the initial active vertex under the cursor

Parameters
  • invert (boolean, (optional)) – Invert, Invert the new mask

  • use_cursor (boolean, (optional)) – Use Cursor, Expand the mask to the cursor position

  • update_pivot (boolean, (optional)) – Update Pivot Position, Set the pivot position to the mask border after creating the mask

  • smooth_iterations (int in [0, 10], (optional)) – Smooth iterations

  • mask_speed (int in [1, 10], (optional)) – Mask speed

  • use_normals (boolean, (optional)) – Use Normals, Generate the mask using the normals and curvature of the model

  • keep_previous_mask (boolean, (optional)) – Keep Previous Mask, Generate the new mask on top of the current one

  • edge_sensitivity (int in [0, 2000], (optional)) – Edge Detection Sensitivity, Sensitivity for expanding the mask across sculpted sharp edges when using normals to generate the mask

  • create_face_set (boolean, (optional)) – Expand Face Mask, Expand a new Face Mask instead of the sculpt mask

bpy.ops.sculpt.mask_filter(filter_type='SMOOTH', iterations=1, auto_iteration_count=False)

Applies a filter to modify the current mask

Parameters
  • filter_type (enum in ['SMOOTH', 'SHARPEN', 'GROW', 'SHRINK', 'CONTRAST_INCREASE', 'CONTRAST_DECREASE'], (optional)) –

    Type, Filter that is going to be applied to the mask

    • SMOOTH Smooth Mask, Smooth mask.

    • SHARPEN Sharpen Mask, Sharpen mask.

    • GROW Grow Mask, Grow mask.

    • SHRINK Shrink Mask, Shrink mask.

    • CONTRAST_INCREASE Increase contrast, Increase the contrast of the paint mask.

    • CONTRAST_DECREASE Decrease contrast, Decrease the contrast of the paint mask.

  • 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 a automatic number of iterations based on the number of vertices of the sculpt

bpy.ops.sculpt.mesh_filter(type='INFLATE', strength=1.0, deform_axis={'X', 'Y', 'Z'}, use_face_sets=False, surface_smooth_shape_preservation=0.5, surface_smooth_current_vertex=0.5, sharpen_smooth_ratio=0.35)

Applies a filter to modify the current mesh

Parameters
  • type (enum in ['SMOOTH', 'SCALE', 'INFLATE', 'SPHERE', 'RANDOM', 'RELAX', 'RELAX_FACE_SETS', 'SURFACE_SMOOTH', 'SHARPEN'], (optional)) –

    Filter type, Operation that is going to be applied to the mesh

    • SMOOTH Smooth, Smooth mesh.

    • SCALE Scale, Scale mesh.

    • INFLATE Inflate, Inflate mesh.

    • SPHERE Sphere, Morph into sphere.

    • RANDOM Random, Randomize vertex positions.

    • RELAX Relax, Relax mesh.

    • RELAX_FACE_SETS Relax Face Sets, Smooth the edges of all the Face Sets.

    • SURFACE_SMOOTH Surface Smooth, Smooth the surface of the mesh, preserving the volume.

    • SHARPEN Sharpen, Sharpen the cavities of the mesh.

  • strength (float in [-10, 10], (optional)) – Strength, Filter Strength

  • deform_axis (enum set in {'X', 'Y', 'Z'}, (optional)) –

    Deform axis, Apply the deformation in the selected axis

    • X X, Deform in the X axis.

    • Y Y, Deform in the Y axis.

    • Z Z, Deform in the Z axis.

  • use_face_sets (boolean, (optional)) – Use Face Sets, Apply the filter only to the Face Mask under the cursor

  • surface_smooth_shape_preservation (float in [0, 1], (optional)) – Shape Preservation, How much of the original shape is preserved when smoothing

  • surface_smooth_current_vertex (float in [0, 1], (optional)) – Per Vertex Displacement, How much the position of each individual vertex influences the final result

  • sharpen_smooth_ratio (float in [0, 1], (optional)) – Smooth Ratio, How much smoothing is applied to polished surfaces

bpy.ops.sculpt.optimize()

Recalculate the sculpt BVH to improve performance

bpy.ops.sculpt.sample_detail_size(location=(0, 0), mode='DYNTOPO')

Sample the mesh detail on clicked point

Parameters
  • location (int array of 2 items in [0, 32767], (optional)) – Location, Screen Coordinates of sampling

  • mode (enum in ['DYNTOPO', 'VOXEL'], (optional)) –

    Detail Mode, Target sculpting workflow that is going to use the sampled size

    • DYNTOPO Dyntopo, Sample dyntopo detail.

    • VOXEL Voxel, Sample mesh voxel size.

bpy.ops.sculpt.sculptmode_toggle()

Toggle sculpt mode in 3D view

bpy.ops.sculpt.set_detail_size()

Set the mesh detail (either relative or constant one, depending on current dyntopo mode)

bpy.ops.sculpt.set_persistent_base()

Reset the copy of the mesh that is being sculpted on

bpy.ops.sculpt.set_pivot_position(mode='UNMASKED', mouse_x=0.0, mouse_y=0.0)

Sets the sculpt transform pivot position

Parameters
  • mode (enum in ['ORIGIN', 'UNMASKED', 'BORDER', 'ACTIVE', 'SURFACE'], (optional)) –

    Mode

    • ORIGIN Origin, Sets the pivot to the origin of the sculpt.

    • UNMASKED Unmasked, Sets the pivot position to the average position of the unmasked vertices.

    • BORDER Mask border, Sets the pivot position to the center of the border of the mask.

    • ACTIVE Active vertex, Sets the pivot position to the active vertex position.

    • SURFACE Surface, Sets the pivot position to the surface under the cursor.

  • mouse_x (float in [0, inf], (optional)) – Mouse Position X, Position of the mouse used for “Surface” mode

  • mouse_y (float in [0, inf], (optional)) – Mouse Position Y, Position of the mouse used for “Surface” mode

bpy.ops.sculpt.symmetrize(merge_tolerance=0.001)

Symmetrize the topology modifications

Parameters

merge_tolerance (float in [0, inf], (optional)) – Merge Limit, Distance within which symmetrical vertices are merged

bpy.ops.sculpt.uv_sculpt_stroke(mode='NORMAL')

Sculpt UVs using a brush

Parameters

mode (enum in ['NORMAL', 'INVERT', 'RELAX'], (optional)) –

Mode, Stroke Mode

  • NORMAL Regular, Apply brush normally.

  • INVERT Invert, Invert action of brush for duration of stroke.

  • RELAX Relax, Switch brush to relax mode for duration of stroke.