#107126: Make FCurve.update() also deduplicate keys
The RNA function `FCurve.update()` now also deduplicates keys. This is done in a way that is independent of key selection; simply the last key in the list of keyframes 'wins' and overwrites earlier ones. It is exactly the same as `FCurve.keyframe_points.deduplicate()`.
This commit is contained in:
parent
f5dd7d5e6c
commit
6452eccc80
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue