diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-12-01 02:58:09 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-12-01 03:09:38 +0300 |
commit | b29ee36f6ad1246d8c48aadc0992d76a2c598a0e (patch) | |
tree | dc1ebc60e672e9aa6e739224e6b8b6e0be926aa8 /source/blender/editors/mesh/editmesh_add.c | |
parent | 09fdacdb397b26cd7cde869e8f31d4f4f147f25a (diff) |
Fix T46900: Inset Faces Thickness & Depth Do Not Use Scene Units (i.e. Imperial).
Was the case of several Mesh operators actually (and probably others, but cannot check
everything). Added `RNA_def_property_float_distance` helper, avoids having to
set PROP_DISTANCE subtype explicitly each time...
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index e073a255f73..49383356b75 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -284,8 +284,6 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) void MESH_OT_primitive_cylinder_add(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name = "Add Cylinder"; ot->description = "Construct a cylinder mesh"; @@ -301,8 +299,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot) /* props */ RNA_def_int(ot->srna, "vertices", 32, 3, MESH_ADD_VERTS_MAXI, "Vertices", "", 3, 500); ED_object_add_unit_props(ot); - prop = RNA_def_float(ot->srna, "depth", 2.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Depth", "", 0.001, 100.00); - RNA_def_property_subtype(prop, PROP_DISTANCE); + RNA_def_float_distance(ot->srna, "depth", 2.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Depth", "", 0.001, 100.00); RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Cap Fill Type", ""); ED_object_add_generic_props(ot, true); @@ -341,8 +338,6 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) void MESH_OT_primitive_cone_add(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name = "Add Cone"; ot->description = "Construct a conic mesh"; @@ -357,12 +352,9 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot) /* props */ RNA_def_int(ot->srna, "vertices", 32, 3, MESH_ADD_VERTS_MAXI, "Vertices", "", 3, 500); - prop = RNA_def_float(ot->srna, "radius1", 1.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Radius 1", "", 0.001, 100.00); - RNA_def_property_subtype(prop, PROP_DISTANCE); - prop = RNA_def_float(ot->srna, "radius2", 0.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Radius 2", "", 0.001, 100.00); - RNA_def_property_subtype(prop, PROP_DISTANCE); - prop = RNA_def_float(ot->srna, "depth", 2.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Depth", "", 0.001, 100.00); - RNA_def_property_subtype(prop, PROP_DISTANCE); + RNA_def_float_distance(ot->srna, "radius1", 1.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Radius 1", "", 0.001, 100.00); + RNA_def_float_distance(ot->srna, "radius2", 0.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Radius 2", "", 0.001, 100.00); + RNA_def_float_distance(ot->srna, "depth", 2.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Depth", "", 0.001, 100.00); RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Base Fill Type", ""); ED_object_add_generic_props(ot, true); @@ -501,8 +493,6 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name = "Add UV Sphere"; ot->description = "Construct a UV sphere mesh"; @@ -518,8 +508,7 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot) /* props */ RNA_def_int(ot->srna, "segments", 32, 3, MESH_ADD_VERTS_MAXI / 100, "Segments", "", 3, 500); RNA_def_int(ot->srna, "ring_count", 16, 3, MESH_ADD_VERTS_MAXI / 100, "Rings", "", 3, 500); - prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Size", "", 0.001, 100.00); - RNA_def_property_subtype(prop, PROP_DISTANCE); + RNA_def_float_distance(ot->srna, "size", 1.0f, 0.0, OBJECT_ADD_SIZE_MAXF, "Size", "", 0.001, 100.00); ED_object_add_generic_props(ot, true); } @@ -554,8 +543,6 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name = "Add Ico Sphere"; ot->description = "Construct an Icosphere mesh"; @@ -570,8 +557,7 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) /* props */ RNA_def_int(ot->srna, "subdivisions", 2, 1, 10, "Subdivisions", "", 1, 8); - prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0f, OBJECT_ADD_SIZE_MAXF, "Size", "", 0.001f, 100.00); - RNA_def_property_subtype(prop, PROP_DISTANCE); + RNA_def_float_distance(ot->srna, "size", 1.0f, 0.0f, OBJECT_ADD_SIZE_MAXF, "Size", "", 0.001f, 100.00); ED_object_add_generic_props(ot, true); } |