I can add and remove keyframes like this via python, no issues arise.
#remove all existing keys
for i in reversed(range(0, len(fcu.keyframe_points))):
fcu.keyframe_points.remove(fcu.keyframe_points[i])
#insert the corrected keys
for frame, sample in zip(new_frames, new_samples):
fcu.keyframe_points.insert(frame, sample)
But I want to use the fast option to avoid updating the fcurve after each modification and only update after the loop:
#remove all existing keys
for i in reversed(range(0, len(fcu.keyframe_points))):
fcu.keyframe_points.remove(fcu.keyframe_points[i], fast=True)
fcu.update()
#insert the corrected keys
for frame, sample in zip(new_frames, new_samples):
fcu.keyframe_points.insert(frame, sample, set(("FAST", )))
fcu.update()
Now that code is also functional, but in the dope sheet, the resulting keyframes are dark grey instead of the usual white. Anything I'm missing or is this intended behavior? Does the color have any significance?