Tool System: make smooth and randomize interactive

This commit is contained in:
Campbell Barton 2018-09-13 09:19:30 +10:00
parent 1f1802307f
commit 9e5259b043
Notes: blender-bot 2023-02-14 11:21:40 +01:00
Referenced by issue #60112, Smoothing crash with multiple views
Referenced by issue #57215, Randomize Tool Todo
Referenced by issue #57216, Smooth Tool Todo
3 changed files with 10 additions and 6 deletions

View File

@ -776,9 +776,10 @@ class _defs_edit_mesh:
return dict(
text="Smooth",
icon="ops.mesh.vertices_smooth",
widget=None,
widget="WM_GGT_value_operator_redo",
keymap=(
("mesh.vertices_smooth", dict(),
# Use 0.0, so dragging increases from nothing.
("mesh.vertices_smooth", dict(factor=0.0),
dict(type='ACTIONMOUSE', value='PRESS')),
),
)
@ -788,9 +789,10 @@ class _defs_edit_mesh:
return dict(
text="Randomize",
icon="ops.transform.vertex_random",
widget=None,
widget="WM_GGT_value_operator_redo",
keymap=(
("transform.vertex_random", dict(),
# Use 0.0, so dragging increases from nothing.
("transform.vertex_random", dict(offset=0.0),
dict(type='ACTIONMOUSE', value='PRESS')),
),
)

View File

@ -2230,7 +2230,7 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "factor", 0.5f, -10.0f, 10.0f, "Smoothing", "Smoothing factor", 0.0f, 1.0f);
ot->prop = RNA_def_float(ot->srna, "factor", 0.5f, -10.0f, 10.0f, "Smoothing", "Smoothing factor", 0.0f, 1.0f);
RNA_def_int(ot->srna, "repeat", 1, 1, 1000, "Repeat", "Number of times to smooth the mesh", 1, 100);
WM_operatortype_props_advanced_begin(ot);

View File

@ -139,7 +139,9 @@ void TRANSFORM_OT_vertex_random(struct wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
RNA_def_float(ot->srna, "offset", 0.1f, -FLT_MAX, FLT_MAX, "Amount", "Distance to offset", -10.0f, 10.0f);
ot->prop = RNA_def_float(
ot->srna, "offset", 0.1f, -FLT_MAX, FLT_MAX,
"Amount", "Distance to offset", -10.0f, 10.0f);
RNA_def_float(ot->srna, "uniform", 0.0f, 0.0f, 1.0f, "Uniform",
"Increase for uniform offset distance", 0.0f, 1.0f);
RNA_def_float(ot->srna, "normal", 0.0f, 0.0f, 1.0f, "normal",