[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26714] trunk/blender/source/blender/ editors/space_graph/graph_select.c: Graph editor, when ' Only Selected Handles' is enabled, dont allow selecting a handle unless they key is alredy partially selected .

Campbell Barton ideasman42 at gmail.com
Mon Feb 8 19:00:27 CET 2010


Revision: 26714
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26714
Author:   campbellbarton
Date:     2010-02-08 19:00:27 +0100 (Mon, 08 Feb 2010)

Log Message:
-----------
Graph editor, when 'Only Selected Handles' is enabled, dont allow selecting a handle unless they key is alredy partially selected.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_graph/graph_select.c

Modified: trunk/blender/source/blender/editors/space_graph/graph_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_select.c	2010-02-08 17:30:35 UTC (rev 26713)
+++ trunk/blender/source/blender/editors/space_graph/graph_select.c	2010-02-08 18:00:27 UTC (rev 26714)
@@ -687,7 +687,16 @@
 	NEAREST_HANDLE_KEY,
 	NEAREST_HANDLE_RIGHT
 } eHandleIndex; 
- 
+
+/* check if its ok to select a handle */
+// XXX also need to check for int-values only?
+static int fcurve_handle_sel_check(SpaceIpo *sipo, BezTriple *bezt)
+{
+	if (sipo->flag & SIPO_NOHANDLES) return 0;
+	if ((sipo->flag & SIPO_SELVHANDLESONLY) && BEZSELECTED(bezt)==0) return 0;
+	return 1;
+}
+
 /* Find the vertex (either handle (0/2) or the keyframe (1)) that is nearest to the mouse cursor (in area coordinates)  
  * Selected verts get a disadvantage, to make it easier to select handles behind.
  * Returns eHandleIndex
@@ -751,8 +760,7 @@
 				}
 				
 				/* handles - only do them if they're visible */
-				// XXX also need to check for int-values only?
-				if ((sipo->flag & SIPO_NOHANDLES)==0) {
+				if (fcurve_handle_sel_check(sipo, bezt1)) {
 					/* first handle only visible if previous segment had handles */
 					if ( (!prevbezt && (bezt1->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) )
 					{





More information about the Bf-blender-cvs mailing list