Page MenuHome

bisect_split_v2.patch

File Metadata

Author
Martin Felke (scorpion81)
Created
Nov 13 2013, 5:16 PM

bisect_split_v2.patch

Index: source/blender/editors/mesh/editmesh_bisect.c
===================================================================
--- source/blender/editors/mesh/editmesh_bisect.c (Revision 60953)
+++ source/blender/editors/mesh/editmesh_bisect.c (Arbeitskopie)
@@ -194,6 +194,9 @@
const bool use_fill = RNA_boolean_get(op->ptr, "use_fill");
const bool clear_inner = RNA_boolean_get(op->ptr, "clear_inner");
const bool clear_outer = RNA_boolean_get(op->ptr, "clear_outer");
+ const bool use_split = RNA_boolean_get(op->ptr, "use_split");
+ const int mat_nr = RNA_int_get(op->ptr, "mat_nr");
+ const bool use_smooth = RNA_boolean_get(op->ptr, "use_smooth");
PropertyRNA *prop_plane_co;
PropertyRNA *prop_plane_no;
@@ -252,7 +255,7 @@
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- if (use_fill) {
+ if (use_fill && !use_split) {
float normal_fill[3];
BMOperator bmop_fill;
BMOperator bmop_attr;
@@ -280,6 +283,29 @@
BMO_op_finish(bm, &bmop_attr);
BMO_op_finish(bm, &bmop_fill);
}
+
+ if (use_split) {
+ BMOperator bmop_split;
+ BMOperator bmop_fill;
+
+ /* Split */
+ BMO_op_initf(bm, &bmop_split, op->flag,
+ "split_edges edges=%S verts=%S use_verts=%b",
+ &bmop, "geom_cut.out", &bmop, "geom_cut.out", false);
+ BMO_op_exec(bm, &bmop_split);
+
+ if (use_fill)
+ {
+ /* Fill */
+ BMO_op_initf(bm, &bmop_fill, op->flag,
+ "edgenet_fill edges=%S mat_nr=%i use_smooth=%b sides=%i",
+ &bmop_split, "edges.out", mat_nr, use_smooth, 1);
+ BMO_op_exec(bm, &bmop_fill);
+ BMO_op_finish(bm, &bmop_fill);
+ }
+
+ BMO_op_finish(bm, &bmop_split);
+ }
BMO_slot_buffer_hflag_enable(bm, bmop.slots_out, "geom_cut.out", BM_VERT | BM_EDGE, BM_ELEM_SELECT, true);
@@ -324,6 +350,9 @@
RNA_def_boolean(ot->srna, "use_fill", false, "Fill", "Fill in the cut");
RNA_def_boolean(ot->srna, "clear_inner", false, "Clear Inner", "Remove geometry behind the plane");
RNA_def_boolean(ot->srna, "clear_outer", false, "Clear Outer", "Remove geometry in front of the plane");
+ RNA_def_boolean(ot->srna, "use_split", false, "Split", "Split the two halves to separate islands");
+ RNA_def_int(ot->srna, "mat_nr", 0, 0, 10000, "Cut Faces Material", "Material on cut faces (with Split)", 0, 10000);
+ RNA_def_boolean(ot->srna, "use_smooth", false,"Use Smooth", "Sets both cutting faces smooth (with Split)" );
RNA_def_float(ot->srna, "threshold", 0.0001, 0.0, 10.0, "Axis Threshold", "", 0.00001, 0.1);

Event Timeline