[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59661] trunk/blender/source/blender/ editors/mesh/editmesh_bisect.c: execute bisect immediately ( without starting modal input) if the plane is already set or if there is no 3d view available.
Campbell Barton
ideasman42 at gmail.com
Fri Aug 30 14:48:40 CEST 2013
Revision: 59661
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59661
Author: campbellbarton
Date: 2013-08-30 12:48:39 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
execute bisect immediately (without starting modal input) if the plane is already set or if there is no 3d view available.
Modified Paths:
--------------
trunk/blender/source/blender/editors/mesh/editmesh_bisect.c
Modified: trunk/blender/source/blender/editors/mesh/editmesh_bisect.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_bisect.c 2013-08-30 11:54:30 UTC (rev 59660)
+++ trunk/blender/source/blender/editors/mesh/editmesh_bisect.c 2013-08-30 12:48:39 UTC (rev 59661)
@@ -50,8 +50,8 @@
#include "mesh_intern.h" /* own include */
+static int mesh_bisect_exec(bContext *C, wmOperator *op);
-
/* -------------------------------------------------------------------- */
/* Model Helpers */
@@ -94,6 +94,7 @@
/* cross both to get a normal */
cross_v3_v3v3(plane_no, co_a, co_b);
+ normalize_v3(plane_no); /* not needed but nicer for user */
/* point on plane, can use either start or endpoint */
ED_view3d_win_to_3d(ar, co_ref, co_a_ss, plane_co);
@@ -110,6 +111,16 @@
{
int ret;
+ /* if the properties are set or there is no rv3d,
+ * skip model and exec immediately */
+
+ if ((CTX_wm_region_view3d(C) == NULL) ||
+ (RNA_struct_property_is_set(op->ptr, "plane_co") &&
+ RNA_struct_property_is_set(op->ptr, "plane_no")))
+ {
+ return mesh_bisect_exec(C, op);
+ }
+
ret = WM_gesture_straightline_invoke(C, op, event);
if (ret & OPERATOR_RUNNING_MODAL) {
View3D *v3d = CTX_wm_view3d(C);
More information about the Bf-blender-cvs
mailing list