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:
authorJoshua Leung <aligorith@gmail.com>2010-01-19 22:53:50 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-19 22:53:50 +0300
commit21004122847fb2570fd61de6677d2b0c8f96444a (patch)
tree0c9b777d8ae322e79bb446d0eb89d9ec4e65aba2 /source/blender/editors/space_graph
parentc54d54e8aeb386fd8f5cbd61d62fb5a490bb6ea8 (diff)
Small tweaks to 26108 - Graph Select Borderselect:
Campbell's fix was ok, but just added a few comments as to why the previous way didn't work. Also, fixed the bug where borderselect would make all F-Curves selected regardless of whether any keyframes on those curves were selected.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_select.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index b19b6fdbbc9..468467e3421 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -239,37 +239,36 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
FCurve *fcu= (FCurve *)ale->key_data;
-
+
+ /* apply NLA mapping to all the keyframes, since it's easier than trying to
+ * guess when a callback might use something different
+ */
if (adt)
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
-
- /* set horizontal range (if applicable) */
+
+ /* set horizontal range (if applicable)
+ * NOTE: these values are only used for x-range and y-range but not region
+ * (which uses bed.data, i.e. rectf)
+ */
if (mode != BEZT_OK_VALUERANGE) {
- /* if channel is mapped in NLA, apply correction */
- if (adt) {
- bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP);
- bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP);
- }
- else {
- bed.f1= rectf.xmin;
- bed.f2= rectf.xmax;
- }
+ bed.f1= rectf.xmin;
+ bed.f2= rectf.xmax;
}
else {
bed.f1= rectf.ymin;
bed.f2= rectf.ymax;
}
- /* select keyframes that are in the appropriate places */
- ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL);
-
- /* select the curve too
- * NOTE: this should really only happen if the curve got touched...
- */
- if (selectmode == SELECT_ADD) {
- fcu->flag |= FCURVE_SELECTED;
+ /* firstly, check if any keyframes will be hit by this */
+ if (ANIM_fcurve_keys_bezier_loop(&bed, fcu, NULL, ok_cb, NULL)) {
+ /* select keyframes that are in the appropriate places */
+ ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL);
+
+ /* select the curve too now that curve will be touched */
+ if (selectmode == SELECT_ADD)
+ fcu->flag |= FCURVE_SELECTED;
}
-
+
/* un-apply NLA mapping from all the keyframes */
if (adt)
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);