[Bf-blender-cvs] [4697e491b43] blender-v2.79b-release: Fix T54206: bevel and inset operations repeat did not remember offset.

Brecht Van Lommel noreply at git.blender.org
Mon Mar 19 11:37:46 CET 2018


Commit: 4697e491b436c6e725d56b83d2c2ec282c3747b2
Author: Brecht Van Lommel
Date:   Wed Mar 7 22:19:56 2018 +0100
Branches: blender-v2.79b-release
https://developer.blender.org/rB4697e491b436c6e725d56b83d2c2ec282c3747b2

Fix T54206: bevel and inset operations repeat did not remember offset.

Now repeating the operator will use the previously chosen offset, either with
the modal operator or typed in. The modal operator will still start at zero.

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

M	source/blender/editors/mesh/editmesh_bevel.c
M	source/blender/editors/mesh/editmesh_inset.c

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

diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 84f932aee35..7bdefedc194 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -140,6 +140,10 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
 		return false;
 	}
 
+	if (is_modal) {
+		RNA_float_set(op->ptr, "offset", 0.0f);
+	}
+
 	op->customdata = opdata = MEM_mallocN(sizeof(BevelData), "beveldata_mesh_operator");
 
 	opdata->em = em;
@@ -623,7 +627,6 @@ void MESH_OT_bevel(wmOperatorType *ot)
 	RNA_def_enum(ot->srna, "offset_type", offset_type_items, 0, "Amount Type", "What distance Amount measures");
 	prop = RNA_def_float(ot->srna, "offset", 0.0f, -1e6f, 1e6f, "Amount", "", 0.0f, 1.0f);
 	RNA_def_property_float_array_funcs_runtime(prop, NULL, NULL, mesh_ot_bevel_offset_range_func);
-	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 	RNA_def_int(ot->srna, "segments", 1, 1, SEGMENTS_HARD_MAX, "Segments", "Segments for curved edge", 1, 8);
 	RNA_def_float(ot->srna, "profile", 0.5f, PROFILE_HARD_MIN, 1.0f, "Profile",
 		"Controls profile shape (0.5 = round)", PROFILE_HARD_MIN, 1.0f);
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 174d1f38a8d..da631644ee4 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -120,6 +120,11 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
 		return false;
 	}
 
+	if (is_modal) {
+		RNA_float_set(op->ptr, "thickness", 0.01f);
+		RNA_float_set(op->ptr, "depth", 0.0f);
+	}
+
 	op->customdata = opdata = MEM_mallocN(sizeof(InsetData), "inset_operator_data");
 
 	opdata->old_thickness = 0.01;
@@ -516,11 +521,9 @@ void MESH_OT_inset(wmOperatorType *ot)
 	prop = RNA_def_float_distance(ot->srna, "thickness", 0.01f, 0.0f, 1e12f, "Thickness", "", 0.0f, 10.0f);
 	/* use 1 rather then 10 for max else dragging the button moves too far */
 	RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
-	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 
 	prop = RNA_def_float_distance(ot->srna, "depth", 0.0f, -1e12f, 1e12f, "Depth", "", -10.0f, 10.0f);
 	RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.01, 4);
-	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 
 	RNA_def_boolean(ot->srna, "use_outset", false, "Outset", "Outset rather than inset");
 	RNA_def_boolean(ot->srna, "use_select_inset", false, "Select Outer", "Select the new inset faces");



More information about the Bf-blender-cvs mailing list