Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-08 21:00:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-08 21:00:27 +0300
commit2aa028e77d13963ad07957cb1ce738641ad409c6 (patch)
tree72468025ef4a4cef559f14b09003013dcfd1f73a /source/blender/editors/space_graph
parent1cf9493e242f92e32d0c1674b7d7f8cfb698ef96 (diff)
Graph editor, when 'Only Selected Handles' is enabled, dont allow selecting a handle unless they key is alredy partially selected.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_select.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index d6ac1480985..b2a38c295fa 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -687,7 +687,16 @@ enum {
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 @@ static short findnearest_fcurve_vert (bAnimContext *ac, int mval[2], FCurve **fc
}
/* 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)) )
{