diff options
-rw-r--r-- | source/blender/src/editaction.c | 6 | ||||
-rw-r--r-- | source/blender/src/editipo.c | 20 |
2 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 98260e48717..62ee9563b3f 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -160,9 +160,9 @@ void remake_action_ipos (bAction *act) testhandles_ipocurve(icu); } } - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next){ + for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) { if (conchan->ipo) { - for (icu = conchan->ipo->curve.first; icu; icu=icu->next){ + for (icu = conchan->ipo->curve.first; icu; icu=icu->next) { sort_time_ipocurve(icu); testhandles_ipocurve(icu); } @@ -1047,7 +1047,7 @@ void delete_action_keys (void) allqueue(REDRAWNLA, 0); } -/* delete selected keyframes */ +/* delete selected action-channels (only achans and conchans are considered) */ void delete_action_channels (void) { ListBase act_data = {NULL, NULL}; diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 8d75090d911..f66e3bfc22c 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -5653,22 +5653,24 @@ void delete_ipo_keys(Ipo *ipo) IpoCurve *icu, *next; int i; - if (!ipo) + if (ipo == NULL) return; - for (icu=ipo->curve.first; icu; icu=next){ + for (icu= ipo->curve.first; icu; icu= next) { next = icu->next; - for (i=0; i<icu->totvert; i++){ - if (icu->bezt[i].f2 & 1){ - // Delete the item - memcpy (&icu->bezt[i], &icu->bezt[i+1], sizeof (BezTriple)*(icu->totvert-i-1)); + + /* Delete selected BezTriples */ + for (i=0; i<icu->totvert; i++) { + if (icu->bezt[i].f2 & SELECT) { + memcpy(&icu->bezt[i], &icu->bezt[i+1], sizeof(BezTriple)*(icu->totvert-i-1)); icu->totvert--; i--; } } - if (!icu->totvert){ - /* Delete the curve */ - BLI_remlink( &(ipo->curve), icu); + + /* Only delete if there isn't an ipo-driver still hanging around on an empty curve */ + if (icu->totvert==0 && icu->driver==NULL) { + BLI_remlink(&ipo->curve, icu); free_ipo_curve(icu); } } |