diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-01-09 03:05:26 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-01-09 03:05:26 +0300 |
commit | 489d8144153c2432a3e200579e877853d1790ec2 (patch) | |
tree | 1b99472f2ac4cb9f50fe700727055b77978c4d57 /source | |
parent | 494ca211031831b52b3944aa6245d15f093aa020 (diff) |
Bugfix #8021: Delete in Action Editor can remove pydrivers.py refs
Basically, Ipo-Curves are now not removed when deleting keyframes in the Action Editor, if there is still an attached IPO-Driver on that curve.
Diffstat (limited to 'source')
-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); } } |