Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c1
-rw-r--r--source/blender/bmesh/operators/bmo_inset.c13
-rw-r--r--source/blender/editors/mesh/bmesh_tools.c9
3 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 7230e1d24fa..51f61326a88 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1089,6 +1089,7 @@ static BMOpDefine bmo_inset_def = {
{BMO_OP_SLOT_BOOL, "use_even_offset"},
{BMO_OP_SLOT_BOOL, "use_relative_offset"},
{BMO_OP_SLOT_FLT, "thickness"},
+ {BMO_OP_SLOT_BOOL, "use_outset"},
{0} /* null-terminating sentine */},
bmo_inset_exec,
0
diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c
index 6898f93e94c..04a39beec38 100644
--- a/source/blender/bmesh/operators/bmo_inset.c
+++ b/source/blender/bmesh/operators/bmo_inset.c
@@ -60,7 +60,8 @@ static void edge_loop_tangent(BMEdge *e, BMLoop *e_loop, float r_no[3])
void bmo_inset_exec(BMesh *bm, BMOperator *op)
{
- const int use_boundary = BMO_slot_bool_get(op, "use_boundary");
+ const int use_outset = BMO_slot_bool_get(op, "use_outset");
+ const int use_boundary = BMO_slot_bool_get(op, "use_boundary") && (use_outset == FALSE);
const int use_even_offset = BMO_slot_bool_get(op, "use_even_offset");
const int use_even_boundry = use_even_offset; /* could make own option */
const int use_relative_offset = BMO_slot_bool_get(op, "use_relative_offset");
@@ -77,8 +78,14 @@ void bmo_inset_exec(BMesh *bm, BMOperator *op)
BMFace *f;
int i, j, k;
- BM_mesh_elem_flag_disable_all(bm, BM_FACE, BM_ELEM_TAG);
- BMO_slot_buffer_hflag_enable(bm, op, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+ if (use_outset == FALSE) {
+ BM_mesh_elem_flag_disable_all(bm, BM_FACE, BM_ELEM_TAG);
+ BMO_slot_buffer_hflag_enable(bm, op, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+ }
+ else {
+ BM_mesh_elem_flag_enable_all(bm, BM_FACE, BM_ELEM_TAG);
+ BMO_slot_buffer_hflag_disable(bm, op, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
+ }
/* first count all inset edges we will split */
/* fill in array and initialize tagging */
diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c
index f95271cf30a..a75fccb4d3b 100644
--- a/source/blender/editors/mesh/bmesh_tools.c
+++ b/source/blender/editors/mesh/bmesh_tools.c
@@ -4581,11 +4581,12 @@ static int mesh_inset_exec(bContext *C, wmOperator *op)
const int use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
const int use_even_offset = RNA_boolean_get(op->ptr, "use_even_offset");
const int use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset");
- const float thickness = RNA_float_get(op->ptr, "thickness");
+ const float thickness = RNA_float_get(op->ptr, "thickness");
+ const int use_outset = RNA_boolean_get(op->ptr, "use_outset");
EDBM_InitOpf(em, &bmop, op,
- "inset faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b thickness=%f",
- BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, thickness);
+ "inset faces=%hf use_boundary=%b use_even_offset=%b use_relative_offset=%b thickness=%f use_outset=%b",
+ BM_ELEM_SELECT, use_boundary, use_even_offset, use_relative_offset, thickness, use_outset);
BMO_op_exec(em->bm, &bmop);
@@ -4629,4 +4630,6 @@ void MESH_OT_inset(wmOperatorType *ot)
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 */
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
+
+ RNA_def_boolean(ot->srna, "use_outset", FALSE, "Outset", "outset rather then inset");
}