[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17262] branches/animsys2/source/blender/ src/editipo_mods.c: AnimSys2: IPO-Editor Borderselect

Joshua Leung aligorith at gmail.com
Sat Nov 1 12:35:59 CET 2008


Revision: 17262
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17262
Author:   aligorith
Date:     2008-11-01 12:35:59 +0100 (Sat, 01 Nov 2008)

Log Message:
-----------
AnimSys2: IPO-Editor Borderselect

There seems to be a consensus that the behaviour of the IPO-borderselect tool was far too messy. 
1. "It's too easy to accidentally select tangents of other keys". 
2. "When moving multiple keys, the handles for the selected keys (and only those keys) should move automatically with them"

I've modified the behaviour so that the following occurs:
* Only keyframes can get selected by borderselect (i.e. only the coordinates of the keyframe but not its handles are tested if they lie within the box)
* Handles of a keyframe which lies within the borderselect region will inherit whatever selection status gets applied to that keyframe. This is consistent with clicking on the keyframes individually.

Modified Paths:
--------------
    branches/animsys2/source/blender/src/editipo_mods.c

Modified: branches/animsys2/source/blender/src/editipo_mods.c
===================================================================
--- branches/animsys2/source/blender/src/editipo_mods.c	2008-11-01 11:35:08 UTC (rev 17261)
+++ branches/animsys2/source/blender/src/editipo_mods.c	2008-11-01 11:35:59 UTC (rev 17262)
@@ -1061,20 +1061,27 @@
 			int selflag= (val==LEFTMOUSE) ? SELECT : 0;
 			
 			ei= G.sipo->editipo;
-			for(a=0; a<G.sipo->totipo; a++, ei++) {
+			for (a=0; a<G.sipo->totipo; a++, ei++) {
 				if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu)) {
-					if(ei->icu->bezt) {
-						b= ei->icu->totvert;
+					if (ei->icu->bezt) {
 						bezt= ei->icu->bezt;
-						while(b--) {
-							if(BLI_in_rctf(&rectf, bezt->vec[0][0], bezt->vec[0][1]))
-								bezt->f1 = selflag ? (bezt->f1 | SELECT) : (bezt->f1 & ~SELECT);
-							if(BLI_in_rctf(&rectf, bezt->vec[1][0], bezt->vec[1][1]))
-								bezt->f2 = selflag ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
-							if(BLI_in_rctf(&rectf, bezt->vec[2][0], bezt->vec[2][1]))
-								bezt->f3 = selflag ? (bezt->f3 | SELECT) : (bezt->f3 & ~SELECT);
-
-							bezt++;
+						for (b=0; b < ei->icu->totvert; b++, bezt++) {
+							/* Borderselect only selects keyframes now, as overshooting handles often get caught too,
+							 * which means that they may be inadvertantly moved as well.
+							 * Also, for convenience, handles should get same status as keyframe (if it was within bounds)
+							 */
+							if (BLI_in_rctf(&rectf, bezt->vec[1][0], bezt->vec[1][1])) {
+								if (selflag) {
+									bezt->f1 |= SELECT;
+									bezt->f2 |= SELECT;
+									bezt->f3 |= SELECT;
+								}
+								else {
+									bezt->f1 &= ~SELECT;
+									bezt->f2 &= ~SELECT;
+									bezt->f3 &= ~SELECT;
+								}
+							}
 						}
 					}
 				}





More information about the Bf-blender-cvs mailing list