diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-03-07 07:24:28 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-03-07 07:24:28 +0300 |
commit | 4cf9fa3e59ce216e5f2489936a369f8e7b27b3db (patch) | |
tree | de49ce88763510b2c242fdecdf8072337f428bd5 /source/blender/editors/animation/keyframes_general.c | |
parent | c07acfb4fd100cd3e4eb2ac12b0941ce6c9575e1 (diff) |
Animation Editors: Copy/Paste Keyframe changes
As was discussed by the team the other day, copying keyframes (to copy/paste buffer) in DopeSheet/Graph Editor no longer relies on the selection status of the F-Curves, but rather on the selected keyframes only. This should be less confusing...
However, pasting keyframes still relies on having F-Curves selected to aid in the channel-matching process. There is still a lot of room for improvement in this area though (as noted in the code!).
Diffstat (limited to 'source/blender/editors/animation/keyframes_general.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index fc6ed9b00bb..48ca06fb73d 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -420,13 +420,20 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) /* clear buffer first */ free_anim_copybuf(); - /* assume that each of these is an ipo-block */ + /* assume that each of these is an F-Curve */ for (ale= anim_data->first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; tAnimCopybufItem *aci; BezTriple *bezt, *newbuf; int i; + /* firstly, check if F-Curve has any selected keyframes + * - skip if no selected keyframes found (so no need to create unnecessary copy-buffer data) + * - this check should also eliminate any problems associated with using sample-data + */ + if (ANIM_fcurve_keys_bezier_loop(NULL, fcu, NULL, ANIM_editkeyframes_ok(BEZT_OK_SELECTED), NULL) == 0) + continue; + /* init copybuf item info */ aci= MEM_callocN(sizeof(tAnimCopybufItem), "AnimCopybufItem"); aci->id= ale->id; @@ -436,7 +443,6 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) BLI_addtail(&animcopybuf, aci); /* add selected keyframes to buffer */ - // XXX we don't cope with sample-data yet // TODO: currently, we resize array everytime we add a new vert - this works ok as long as it is assumed only a few keys are copied for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { if (BEZSELECTED(bezt)) { |