[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29210] trunk/blender/source/blender/ editors/space_view3d/view3d_select.c: Fix [#22480] brush/circle select ( C-key) causes problems in other modes

Matt Ebb matt at mke3.net
Fri Jun 4 08:02:49 CEST 2010


Revision: 29210
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29210
Author:   broken
Date:     2010-06-04 08:02:46 +0200 (Fri, 04 Jun 2010)

Log Message:
-----------
Fix [#22480] brush/circle select (C-key) causes problems in other modes

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_select.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_select.c	2010-06-04 03:17:35 UTC (rev 29209)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_select.c	2010-06-04 06:02:46 UTC (rev 29210)
@@ -218,6 +218,23 @@
 
 /* *********************** GESTURE AND LASSO ******************* */
 
+static int view3d_selectable_data(bContext *C)
+{
+	Object *ob = CTX_data_active_object(C);
+	
+	if (!ED_operator_view3d_active(C))
+		return 0;
+	
+	if (!CTX_data_edit_object(C))
+		if (ob && ob->mode & OB_MODE_SCULPT)
+			return 0;
+		if (ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob))
+			return 0;
+	
+	return 1;
+}
+
+
 /* helper also for borderselect */
 static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2)
 {
@@ -778,7 +795,7 @@
 	ot->invoke= WM_gesture_lasso_invoke;
 	ot->modal= WM_gesture_lasso_modal;
 	ot->exec= view3d_lasso_select_exec;
-	ot->poll= WM_operator_winactive;
+	ot->poll= view3d_selectable_data;
 	
 	/* flags */
 	ot->flag= OPTYPE_UNDO;
@@ -1706,9 +1723,8 @@
 	ot->invoke= WM_border_select_invoke;
 	ot->exec= view3d_borderselect_exec;
 	ot->modal= WM_border_select_modal;
+	ot->poll= view3d_selectable_data;
 	
-	ot->poll= ED_operator_view3d_active;
-	
 	/* flags */
 	ot->flag= OPTYPE_UNDO;
 	
@@ -2113,7 +2129,7 @@
 	ot->invoke= WM_gesture_circle_invoke;
 	ot->modal= WM_gesture_circle_modal;
 	ot->exec= view3d_circle_select_exec;
-	ot->poll= ED_operator_view3d_active;
+	ot->poll= view3d_selectable_data;
 	
 	/* flags */
 	ot->flag= OPTYPE_UNDO;





More information about the Bf-blender-cvs mailing list