Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyframes_general.c
| Context not available. | |||||
| } | } | ||||
| /* Delete selected keyframes in given F-Curve */ | /* Delete selected keyframes in given F-Curve */ | ||||
| void delete_fcurve_keys(FCurve *fcu) | bool delete_fcurve_keys(FCurve *fcu) | ||||
| { | { | ||||
| int i; | int i; | ||||
| bool modified = false; | |||||
| if (fcu->bezt == NULL) /* ignore baked curves */ | if (fcu->bezt == NULL) /* ignore baked curves */ | ||||
| return; | return false; | ||||
| /* Delete selected BezTriples */ | /* Delete selected BezTriples */ | ||||
| for (i = 0; i < fcu->totvert; i++) { | for (i = 0; i < fcu->totvert; i++) { | ||||
| Context not available. | |||||
| memmove(&fcu->bezt[i], &fcu->bezt[i + 1], sizeof(BezTriple) * (fcu->totvert - i - 1)); | memmove(&fcu->bezt[i], &fcu->bezt[i + 1], sizeof(BezTriple) * (fcu->totvert - i - 1)); | ||||
| fcu->totvert--; | fcu->totvert--; | ||||
| i--; | i--; | ||||
| modified = true; | |||||
| } | } | ||||
| } | } | ||||
| /* Free the array of BezTriples if there are not keyframes */ | /* Free the array of BezTriples if there are not keyframes */ | ||||
| if (fcu->totvert == 0) | if (fcu->totvert == 0) | ||||
| clear_fcurve_keys(fcu); | clear_fcurve_keys(fcu); | ||||
| return modified; | |||||
| } | } | ||||
| Context not available. | |||||