[Bf-blender-cvs] [96d5e05] master: Mesh Inset: following existing edges is now optional

Campbell Barton noreply at git.blender.org
Sat Feb 15 03:52:42 CET 2014


Commit: 96d5e05e4809f0a7526d9c8f2fc179ff8b3a777c
Author: Campbell Barton
Date:   Sat Feb 15 13:51:54 2014 +1100
https://developer.blender.org/rB96d5e05e4809f0a7526d9c8f2fc179ff8b3a777c

Mesh Inset: following existing edges is now optional

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

M	source/blender/bmesh/intern/bmesh_opdefines.c
M	source/blender/bmesh/operators/bmo_inset.c
M	source/blender/editors/mesh/editmesh_inset.c

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

diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index b469793..0c75597 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1673,6 +1673,7 @@ static BMOpDefine bmo_inset_region_def = {
 	 {"use_even_offset", BMO_OP_SLOT_BOOL},
 	 {"use_interpolate", BMO_OP_SLOT_BOOL},
 	 {"use_relative_offset", BMO_OP_SLOT_BOOL},
+	 {"use_edge_rail", BMO_OP_SLOT_BOOL},
 	 {"thickness", BMO_OP_SLOT_FLT},
 	 {"depth", BMO_OP_SLOT_FLT},
 	 {"use_outset", BMO_OP_SLOT_BOOL},
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c
index c79480d..a255c53 100644
--- a/source/blender/bmesh/operators/bmo_inset.c
+++ b/source/blender/bmesh/operators/bmo_inset.c
@@ -390,6 +390,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
 	const bool use_even_offset     = BMO_slot_bool_get(op->slots_in, "use_even_offset");
 	const bool use_even_boundry    = use_even_offset; /* could make own option */
 	const bool use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset");
+	const bool use_edge_rail       = BMO_slot_bool_get(op->slots_in, "use_edge_rail");
 	const bool use_interpolate     = BMO_slot_bool_get(op->slots_in, "use_interpolate");
 	const float thickness          = BMO_slot_float_get(op->slots_in, "thickness");
 	const float depth              = BMO_slot_float_get(op->slots_in, "depth");
@@ -616,7 +617,10 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
 							 * cross product between both face normals */
 							add_v3_v3v3(tvec, e_info_a->no, e_info_b->no);
 
-							if (f_a != f_b) {
+							if (use_edge_rail == false) {
+								/* pass */
+							}
+							else if (f_a != f_b) {
 								/* these lookups are very quick */
 								BMLoop *l_other_a = BM_loop_other_vert_loop(e_info_a->l, v_split);
 								BMLoop *l_other_b = BM_loop_other_vert_loop(e_info_b->l, v_split);
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 5f23a5d..2ca5301 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -196,6 +196,7 @@ static bool edbm_inset_calc(wmOperator *op)
 	const bool use_boundary        = RNA_boolean_get(op->ptr, "use_boundary");
 	const bool use_even_offset     = RNA_boolean_get(op->ptr, "use_even_offset");
 	const bool use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset");
+	const bool use_edge_rail       = RNA_boolean_get(op->ptr, "use_edge_rail");
 	const float thickness          = RNA_float_get(op->ptr,   "thickness");
 	const float depth              = RNA_float_get(op->ptr,   "depth");
 	const bool use_outset          = RNA_boolean_get(op->ptr, "use_outset");
@@ -220,9 +221,9 @@ static bool edbm_inset_calc(wmOperator *op)
 	else {
 		EDBM_op_init(em, &bmop, op,
 		             "inset_region faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b"
-		             " use_interpolate=%b thickness=%f depth=%f use_outset=%b",
+		             " use_interpolate=%b thickness=%f depth=%f use_outset=%b use_edge_rail=%b",
 		             BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, use_interpolate,
-		             thickness, depth, use_outset);
+		             thickness, depth, use_outset, use_edge_rail);
 	}
 	BMO_op_exec(em->bm, &bmop);
 
@@ -502,6 +503,7 @@ void MESH_OT_inset(wmOperatorType *ot)
 	RNA_def_boolean(ot->srna, "use_boundary",        true, "Boundary",  "Inset face boundaries");
 	RNA_def_boolean(ot->srna, "use_even_offset",     true, "Offset Even",      "Scale the offset to give more even thickness");
 	RNA_def_boolean(ot->srna, "use_relative_offset", false, "Offset Relative", "Scale the offset by surrounding geometry");
+	RNA_def_boolean(ot->srna, "use_edge_rail",     true, "Edge Rail", "Inset the region along existing edges");
 
 	prop = RNA_def_float(ot->srna, "thickness", 0.01f, 0.0f, FLT_MAX, "Thickness", "", 0.0f, 10.0f);
 	/* use 1 rather then 10 for max else dragging the button moves too far */




More information about the Bf-blender-cvs mailing list