| 
									
										
										
										
											2012-02-19 18:31:04 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * ***** BEGIN GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-03-09 03:16:39 +00:00
										 |  |  |  * Contributor(s): Campbell Barton | 
					
						
							| 
									
										
										
										
											2012-02-19 18:31:04 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-20 07:38:11 +00:00
										 |  |  | /** \file blender/bmesh/operators/bmo_split_edges.c
 | 
					
						
							| 
									
										
										
										
											2012-04-06 09:21:19 +00:00
										 |  |  |  *  \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-08 16:46:14 +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
										 |  |  | { | 
					
						
							| 
									
										
										
										
											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 */ | 
					
						
							| 
									
										
										
										
											2013-08-13 01:00:07 +00:00
										 |  |  | 	BM_mesh_edgesplit(bm, use_verts, true, false); | 
					
						
							| 
									
										
										
										
											2012-02-19 18:31:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-20 05:50:19 +00:00
										 |  |  | 	BMO_slot_buffer_from_enabled_hflag(bm, op, op->slots_out, "edges.out", BM_EDGE, BM_ELEM_INTERNAL_TAG); | 
					
						
							| 
									
										
										
										
											2012-02-19 18:31:04 +00:00
										 |  |  | } |