diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-05-09 06:37:12 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-05-09 06:37:12 +0400 |
commit | 029c27b0bed239cfc9b27b6ef92bcd3d87bcfd1b (patch) | |
tree | db4c07d66a0564e8ec4864f04db15547649a2bb5 /source/blender/editors/space_graph | |
parent | 5fa80e74a1d18ca8798b2b42f6b4ecc09787ba30 (diff) |
2.5 Bugfixes:
More work on getting these marker-dependent tools working. They should finally work now :)
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 13 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 11 |
2 files changed, 15 insertions, 9 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 40d66725847..d4bdfce5414 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1396,7 +1396,10 @@ static void snap_graph_keys(bAnimContext *ac, short mode) memset(&bed, 0, sizeof(BeztEditData)); bed.scene= ac->scene; - bed.list= ac->markers; /* for marker-snapping option */ + if (mode == GRAPHKEYS_SNAP_NEAREST_MARKER) { + bed.list.first= (ac->markers) ? ac->markers->first : NULL; + bed.list.last= (ac->markers) ? ac->markers->last : NULL; + } /* snap keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -1490,9 +1493,11 @@ static void mirror_graph_keys(bAnimContext *ac, short mode) TimeMarker *marker= NULL; /* find first selected marker */ - for (marker= ac->markers.first; marker; marker=marker->next) { - if (marker->flag & SELECT) { - break; + if (ac->markers) { + for (marker= ac->markers->first; marker; marker=marker->next) { + if (marker->flag & SELECT) { + break; + } } } diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index a2ecb3a3fad..3a99c9498ac 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -354,18 +354,19 @@ static void markers_selectkeys_between (bAnimContext *ac) bAnimListElem *ale; int filter; - BeztEditFunc select_cb; + BeztEditFunc ok_cb, select_cb; BeztEditData bed; float min, max; /* get extreme markers */ - ED_markers_get_minmax(&ac->markers, 1, &min, &max); - + ED_markers_get_minmax(ac->markers, 1, &min, &max); min -= 0.5f; max += 0.5f; /* get editing funcs + data */ + ok_cb= ANIM_editkeyframes_ok(BEZT_OK_FRAMERANGE); select_cb= ANIM_editkeyframes_select(SELECT_ADD); + memset(&bed, 0, sizeof(BeztEditData)); bed.f1= min; bed.f2= max; @@ -380,11 +381,11 @@ static void markers_selectkeys_between (bAnimContext *ac) if (nob) { ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); } else { - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, select_cb, NULL); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); } } |