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:
Diffstat (limited to 'source/blender/editors/animation/keyframes_general.c')
-rw-r--r--source/blender/editors/animation/keyframes_general.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index aec2b0f769a..00e2f221117 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -118,11 +118,13 @@ void clear_fcurve_keys(FCurve *fcu)
/* ---------------- */
-void duplicate_fcurve_keys(FCurve *fcu)
+bool duplicate_fcurve_keys(FCurve *fcu)
{
+ bool changed = false;
+
/* this can only work when there is an F-Curve, and also when there are some BezTriples */
if (ELEM(NULL, fcu, fcu->bezt)) {
- return;
+ return changed;
}
for (int i = 0; i < fcu->totvert; i++) {
@@ -135,7 +137,7 @@ void duplicate_fcurve_keys(FCurve *fcu)
memcpy(newbezt + i + 1, fcu->bezt + i, sizeof(BezTriple));
memcpy(newbezt + i + 2, fcu->bezt + i + 1, sizeof(BezTriple) * (fcu->totvert - (i + 1)));
fcu->totvert++;
-
+ changed = true;
/* reassign pointers... (free old, and add new) */
MEM_freeN(fcu->bezt);
fcu->bezt = newbezt;
@@ -148,6 +150,7 @@ void duplicate_fcurve_keys(FCurve *fcu)
BEZT_SEL_ALL(&fcu->bezt[i]);
}
}
+ return changed;
}
/* **************************************************** */