diff --git a/scripts/modules/bpy_extras/anim_utils.py b/scripts/modules/bpy_extras/anim_utils.py index 27378abadde..291cc970866 100644 --- a/scripts/modules/bpy_extras/anim_utils.py +++ b/scripts/modules/bpy_extras/anim_utils.py @@ -571,8 +571,6 @@ class KeyframesCo: keyframe_points.foreach_set("co", co_buffer) keyframe_points.foreach_set("interpolation", ipo_buffer) - # TODO: in Blender 4.0 the next lines can be replaced with one call to `fcurve.update()`. - # See https://projects.blender.org/blender/blender/issues/107126 for more info. - keyframe_points.sort() - keyframe_points.deduplicate() - keyframe_points.handles_recalc() + # This also deduplicates keys where baked keys were inserted on the + # same frame as existing ones. + fcurve.update() diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 120c1b0923f..ffa641a9640 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -694,7 +694,7 @@ static void rna_tag_animation_update(Main *bmain, ID *id) static void rna_FCurve_update_data_ex(ID *id, FCurve *fcu, Main *bmain) { sort_time_fcurve(fcu); - /* TODO: Blender 4.0 should call BKE_fcurve_deduplicate_keys(fcu) here. */ + BKE_fcurve_deduplicate_keys(fcu); BKE_fcurve_handles_recalc(fcu); rna_tag_animation_update(bmain, id);