Units: Use correct units for transform operators
authorWilliam Reynish <billrey@me.com>
Wed, 20 Feb 2019 20:10:32 +0000 (21:10 +0100)
committerWilliam Reynish <billrey@me.com>
Wed, 20 Feb 2019 20:10:32 +0000 (21:10 +0100)
-Use distance for Shrink/Fatten Distance
-Use factor for Smooth Factor
-Use Factor for Randomize Uniform and Normal values
-Use Distance for Randomize distance amount
-Randomize Transform Scale was wrongly using distance

release/scripts/startup/bl_operators/object_randomize_transform.py
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_random.c
source/blender/editors/transform/transform_ops.c

index 6c4531a468bfa93a2f06bab4ebd0a941b359d422..1e6aea45d89c2c8eb0949390b7fd63b364015110 100644 (file)
@@ -167,7 +167,6 @@ class RandomizeLocRotSize(Operator):
         min=-100.0,
         max=100.0,
         default=(1.0, 1.0, 1.0),
-        subtype='TRANSLATION',
     )
 
     def execute(self, context):
index 3120099693ff4c089307027a24b8472f9a714b00..ae2abc58a0c03f3e325e14098b2bbb81939899a7 100644 (file)
@@ -2229,7 +2229,7 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-       ot->prop = RNA_def_float(ot->srna, "factor", 0.5f, -10.0f, 10.0f, "Smoothing", "Smoothing factor", 0.0f, 1.0f);
+       ot->prop = RNA_def_float_factor(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);
index 73067be55c7ab109a354b976b99bdd640a601506..7c176318c5753f489b675c638cba13c65a02cad1 100644 (file)
@@ -158,12 +158,12 @@ void TRANSFORM_OT_vertex_random(struct wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* props */
-       ot->prop = RNA_def_float(
+       ot->prop = RNA_def_float_distance(
                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",
+       RNA_def_float_factor(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",
+       RNA_def_float_factor(ot->srna, "normal",  0.0f, 0.0f, 1.0f, "Normal",
                      "Align offset direction to normals", 0.0f, 1.0f);
        RNA_def_int(ot->srna, "seed", 0, 0, 10000, "Random Seed", "Seed for the random number generator", 0, 50);
 }
index ace68bfe3a7ebbec84964081693b1575eda4c24a..46ab11cee7b268250f25c4d475a967c4d791c5a3 100644 (file)
@@ -890,7 +890,7 @@ static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot)
        ot->poll   = ED_operator_editmesh;
        ot->poll_property = transform_poll_property;
 
-       RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
+       RNA_def_float_distance(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
 
        RNA_def_boolean(ot->srna, "use_even_offset", false, "Offset Even", "Scale the offset to give more even thickness");