2012-02-19 18:31:04 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
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-03-26 12:02:41 +00:00
|
|
|
/* keep this operator fast, its used in a modifier */
|
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
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts");
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
BM_mesh_elem_hflag_disable_all(bm, BM_EDGE, BM_ELEM_TAG, false);
|
|
|
|
BMO_slot_buffer_hflag_enable(bm, op->slots_in, "edges", BM_EDGE, BM_ELEM_TAG, false);
|
2012-03-06 20:41:11 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
if (use_verts) {
|
|
|
|
/* this slows down the operation but its ok because the modifier doesn't use */
|
|
|
|
BMO_slot_buffer_hflag_enable(bm, op->slots_in, "verts", BM_VERT, BM_ELEM_TAG, false);
|
|
|
|
}
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
/* this is where everything happens */
|
|
|
|
BM_mesh_edgesplit(bm, use_verts, true, false);
|
2012-02-19 18:31:04 +00:00
|
|
|
|
2019-04-17 06:17:24 +02: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
|
|
|
}
|