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:
authorCampbell Barton <ideasman42@gmail.com>2010-12-15 20:36:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-15 20:36:08 +0300
commit7e10a9e6ce3d788e28ee39c9d2e94605d2a0ba47 (patch)
tree219402ff686ad28ebc3d1fcca362062b71e7cb1a /source/blender/editors/animation
parent6b2b56c35eaf1ea8d2b0d0edd2412288f0e67e19 (diff)
ensure pasted graph keys are always selected.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/keyframes_general.c12
-rw-r--r--source/blender/editors/animation/keyframing.c4
2 files changed, 13 insertions, 3 deletions
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?
}