diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-01-28 14:38:12 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-01-28 14:38:12 +0300 |
commit | b9842ec247e5ae9458f59d24e98973ca17949ae7 (patch) | |
tree | 8a4753d24eb3b4818e98df58f6f90be35c0b0e4c /source/blender/src/editipo.c | |
parent | 0f157c6304a5f794035ccdb3087d605c61e143b7 (diff) |
== Action Editor - Overlapping Keyframes Bugfix ==
Now when moving keyframes in the Action Editor, any existing keyframes on the frames where a selected keyframe lands (after the transform) will be removed. This is to prevent stacks of keyframes which cause blips and headaches for animators (especially stressed animators with a looming deadline).
I've added an option to the Action Editor's View menu to turn this behaviour on/off (by default, it's on). This shouldn't need to be used too much, and may be removed in due course. If it stays, it'll need a better name...
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) |