Bpy Ops sculpt mesh filters. Get access to strength value?

In sculpt mode we have a bpy.ops.sculpt.mesh_filter(type='various types ')
Normally we need to chose mesh filter Tool, and when click in any place on 3d viewport and drag mouse on the right which will basically set how much filter will affect the mesh.

As example, for inflate filter after we drag the mose and release LMB we will have on info tab:
bpy.ops.sculpt.mesh_filter(type=‘INFLATE’, orientation=‘LOCAL’)

So unfortunately where’s nothing to define how much the filter shoud affect the mesh.
In case of extrude in edit mode we will have some extrusion values and can use extrude operator with predifined values.

Is there a way to predifine some strength value of how much the filter should be affect the mesh, i.e. basically set some value without the need to drag mouse?
So, something like:
bpy.ops.sculpt.mesh_filter(type=‘INFLATE’, orientation=‘LOCAL’, value = ‘15’)

1 Like

The argument for setting a mesh filter, type inflate strength value is… strength. :slightly_smiling_face:

bpy.ops.sculpt.mesh_filter(type='INFLATE', strength=1.0, deform_axis={'X', 'Y', 'Z'}, orientation='LOCAL', surface_smooth_shape_preservation=0.5, surface_smooth_current_vertex=0.5, sharpen_smooth_ratio=0.35, sharpen_intensify_detail_strength=0.0, sharpen_curvature_smooth_iterations=0)

Documentation: https://docs.blender.org/api/3.3/bpy.ops.sculpt.html#bpy.ops.sculpt.mesh_filter

Yes, but its not what im talking about.
I was mean the “strength” of “value” of how much exactly mesh filter will affect the mesh in the end, which not defined by any values in bpy operator, but defined by LBM+mouse drag to the left.

As example:
When you use Extrude on some faces you operate with those yellow gizmo/MMB, whatewer. By dragging mouse you define the distance (“strength”) of how much the face will be extruded.
Aafter this you can simply copy&paste operator from info tab and get something lilke:


bpy.ops.mesh.extrude_context_move(MESH_OT_extrude_context={“use_normal_flip”:False, “use_dissolve_ortho_edges”:False, “mirror”:False}, TRANSFORM_OT_translate={“value”:(0, 0, 0.302828), “orient_axis_ortho”:‘X’, “orient_type”:‘NORMAL’, “orient_matrix”:((0, 1, 0), (-1, 0, 0), (0, 0, 1)), “orient_matrix_type”:‘NORMAL’, “constraint_axis”:(False, False, True), “mirror”:False, “use_proportional_edit”:False, “proportional_edit_falloff”:‘SMOOTH’, “proportional_size”:1, “use_proportional_connected”:False, “use_proportional_projected”:False, “snap”:False, “snap_target”:‘CLOSEST’, “snap_point”:(0, 0, 0), “snap_align”:False, “snap_normal”:(0, 0, 0), “gpencil_strokes”:False, “cursor_transform”:False, “texture_space”:False, “remove_on_cancel”:False, “view2d_edge_pan”:False, “release_confirm”:True, “use_accurate”:False, “use_automerge_and_split”:False})

Now you can simply copy&paste whose operator + all the settings and extrude any faces by simply run operator again. You dont need to pick Extrude tool from toolbar. You dont need to move you mouse, cause you already have operator argument which tells exactly how much to extrude → TRANSFORM_OT_translate={“value”:(0, 0, 0.302828)

When you use mesh filter with any settings for Strength, which are already shown in UI, the resulted effect of the filter are defined by LMB click + dragging mouse to the right.
But those info about how much you drag the cursor are not presended in any way in info.

As example, here the result in info tab after some inflate filter:
bpy.ops.sculpt.mesh_filter(type=‘INFLATE’, strength=10)

As you can see in doesnt tell anything. The strength 10 are only tell us what strength was set in UI, but depend on how far i move the mouse the result would be different.