[Bf-blender-cvs] [9e5259b0434] blender2.8: Tool System: make smooth and randomize interactive

Campbell Barton noreply at git.blender.org
Thu Sep 13 01:16:10 CEST 2018


Commit: 9e5259b0434550a40c08042524fca6b4bb1a07ee
Author: Campbell Barton
Date:   Thu Sep 13 09:19:30 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB9e5259b0434550a40c08042524fca6b4bb1a07ee

Tool System: make smooth and randomize interactive

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/editors/object/object_random.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index f958221ea2e..f304d179d5f 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -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')),
             ),
         )
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 6784d5f7c9a..5793fae79fe 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -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);
diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c
index 05726e5be2d..41eba6dd07f 100644
--- a/source/blender/editors/object/object_random.c
+++ b/source/blender/editors/object/object_random.c
@@ -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",



More information about the Bf-blender-cvs mailing list