FBFCurve class starting from MoBu 2011 has changed. There are no methods KeyRemove, KeyDelete and documentation indicated that it was not to replace them.
What to do in this situation.
1. I found a way not using the delete key method in the curve: just create a new curve, write only the necessary keys there, and then reassign the curve as desired. example
def curveCutRight(node, time):
newcurve = FBFCurve()
curve = node.FCurve
count = len(curve.Keys)
for key in curve.Keys:
if (key.Time.Get() != time.Get()): break
node.FCurve = newcurve
del newcurve, count
2. Today at AREA, Oskar Holmstrand was reported about some undocumented functions to work with a key
myFCurve.KeyDeleteByTimeRange(time, time, bool)
Accordingly, in the first case, we indicate with a key index on which to delete, and second, we specify the time period in which the keys must be removed. Very convenient, sorry there is no documentation for that.
Accordingly, in the first case, we indicate with a key index on which to delete, and second, we specify the time period in which the keys need to remove a third option – whether we should remove the key which time coincides with the boundaries of the range.
Keep in mind that you can specify time ranges from minus infinity to plus infinity. For example, to delete all the keys of time greater than some given time, including the boundary of the range:
curve.KeyDeleteByTimeRange(time, FBTime.Infinity, True)