diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-01-29 19:42:57 +0300 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-01-29 19:42:57 +0300 |
commit | 2f4ca518ea468f6c2e06a70aa24f16cf8a141425 (patch) | |
tree | 345202ea0fdd63429f4207003ef44aeebe8578ac /source/blender/src/editipo.c | |
parent | 5da7f4df472f41997a1f424315f94d0d04b3dd30 (diff) | |
parent | fd9db17021064552cdecbcfadce4255257d71e17 (diff) |
svn merge -r 13415:13452 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/src/editipo.c')
-rw-r--r-- | source/blender/src/editipo.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index b3ea3e1931c..fce7fab779d 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -2624,10 +2624,10 @@ void insertkey_smarter(ID *id, int blocktype, char *actname, char *constname, in /* delete keyframe immediately before/after newly added */ switch (insert_mode) { case KEYNEEDED_DELPREV: - delete_icu_key(icu, icu->totvert-2); + delete_icu_key(icu, icu->totvert-2, 1); break; case KEYNEEDED_DELNEXT: - delete_icu_key(icu, 1); + delete_icu_key(icu, 1, 1); break; } } @@ -5642,22 +5642,25 @@ void remake_object_ipos(Object *ob) /* Only delete the nominated keyframe from provided ipo-curve. * Not recommended to be used many times successively. For that - * there is delete_ipo_keys(). */ -void delete_icu_key(IpoCurve *icu, int index) + * there is delete_ipo_keys(). + */ +void delete_icu_key(IpoCurve *icu, int index, short do_recalc) { /* firstly check that index is valid */ if (index < 0) index *= -1; + if (icu == NULL) + return; if (index >= icu->totvert) return; - if (!icu) return; /* Delete this key */ - memcpy (&icu->bezt[index], &icu->bezt[index+1], sizeof (BezTriple)*(icu->totvert-index-1)); + memcpy(&icu->bezt[index], &icu->bezt[index+1], sizeof(BezTriple)*(icu->totvert-index-1)); icu->totvert--; - /* recalc handles */ - calchandles_ipocurve(icu); + /* recalc handles - only if it won't cause problems */ + if (do_recalc) + calchandles_ipocurve(icu); } void delete_ipo_keys(Ipo *ipo) |