From 7e10a9e6ce3d788e28ee39c9d2e94605d2a0ba47 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 15 Dec 2010 17:36:08 +0000 Subject: ensure pasted graph keys are always selected. --- source/blender/editors/animation/keyframes_general.c | 12 +++++++++--- source/blender/editors/animation/keyframing.c | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 07c8ddcdb4a..a0585acf305 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -515,7 +515,7 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) for (ale= anim_data->first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; tAnimCopybufItem *aci; - BezTriple *bezt, *newbuf; + BezTriple *bezt, *nbezt, *newbuf; int i; /* firstly, check if F-Curve has any selected keyframes @@ -546,8 +546,14 @@ short copy_animedit_keys (bAnimContext *ac, ListBase *anim_data) memcpy(newbuf, aci->bezt, sizeof(BezTriple)*(aci->totvert)); /* copy current beztriple across too */ - *(newbuf + aci->totvert)= *bezt; - + nbezt= &newbuf[aci->totvert]; + *nbezt= *bezt; + + /* ensure copy buffer is selected so pasted keys are selected */ + nbezt->f1 |= SELECT; + nbezt->f2 |= SELECT; + nbezt->f3 |= SELECT; + /* free old array and set the new */ if (aci->bezt) MEM_freeN(aci->bezt); aci->bezt= newbuf; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 5d5f660213b..899f5ed2229 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -229,6 +229,10 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag) dst->vec[0][1] += dy; dst->vec[1][1] += dy; dst->vec[2][1] += dy; + + dst->f1= bezt->f1; + dst->f2= bezt->f2; + dst->f3= bezt->f3; // TODO: perform some other operations? } -- cgit v1.2.3