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:
authorJoshua Leung <aligorith@gmail.com>2009-12-30 13:21:45 +0300
committerJoshua Leung <aligorith@gmail.com>2009-12-30 13:21:45 +0300
commit35d629c97b9debd28378c8872ad5975d19f93420 (patch)
treec062109e419ef2c6ee34a306625ecfb783725cf2 /source/blender/editors/animation/keyframes_general.c
parent76a0fa5590aa52961ae344810f890f90a7b3194e (diff)
* Assorted comments/warnings fixes for animation code
* Made the dotted lines drawn for markers extend all the way to the top of the relevant views * Shortened the default names for markers
Diffstat (limited to 'source/blender/editors/animation/keyframes_general.c')
-rw-r--r--source/blender/editors/animation/keyframes_general.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index fb9d4d53b0f..a1ff940e8b9 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -67,21 +67,26 @@
/* **************************************************** */
-/* Only delete the nominated keyframe from provided ipo-curve.
+/* Only delete the nominated keyframe from provided F-Curve.
* Not recommended to be used many times successively. For that
- * there is delete_ipo_keys().
+ * there is delete_fcurve_keys().
*/
void delete_fcurve_key(FCurve *fcu, int index, short do_recalc)
{
- /* firstly check that index is valid */
- if (index < 0)
- index *= -1;
+ /* sanity check */
if (fcu == NULL)
return;
- if (index >= fcu->totvert)
+
+ /* verify the index:
+ * 1) cannot be greater than the number of available keyframes
+ * 2) negative indices are for specifying a value from the end of the array
+ */
+ if (abs(index) >= fcu->totvert)
return;
+ else if (index < 0)
+ index += fcu->totvert;
- /* Delete this key */
+ /* Delete this keyframe */
memmove(&fcu->bezt[index], &fcu->bezt[index+1], sizeof(BezTriple)*(fcu->totvert-index-1));
fcu->totvert--;
@@ -250,7 +255,7 @@ void clean_fcurve(FCurve *fcu, float thresh)
/* ---------------- */
-/* temp struct used for smooth_ipo */
+/* temp struct used for smooth_fcurve */
typedef struct tSmooth_Bezt {
float *h1, *h2, *h3; /* bezt->vec[0,1,2][1] */
} tSmooth_Bezt;