| 
									
										
										
										
											2011-02-23 10:52:22 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +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, | 
					
						
							| 
									
										
										
										
											2010-02-12 13:34:04 +00:00
										 |  |  |  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2007 Blender Foundation. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  | 
					
						
							|  |  |  |  * Contributor(s): Joseph Eagar, Joshua Leung | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 00:20:36 +00:00
										 |  |  | /** \file blender/editors/mesh/editmesh_loopcut.c
 | 
					
						
							| 
									
										
										
										
											2011-02-27 20:29:51 +00:00
										 |  |  |  *  \ingroup edmesh | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-21 15:10:09 +00:00
										 |  |  | #include "DNA_object_types.h"
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "MEM_guardedalloc.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-17 16:03:49 +00:00
										 |  |  | #include "BLI_array.h"
 | 
					
						
							| 
									
										
										
										
											2013-04-01 10:18:01 +00:00
										 |  |  | #include "BLI_string.h"
 | 
					
						
							| 
									
										
										
										
											2012-01-17 18:11:17 +00:00
										 |  |  | #include "BLI_math.h"
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-19 15:45:56 +00:00
										 |  |  | #include "BLF_translation.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | #include "BKE_context.h"
 | 
					
						
							| 
									
										
										
										
											2010-12-21 15:10:09 +00:00
										 |  |  | #include "BKE_modifier.h"
 | 
					
						
							|  |  |  | #include "BKE_report.h"
 | 
					
						
							| 
									
										
										
										
											2013-04-13 20:31:52 +00:00
										 |  |  | #include "BKE_editmesh.h"
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "BIF_gl.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "ED_screen.h"
 | 
					
						
							|  |  |  | #include "ED_space_api.h"
 | 
					
						
							|  |  |  | #include "ED_view3d.h"
 | 
					
						
							|  |  |  | #include "ED_mesh.h"
 | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | #include "ED_numinput.h"
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "RNA_access.h"
 | 
					
						
							|  |  |  | #include "RNA_define.h"
 | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:28 +00:00
										 |  |  | #include "RNA_enum_types.h"
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "WM_api.h"
 | 
					
						
							|  |  |  | #include "WM_types.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-01 10:18:01 +00:00
										 |  |  | #include "mesh_intern.h"  /* own include */
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | #define SUBD_SMOOTH_MAX 4.0f
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* ringsel operator */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* struct for properties used while drawing */ | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | typedef struct RingSelOpData { | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | 	ARegion *ar;        /* region that ringsel was activated in */ | 
					
						
							|  |  |  | 	void *draw_handle;  /* for drawing preview loop */ | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	float (*edges)[2][3]; | 
					
						
							|  |  |  | 	int totedge; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ViewContext vc; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Object *ob; | 
					
						
							|  |  |  | 	BMEditMesh *em; | 
					
						
							|  |  |  | 	BMEdge *eed; | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 	NumInput num; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 	bool extend; | 
					
						
							|  |  |  | 	bool do_cut; | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | } RingSelOpData; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* modal loop selection drawing callback */ | 
					
						
							| 
									
										
										
										
											2010-11-10 15:10:54 +00:00
										 |  |  | static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-11-10 15:10:54 +00:00
										 |  |  | 	View3D *v3d = CTX_wm_view3d(C); | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	RingSelOpData *lcd = arg; | 
					
						
							| 
									
										
										
										
											2010-11-10 15:10:54 +00:00
										 |  |  | 	int i; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 	if (lcd->totedge > 0) { | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 		if (v3d && v3d->zbuf) | 
					
						
							| 
									
										
										
										
											2010-11-10 15:10:54 +00:00
										 |  |  | 			glDisable(GL_DEPTH_TEST); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 		glPushMatrix(); | 
					
						
							|  |  |  | 		glMultMatrixf(lcd->ob->obmat); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 		glColor3ub(255, 0, 255); | 
					
						
							|  |  |  | 		glBegin(GL_LINES); | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 		for (i = 0; i < lcd->totedge; i++) { | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 			glVertex3fv(lcd->edges[i][0]); | 
					
						
							|  |  |  | 			glVertex3fv(lcd->edges[i][1]); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		glEnd(); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 		glPopMatrix(); | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 		if (v3d && v3d->zbuf) | 
					
						
							| 
									
										
										
										
											2010-11-10 15:10:54 +00:00
										 |  |  | 			glEnable(GL_DEPTH_TEST); | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-03 16:31:46 +00:00
										 |  |  | /* given two opposite edges in a face, finds the ordering of their vertices so
 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  |  * that cut preview lines won't cross each other */ | 
					
						
							| 
									
										
										
										
											2012-04-19 14:38:09 +00:00
										 |  |  | static void edgering_find_order(BMEdge *lasteed, BMEdge *eed, | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  |                                 BMVert *lastv1, BMVert *v[2][2]) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-07-19 04:44:37 +00:00
										 |  |  | 	BMIter liter; | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 	BMLoop *l, *l2; | 
					
						
							|  |  |  | 	int rev; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-14 22:06:10 +00:00
										 |  |  | 	l = eed->l; | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	/* find correct order for v[1] */ | 
					
						
							| 
									
										
										
										
											2012-02-12 10:51:45 +00:00
										 |  |  | 	if (!(BM_edge_in_face(l->f, eed) && BM_edge_in_face(l->f, lasteed))) { | 
					
						
							| 
									
										
										
										
											2012-04-19 13:47:58 +00:00
										 |  |  | 		BM_ITER_ELEM (l, &liter, l, BM_LOOPS_OF_LOOP) { | 
					
						
							| 
									
										
										
										
											2012-02-12 10:51:45 +00:00
										 |  |  | 			if (BM_edge_in_face(l->f, eed) && BM_edge_in_face(l->f, lasteed)) | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 				break; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	/* this should never happen */ | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 	if (!l) { | 
					
						
							|  |  |  | 		v[0][0] = eed->v1; | 
					
						
							|  |  |  | 		v[0][1] = eed->v2; | 
					
						
							|  |  |  | 		v[1][0] = lasteed->v1; | 
					
						
							|  |  |  | 		v[1][1] = lasteed->v2; | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-04-19 01:02:58 +00:00
										 |  |  | 	l2 = BM_loop_other_edge_loop(l, eed->v1); | 
					
						
							| 
									
										
										
										
											2011-09-12 15:10:59 +00:00
										 |  |  | 	rev = (l2 == l->prev); | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 	while (l2->v != lasteed->v1 && l2->v != lasteed->v2) { | 
					
						
							| 
									
										
										
										
											2011-09-12 15:10:59 +00:00
										 |  |  | 		l2 = rev ? l2->prev : l2->next; | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (l2->v == lastv1) { | 
					
						
							|  |  |  | 		v[0][0] = eed->v1; | 
					
						
							|  |  |  | 		v[0][1] = eed->v2; | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 		v[0][0] = eed->v2; | 
					
						
							|  |  |  | 		v[0][1] = eed->v1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | static void edgering_sel(RingSelOpData *lcd, int previewlines, bool select) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	BMEditMesh *em = lcd->em; | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 	BMEdge *eed_start = lcd->eed; | 
					
						
							|  |  |  | 	BMEdge *eed, *eed_last; | 
					
						
							|  |  |  | 	BMVert *v[2][2], *v_last; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	BMWalker walker; | 
					
						
							|  |  |  | 	float (*edges)[2][3] = NULL; | 
					
						
							| 
									
										
										
										
											2009-09-17 23:05:33 +00:00
										 |  |  | 	BLI_array_declare(edges); | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	int i, tot = 0; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2011-05-03 03:05:15 +00:00
										 |  |  | 	memset(v, 0, sizeof(v)); | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 	if (!eed_start) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 		return; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (lcd->edges) { | 
					
						
							|  |  |  | 		MEM_freeN(lcd->edges); | 
					
						
							|  |  |  | 		lcd->edges = NULL; | 
					
						
							|  |  |  | 		lcd->totedge = 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (!lcd->extend) { | 
					
						
							| 
									
										
										
										
											2012-02-12 18:43:59 +00:00
										 |  |  | 		EDBM_flag_disable_all(lcd->em, BM_ELEM_SELECT); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (select) { | 
					
						
							| 
									
										
										
										
											2012-02-12 10:51:45 +00:00
										 |  |  | 		BMW_init(&walker, em->bm, BMW_EDGERING, | 
					
						
							| 
									
										
										
										
											2012-03-29 13:09:07 +00:00
										 |  |  | 		         BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, | 
					
						
							| 
									
										
										
										
											2012-04-03 06:12:04 +00:00
										 |  |  | 		         BMW_FLAG_TEST_HIDDEN, | 
					
						
							| 
									
										
										
										
											2012-02-06 05:18:08 +00:00
										 |  |  | 		         BMW_NIL_LAY); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 		for (eed = BMW_begin(&walker, eed_start); eed; eed = BMW_step(&walker)) { | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 			BM_edge_select_set(em->bm, eed, true); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2012-02-12 10:51:45 +00:00
										 |  |  | 		BMW_end(&walker); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-12 10:51:45 +00:00
										 |  |  | 	BMW_init(&walker, em->bm, BMW_EDGERING, | 
					
						
							| 
									
										
										
										
											2012-03-29 13:09:07 +00:00
										 |  |  | 	         BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP, | 
					
						
							| 
									
										
										
										
											2012-04-03 06:12:04 +00:00
										 |  |  | 	         BMW_FLAG_TEST_HIDDEN, | 
					
						
							| 
									
										
										
										
											2012-02-06 05:18:08 +00:00
										 |  |  | 	         BMW_NIL_LAY); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 	v_last   = NULL; | 
					
						
							|  |  |  | 	eed_last = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for (eed = eed_start = BMW_begin(&walker, eed_start); eed; eed = BMW_step(&walker)) { | 
					
						
							|  |  |  | 		if (eed_last) { | 
					
						
							|  |  |  | 			if (v_last) { | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 				v[1][0] = v[0][0]; | 
					
						
							|  |  |  | 				v[1][1] = v[0][1]; | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			else { | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 				v[1][0] = eed_last->v1; | 
					
						
							|  |  |  | 				v[1][1] = eed_last->v2; | 
					
						
							|  |  |  | 				v_last  = eed_last->v1; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 			edgering_find_order(eed_last, eed, v_last, v); | 
					
						
							|  |  |  | 			v_last = v[0][0]; | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-28 15:14:16 +00:00
										 |  |  | 			BLI_array_grow_items(edges, previewlines); | 
					
						
							| 
									
										
										
										
											2012-04-03 06:12:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 			for (i = 1; i <= previewlines; i++) { | 
					
						
							| 
									
										
										
										
											2012-12-19 04:59:47 +00:00
										 |  |  | 				const float fac = (i / ((float)previewlines + 1)); | 
					
						
							|  |  |  | 				interp_v3_v3v3(edges[tot][0], v[0][0]->co, v[0][1]->co, fac); | 
					
						
							|  |  |  | 				interp_v3_v3v3(edges[tot][1], v[1][0]->co, v[1][1]->co, fac); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 				tot++; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 		eed_last = eed; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-11-26 06:59:59 +00:00
										 |  |  | #ifdef BMW_EDGERING_NGON
 | 
					
						
							| 
									
										
										
										
											2012-11-09 14:52:05 +00:00
										 |  |  | 	if (lasteed != startedge && BM_edge_share_face_check(lasteed, startedge)) { | 
					
						
							| 
									
										
										
										
											2012-11-26 06:59:59 +00:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 	if (eed_last != eed_start && BM_edge_share_quad_check(eed_last, eed_start)) { | 
					
						
							| 
									
										
										
										
											2012-11-26 06:59:59 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2011-05-01 00:23:08 +00:00
										 |  |  | 		v[1][0] = v[0][0]; | 
					
						
							|  |  |  | 		v[1][1] = v[0][1]; | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-14 09:53:56 +00:00
										 |  |  | 		edgering_find_order(eed_last, eed_start, v_last, v); | 
					
						
							| 
									
										
										
										
											2011-05-01 00:23:08 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2012-04-28 15:14:16 +00:00
										 |  |  | 		BLI_array_grow_items(edges, previewlines); | 
					
						
							| 
									
										
										
										
											2012-04-03 06:12:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 		for (i = 1; i <= previewlines; i++) { | 
					
						
							| 
									
										
										
										
											2012-12-19 04:59:47 +00:00
										 |  |  | 			const float fac = (i / ((float)previewlines + 1)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			if (!v[0][0] || !v[0][1] || !v[1][0] || !v[1][1]) { | 
					
						
							| 
									
										
										
										
											2011-03-17 22:59:54 +00:00
										 |  |  | 				continue; | 
					
						
							| 
									
										
										
										
											2012-12-19 04:59:47 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			interp_v3_v3v3(edges[tot][0], v[0][0]->co, v[0][1]->co, fac); | 
					
						
							|  |  |  | 			interp_v3_v3v3(edges[tot][1], v[1][0]->co, v[1][1]->co, fac); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 			tot++; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-12 10:51:45 +00:00
										 |  |  | 	BMW_end(&walker); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	lcd->edges = edges; | 
					
						
							|  |  |  | 	lcd->totedge = tot; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | static void ringsel_find_edge(RingSelOpData *lcd, const int previewlines) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 	if (lcd->eed) { | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 		edgering_sel(lcd, previewlines, false); | 
					
						
							| 
									
										
										
										
											2012-03-08 04:38:35 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else if (lcd->edges) { | 
					
						
							|  |  |  | 		MEM_freeN(lcd->edges); | 
					
						
							| 
									
										
										
										
											2010-01-10 19:56:22 +00:00
										 |  |  | 		lcd->edges = NULL; | 
					
						
							|  |  |  | 		lcd->totedge = 0; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static void ringsel_finish(bContext *C, wmOperator *op) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	RingSelOpData *lcd = op->customdata; | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 	const int cuts = RNA_int_get(op->ptr, "number_cuts"); | 
					
						
							| 
									
										
										
										
											2012-11-13 02:45:42 +00:00
										 |  |  | 	const float smoothness = 0.292f * RNA_float_get(op->ptr, "smoothness"); | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:28 +00:00
										 |  |  | 	const int smooth_falloff = RNA_enum_get(op->ptr, "falloff"); | 
					
						
							| 
									
										
										
										
											2012-11-26 06:59:59 +00:00
										 |  |  | #ifdef BMW_EDGERING_NGON
 | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 	const bool use_only_quads = false; | 
					
						
							| 
									
										
										
										
											2012-11-26 06:59:59 +00:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 	const bool use_only_quads = false; | 
					
						
							| 
									
										
										
										
											2012-11-26 06:59:59 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (lcd->eed) { | 
					
						
							| 
									
										
										
										
											2011-02-27 06:19:40 +00:00
										 |  |  | 		BMEditMesh *em = lcd->em; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 		edgering_sel(lcd, cuts, true); | 
					
						
							| 
									
										
										
										
											2011-01-15 14:07:11 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 		if (lcd->do_cut) { | 
					
						
							| 
									
										
										
										
											2013-04-26 19:25:56 +00:00
										 |  |  | 			const bool is_macro = (op->opm != NULL); | 
					
						
							| 
									
										
										
										
											2012-06-29 13:55:25 +00:00
										 |  |  | 			/* Enable gridfill, so that intersecting loopcut works as one would expect.
 | 
					
						
							|  |  |  | 			 * Note though that it will break edgeslide in this specific case. | 
					
						
							|  |  |  | 			 * See [#31939]. */ | 
					
						
							| 
									
										
										
										
											2012-04-23 03:43:02 +00:00
										 |  |  | 			BM_mesh_esubdivide(em->bm, BM_ELEM_SELECT, | 
					
						
							| 
									
										
										
										
											2013-06-10 04:33:05 +00:00
										 |  |  | 			                   smoothness, smooth_falloff, true, | 
					
						
							|  |  |  | 			                   0.0f, 0.0f, | 
					
						
							| 
									
										
										
										
											2012-04-23 03:43:02 +00:00
										 |  |  | 			                   cuts, | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 			                   SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, true, | 
					
						
							| 
									
										
										
										
											2012-11-28 06:43:04 +00:00
										 |  |  | 			                   use_only_quads, 0); | 
					
						
							| 
									
										
										
										
											2012-04-23 03:43:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 19:25:56 +00:00
										 |  |  | 			/* when used in a macro tessface is already re-recalculated */ | 
					
						
							|  |  |  | 			EDBM_update_generic(em, (is_macro == false), true); | 
					
						
							| 
									
										
										
										
											2012-12-12 15:01:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 15:05:19 +00:00
										 |  |  | 			/* we cant slide multiple edges in vertex select mode */ | 
					
						
							| 
									
										
										
										
											2013-04-26 19:25:56 +00:00
										 |  |  | 			if (is_macro && (cuts > 1) && (em->selectmode & SCE_SELECT_VERTEX)) { | 
					
						
							| 
									
										
										
										
											2013-04-26 18:45:05 +00:00
										 |  |  | 				EDBM_selectmode_disable(lcd->vc.scene, em, SCE_SELECT_VERTEX, SCE_SELECT_EDGE); | 
					
						
							| 
									
										
										
										
											2013-04-26 15:05:19 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2010-04-16 08:14:20 +00:00
										 |  |  | 			/* force edge slide to edge select mode in in face select mode */ | 
					
						
							| 
									
										
										
										
											2013-04-26 15:05:19 +00:00
										 |  |  | 			else if (EDBM_selectmode_disable(lcd->vc.scene, em, SCE_SELECT_FACE, SCE_SELECT_EDGE)) { | 
					
						
							| 
									
										
										
										
											2013-03-20 16:03:34 +00:00
										 |  |  | 				/* pass, the change will flush selection */ | 
					
						
							| 
									
										
										
										
											2010-04-16 08:14:20 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2012-12-12 15:01:27 +00:00
										 |  |  | 			else { | 
					
						
							| 
									
										
										
										
											2013-03-20 16:03:34 +00:00
										 |  |  | 				/* else flush explicitly */ | 
					
						
							| 
									
										
										
										
											2012-06-11 10:14:46 +00:00
										 |  |  | 				EDBM_selectmode_flush(lcd->em); | 
					
						
							| 
									
										
										
										
											2012-12-12 15:01:27 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2010-02-07 01:01:32 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		else { | 
					
						
							| 
									
										
										
										
											2012-06-29 13:55:25 +00:00
										 |  |  | 			/* XXX Is this piece of code ever used now? Simple loop select is now
 | 
					
						
							|  |  |  | 			 *     in editmesh_select.c (around line 1000)... */ | 
					
						
							| 
									
										
										
										
											2011-01-15 14:07:11 +00:00
										 |  |  | 			/* sets as active, useful for other tools */ | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 			if (em->selectmode & SCE_SELECT_VERTEX) | 
					
						
							| 
									
										
										
										
											2012-04-24 21:19:18 +00:00
										 |  |  | 				BM_select_history_store(em->bm, lcd->eed->v1);  /* low priority TODO, get vertrex close to mouse */ | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 			if (em->selectmode & SCE_SELECT_EDGE) | 
					
						
							| 
									
										
										
										
											2012-04-24 21:19:18 +00:00
										 |  |  | 				BM_select_history_store(em->bm, lcd->eed); | 
					
						
							| 
									
										
										
										
											2011-01-15 14:07:11 +00:00
										 |  |  | 			 | 
					
						
							| 
									
										
										
										
											2012-02-10 06:16:21 +00:00
										 |  |  | 			EDBM_selectmode_flush(lcd->em); | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | 			WM_event_add_notifier(C, NC_GEOM | ND_SELECT, lcd->ob->data); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* called when modal loop selection is done... */ | 
					
						
							| 
									
										
										
										
											2011-05-10 23:48:09 +00:00
										 |  |  | static void ringsel_exit(bContext *UNUSED(C), wmOperator *op) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	RingSelOpData *lcd = op->customdata; | 
					
						
							| 
									
										
										
										
											2009-09-13 16:15:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	/* deactivate the extra drawing stuff in 3D-View */ | 
					
						
							|  |  |  | 	ED_region_draw_cb_exit(lcd->ar->type, lcd->draw_handle); | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	if (lcd->edges) | 
					
						
							|  |  |  | 		MEM_freeN(lcd->edges); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* free the custom data */ | 
					
						
							|  |  |  | 	MEM_freeN(lcd); | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	op->customdata = NULL; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-09-28 11:02:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | /* called when modal loop selection gets set up... */ | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | static int ringsel_init(bContext *C, wmOperator *op, bool do_cut) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	RingSelOpData *lcd; | 
					
						
							| 
									
										
										
										
											2012-09-28 11:02:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	/* alloc new customdata */ | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	lcd = op->customdata = MEM_callocN(sizeof(RingSelOpData), "ringsel Modal Op Data"); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* assign the drawing handle for drawing preview line... */ | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	lcd->ar = CTX_wm_region(C); | 
					
						
							|  |  |  | 	lcd->draw_handle = ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	lcd->ob = CTX_data_edit_object(C); | 
					
						
							| 
									
										
										
										
											2013-04-16 05:59:48 +00:00
										 |  |  | 	lcd->em = BKE_editmesh_from_object(lcd->ob); | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 	lcd->extend = do_cut ? false : RNA_boolean_get(op->ptr, "extend"); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	lcd->do_cut = do_cut; | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	initNumInput(&lcd->num); | 
					
						
							|  |  |  | 	lcd->num.idx_max = 0; | 
					
						
							|  |  |  | 	lcd->num.flag |= NUM_NO_NEGATIVE | NUM_NO_FRACTION; | 
					
						
							| 
									
										
										
										
											2012-09-28 11:02:43 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* XXX, temp, workaround for [#	] */ | 
					
						
							|  |  |  | 	EDBM_mesh_ensure_valid_dm_hack(CTX_data_scene(C), lcd->em); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	em_setup_viewcontext(C, &lcd->vc); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return 1; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | static int ringcut_cancel(bContext *C, wmOperator *op) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	/* this is just a wrapper around exit() */ | 
					
						
							|  |  |  | 	ringsel_exit(C, op); | 
					
						
							|  |  |  | 	return OPERATOR_CANCELLED; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | static void loopcut_update_edge(RingSelOpData *lcd, BMEdge *e, const int previewlines) | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	if (e != lcd->eed) { | 
					
						
							|  |  |  | 		lcd->eed = e; | 
					
						
							|  |  |  | 		ringsel_find_edge(lcd, previewlines); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | static void loopcut_mouse_move(RingSelOpData *lcd, const int previewlines) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	float dist = 75.0f; | 
					
						
							|  |  |  | 	BMEdge *e = EDBM_edge_find_nearest(&lcd->vc, &dist); | 
					
						
							|  |  |  | 	loopcut_update_edge(lcd, e, previewlines); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | /* called by both init() and exec() */ | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 	const bool is_interactive = (event != NULL); | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	Object *obedit = CTX_data_edit_object(C); | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	RingSelOpData *lcd; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	if (modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit)) | 
					
						
							| 
									
										
										
										
											2012-10-26 17:32:50 +00:00
										 |  |  | 		BKE_report(op->reports, RPT_WARNING, "Loop cut does not work well on deformed edit mesh display"); | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	view3d_operator_needs_opengl(C); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 	/* for re-execution, check edge index is in range before we setup ringsel */ | 
					
						
							|  |  |  | 	if (is_interactive == false) { | 
					
						
							|  |  |  | 		const int e_index = RNA_int_get(op->ptr, "edge_index"); | 
					
						
							|  |  |  | 		BMEditMesh *em = BKE_editmesh_from_object(obedit); | 
					
						
							|  |  |  | 		if (UNLIKELY((e_index == -1) || (e_index >= em->bm->totedge))) { | 
					
						
							|  |  |  | 			return OPERATOR_CANCELLED; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 	if (!ringsel_init(C, op, true)) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 		return OPERATOR_CANCELLED; | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	/* add a modal handler for this operator - handles loop selection */ | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 	if (is_interactive) { | 
					
						
							|  |  |  | 		WM_event_add_modal_handler(C, op); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	lcd = op->customdata; | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (is_interactive) { | 
					
						
							|  |  |  | 		copy_v2_v2_int(lcd->vc.mval, event->mval); | 
					
						
							|  |  |  | 		loopcut_mouse_move(lcd, is_interactive ? 1 : 0); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							|  |  |  | 		const int e_index = RNA_int_get(op->ptr, "edge_index"); | 
					
						
							|  |  |  | 		BMEdge *e; | 
					
						
							|  |  |  | 		EDBM_index_arrays_ensure(lcd->em, BM_EDGE); | 
					
						
							|  |  |  | 		e = EDBM_edge_at_index(lcd->em, e_index); | 
					
						
							|  |  |  | 		loopcut_update_edge(lcd, e, 0); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-16 18:33:07 +00:00
										 |  |  | #ifdef USE_LOOPSLIDE_HACK
 | 
					
						
							|  |  |  | 	/* for use in macro so we can restore, HACK */ | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		Scene *scene = CTX_data_scene(C); | 
					
						
							|  |  |  | 		ToolSettings *settings = scene->toolsettings; | 
					
						
							|  |  |  | 		int mesh_select_mode[3] = { | 
					
						
							|  |  |  | 		    (settings->selectmode & SCE_SELECT_VERTEX) != 0, | 
					
						
							|  |  |  | 		    (settings->selectmode & SCE_SELECT_EDGE)   != 0, | 
					
						
							|  |  |  | 		    (settings->selectmode & SCE_SELECT_FACE)   != 0, | 
					
						
							|  |  |  | 		}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		RNA_boolean_set_array(op->ptr, "mesh_select_mode_init", mesh_select_mode); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 	if (is_interactive) { | 
					
						
							|  |  |  | 		ScrArea *sa = CTX_wm_area(C); | 
					
						
							|  |  |  | 		ED_area_headerprint(sa, IFACE_("Select a ring to be cut, use mouse-wheel or page-up/down for number of cuts, " | 
					
						
							|  |  |  | 		                               "hold Alt for smooth")); | 
					
						
							|  |  |  | 		return OPERATOR_RUNNING_MODAL; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	else { | 
					
						
							|  |  |  | 		ringsel_finish(C, op); | 
					
						
							|  |  |  | 		ringsel_exit(C, op); | 
					
						
							|  |  |  | 		return OPERATOR_FINISHED; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static int ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 	return loopcut_init(C, op, event); | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static int loopcut_exec(bContext *C, wmOperator *op) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 	return loopcut_init(C, op, NULL); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-13 09:03:46 +00:00
										 |  |  | static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 	float smoothness = RNA_float_get(op->ptr, "smoothness"); | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	int cuts = RNA_int_get(op->ptr, "number_cuts"); | 
					
						
							| 
									
										
										
										
											2012-06-10 15:20:10 +00:00
										 |  |  | 	RingSelOpData *lcd = op->customdata; | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 	bool show_cuts = false; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	view3d_operator_needs_opengl(C); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 	switch (event->type) { | 
					
						
							| 
									
										
										
										
											2011-03-17 22:59:54 +00:00
										 |  |  | 		case RETKEY: | 
					
						
							| 
									
										
										
										
											2012-07-17 17:55:23 +00:00
										 |  |  | 		case PADENTER: | 
					
						
							| 
									
										
										
										
											2011-05-03 03:05:15 +00:00
										 |  |  | 		case LEFTMOUSE: /* confirm */ // XXX hardcoded
 | 
					
						
							| 
									
										
										
										
											2011-05-09 20:43:05 +00:00
										 |  |  | 			if (event->val == KM_PRESS) { | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 				/* finish */ | 
					
						
							|  |  |  | 				ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 				 | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 				if (lcd->eed) { | 
					
						
							|  |  |  | 					/* set for redo */ | 
					
						
							|  |  |  | 					BM_mesh_elem_index_ensure(lcd->em->bm, BM_EDGE); | 
					
						
							|  |  |  | 					RNA_int_set(op->ptr, "edge_index", BM_elem_index_get(lcd->eed)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					/* execute */ | 
					
						
							|  |  |  | 					ringsel_finish(C, op); | 
					
						
							|  |  |  | 					ringsel_exit(C, op); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				else { | 
					
						
							|  |  |  | 					return ringcut_cancel(C, op); | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 				 | 
					
						
							| 
									
										
										
										
											2011-01-01 17:52:06 +00:00
										 |  |  | 				ED_area_headerprint(CTX_wm_area(C), NULL); | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 				 | 
					
						
							| 
									
										
										
										
											2011-05-09 20:43:05 +00:00
										 |  |  | 				return OPERATOR_FINISHED; | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 		case RIGHTMOUSE: /* abort */ // XXX hardcoded
 | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 			ringsel_exit(C, op); | 
					
						
							| 
									
										
										
										
											2011-05-03 03:05:15 +00:00
										 |  |  | 			ED_area_headerprint(CTX_wm_area(C), NULL); | 
					
						
							| 
									
										
										
										
											2009-11-04 09:37:08 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			return OPERATOR_FINISHED; | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 		case ESCKEY: | 
					
						
							|  |  |  | 			if (event->val == KM_RELEASE) { | 
					
						
							|  |  |  | 				/* cancel */ | 
					
						
							|  |  |  | 				ED_region_tag_redraw(lcd->ar); | 
					
						
							| 
									
										
										
										
											2011-05-03 03:05:15 +00:00
										 |  |  | 				ED_area_headerprint(CTX_wm_area(C), NULL); | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 				 | 
					
						
							| 
									
										
										
										
											2011-02-27 06:19:40 +00:00
										 |  |  | 				return ringcut_cancel(C, op); | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			 | 
					
						
							|  |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 		case PADPLUSKEY: | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 		case PAGEUPKEY: | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 		case WHEELUPMOUSE:  /* change number of cuts */ | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 			if (event->val == KM_RELEASE) | 
					
						
							|  |  |  | 				break; | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 			if (event->alt == 0) { | 
					
						
							|  |  |  | 				cuts++; | 
					
						
							|  |  |  | 				RNA_int_set(op->ptr, "number_cuts", cuts); | 
					
						
							|  |  |  | 				ringsel_find_edge(lcd, cuts); | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 				show_cuts = true; | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			else { | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 				smoothness = min_ff(smoothness + 0.05f, SUBD_SMOOTH_MAX); | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 				RNA_float_set(op->ptr, "smoothness", smoothness); | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 				show_cuts = true; | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 			 | 
					
						
							|  |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 		case PADMINUS: | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 		case PAGEDOWNKEY: | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 		case WHEELDOWNMOUSE:  /* change number of cuts */ | 
					
						
							| 
									
										
										
										
											2009-11-09 22:47:55 +00:00
										 |  |  | 			if (event->val == KM_RELEASE) | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 			if (event->alt == 0) { | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 				cuts = max_ii(cuts - 1, 1); | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 				RNA_int_set(op->ptr, "number_cuts", cuts); | 
					
						
							|  |  |  | 				ringsel_find_edge(lcd, cuts); | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 				show_cuts = true; | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			else { | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 				smoothness = max_ff(smoothness - 0.05f, -SUBD_SMOOTH_MAX); | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 				RNA_float_set(op->ptr, "smoothness", smoothness); | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 				show_cuts = true; | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 			 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2013-01-15 23:45:41 +00:00
										 |  |  | 		case MOUSEMOVE:  /* mouse moved somewhere to select another loop */ | 
					
						
							|  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 			lcd->vc.mval[0] = event->mval[0]; | 
					
						
							|  |  |  | 			lcd->vc.mval[1] = event->mval[1]; | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 			loopcut_mouse_move(lcd, cuts); | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 			break; | 
					
						
							| 
									
										
										
										
											2012-10-21 05:46:41 +00:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 	/* using the keyboard to input the number of cuts */ | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 	if (event->val == KM_PRESS) { | 
					
						
							| 
									
										
										
										
											2012-05-10 07:10:39 +00:00
										 |  |  | 		/* init as zero so backspace clears */ | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 		 | 
					
						
							| 
									
										
										
										
											2012-03-06 18:40:15 +00:00
										 |  |  | 		if (handleNumInput(&lcd->num, event)) { | 
					
						
							| 
									
										
										
										
											2012-11-26 03:47:20 +00:00
										 |  |  | 			float value = RNA_int_get(op->ptr, "number_cuts"); | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 			applyNumInput(&lcd->num, &value); | 
					
						
							|  |  |  | 			 | 
					
						
							| 
									
										
										
										
											2012-05-10 07:10:39 +00:00
										 |  |  | 			/* allow zero so you can backspace and type in a value
 | 
					
						
							|  |  |  | 			 * otherwise 1 as minimum would make more sense */ | 
					
						
							|  |  |  | 			cuts = CLAMPIS(value, 0, 130); | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 			 | 
					
						
							| 
									
										
										
										
											2012-03-24 02:51:46 +00:00
										 |  |  | 			RNA_int_set(op->ptr, "number_cuts", cuts); | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 			ringsel_find_edge(lcd, cuts); | 
					
						
							| 
									
										
										
										
											2013-03-19 23:17:44 +00:00
										 |  |  | 			show_cuts = true; | 
					
						
							| 
									
										
										
										
											2011-11-21 17:14:44 +00:00
										 |  |  | 			 | 
					
						
							|  |  |  | 			ED_region_tag_redraw(lcd->ar); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2012-03-08 13:20:06 +00:00
										 |  |  | 	if (show_cuts) { | 
					
						
							|  |  |  | 		char buf[64]; | 
					
						
							| 
									
										
										
										
											2013-02-19 15:45:56 +00:00
										 |  |  | 		BLI_snprintf(buf, sizeof(buf), IFACE_("Number of Cuts: %d, Smooth: %.2f (Alt)"), cuts, smoothness); | 
					
						
							| 
									
										
										
										
											2012-03-08 13:20:06 +00:00
										 |  |  | 		ED_area_headerprint(CTX_wm_area(C), buf); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	/* keep going until the user confirms */ | 
					
						
							|  |  |  | 	return OPERATOR_RUNNING_MODAL; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-08 05:45:16 +00:00
										 |  |  | /* for bmesh this tool is in bmesh_select.c */ | 
					
						
							|  |  |  | #if 0
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | void MESH_OT_edgering_select(wmOperatorType *ot) | 
					
						
							| 
									
										
										
										
											2009-09-13 16:15:26 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	/* description */ | 
					
						
							| 
									
										
										
										
											2012-03-22 07:26:09 +00:00
										 |  |  | 	ot->name = "Edge Ring Select"; | 
					
						
							|  |  |  | 	ot->idname = "MESH_OT_edgering_select"; | 
					
						
							|  |  |  | 	ot->description = "Select an edge ring"; | 
					
						
							| 
									
										
										
										
											2009-09-13 16:15:26 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* callbacks */ | 
					
						
							| 
									
										
										
										
											2012-03-22 07:26:09 +00:00
										 |  |  | 	ot->invoke = ringsel_invoke; | 
					
						
							|  |  |  | 	ot->poll = ED_operator_editmesh_region_view3d;  | 
					
						
							| 
									
										
										
										
											2009-09-13 16:15:26 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* flags */ | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | 
					
						
							| 
									
										
										
										
											2009-09-13 16:15:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection"); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2009-09-16 09:55:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-08 05:45:16 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | void MESH_OT_loopcut(wmOperatorType *ot) | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2012-03-20 22:27:08 +00:00
										 |  |  | 	PropertyRNA *prop; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	/* description */ | 
					
						
							| 
									
										
										
										
											2012-03-22 07:26:09 +00:00
										 |  |  | 	ot->name = "Loop Cut"; | 
					
						
							|  |  |  | 	ot->idname = "MESH_OT_loopcut"; | 
					
						
							|  |  |  | 	ot->description = "Add a new loop between existing loops"; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* callbacks */ | 
					
						
							| 
									
										
										
										
											2012-03-22 07:26:09 +00:00
										 |  |  | 	ot->invoke = ringcut_invoke; | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 	ot->exec = loopcut_exec; | 
					
						
							| 
									
										
										
										
											2012-03-22 07:26:09 +00:00
										 |  |  | 	ot->modal = loopcut_modal; | 
					
						
							|  |  |  | 	ot->cancel = ringcut_cancel; | 
					
						
							|  |  |  | 	ot->poll = ED_operator_editmesh_region_view3d; | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	/* flags */ | 
					
						
							| 
									
										
										
										
											2012-03-26 02:56:48 +00:00
										 |  |  | 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | 
					
						
							| 
									
										
										
										
											2009-10-22 23:22:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* properties */ | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 	prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 100); | 
					
						
							| 
									
										
										
										
											2012-03-20 22:27:08 +00:00
										 |  |  | 	/* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */ | 
					
						
							|  |  |  | 	RNA_def_property_flag(prop, PROP_SKIP_SAVE); | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 	prop = RNA_def_float(ot->srna, "smoothness", 0.0f, -FLT_MAX, FLT_MAX, | 
					
						
							|  |  |  | 	                     "Smoothness", "Smoothness factor", -SUBD_SMOOTH_MAX, SUBD_SMOOTH_MAX); | 
					
						
							| 
									
										
										
										
											2012-11-13 02:28:07 +00:00
										 |  |  | 	RNA_def_property_flag(prop, PROP_SKIP_SAVE); | 
					
						
							| 
									
										
										
										
											2013-04-26 17:29:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-08 12:58:28 +00:00
										 |  |  | 	prop = RNA_def_property(ot->srna, "falloff", PROP_ENUM, PROP_NONE); | 
					
						
							|  |  |  | 	RNA_def_property_enum_items(prop, proportional_falloff_curve_only_items); | 
					
						
							|  |  |  | 	RNA_def_property_enum_default(prop, PROP_ROOT); | 
					
						
							|  |  |  | 	RNA_def_property_ui_text(prop, "Falloff", "Falloff type the feather"); | 
					
						
							|  |  |  | 	RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-03 00:22:22 +00:00
										 |  |  | 	prop = RNA_def_int(ot->srna, "edge_index", -1, -1, INT_MAX, "Number of Cuts", "", 0, INT_MAX); | 
					
						
							| 
									
										
										
										
											2013-04-26 18:12:05 +00:00
										 |  |  | 	RNA_def_property_flag(prop, PROP_HIDDEN); | 
					
						
							| 
									
										
										
										
											2013-05-16 18:33:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef USE_LOOPSLIDE_HACK
 | 
					
						
							|  |  |  | 	prop = RNA_def_boolean_array(ot->srna, "mesh_select_mode_init", 3, NULL, "", ""); | 
					
						
							|  |  |  | 	RNA_def_property_flag(prop, PROP_HIDDEN); | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2009-09-16 22:27:22 +00:00
										 |  |  | } |