2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bmesh
|
2012-12-12 12:57:27 +00:00
|
|
|
*
|
|
|
|
|
* Just a wrapper around #BM_mesh_edgesplit
|
2012-04-06 09:21:19 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-03-24 01:24:58 +00:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
2012-02-19 18:31:04 +00:00
|
|
|
#include "bmesh.h"
|
2013-08-23 04:22:07 +00:00
|
|
|
#include "bmesh_tools.h"
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2012-03-08 03:25:53 +00:00
|
|
|
#include "intern/bmesh_operators_private.h" /* own include */
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2012-06-30 15:27:13 +00:00
|
|
|
void bmo_split_edges_exec(BMesh *bm, BMOperator *op)
|
2012-02-19 18:31:04 +00:00
|
|
|
{
|
2013-01-14 16:42:43 +00:00
|
|
|
const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2013-05-13 12:09:21 +00:00
|
|
|
BM_mesh_elem_hflag_disable_all(bm, BM_EDGE, BM_ELEM_TAG, false);
|
2013-01-14 16:42:43 +00:00
|
|
|
BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, false);
|
2012-03-06 20:41:11 +00:00
|
|
|
|
2012-03-26 12:02:41 +00:00
|
|
|
if (use_verts) {
|
|
|
|
|
/* this slows down the operation but its ok because the modifier doesn't use */
|
2013-01-14 16:42:43 +00:00
|
|
|
BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, false);
|
2012-02-19 18:31:04 +00:00
|
|
|
}
|
|
|
|
|
|
2012-12-12 12:57:27 +00:00
|
|
|
/* this is where everything happens */
|
2015-05-02 16:05:32 +10:00
|
|
|
BM_mesh_edgesplit(bm, use_verts, true, false);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2017-10-24 16:29:29 +11:00
|
|
|
BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_TAG);
|
2012-02-19 18:31:04 +00:00
|
|
|
}
|