Sybren A. Stüvel
85ed2e8c36
Animation: add function for deduplicating FCurve keys
...
Introduce `BKE_fcurve_deduplicate_keys()` to merge keys that are on the
same time, or within the time comparison threshold (1/100th of a frame).
When merging two consecutive keys, the last one 'wins' and determines
the final key *value*. The first key's *time* is retained, to ensure the
reference point for the next comparisons is stable. The only exception
here is when there is a key exactly on an integer frame number, in which
case that one is preferred.
The function is exposed in RNA as `fcurve.keyframe_points.deduplicate()`
This commit also introduces a new function `BKE_fcurve_bezt_shrink(fcu,
new_totvert);` that can reallocate the `bezt` array to ensure removed
keys no longer take up memory.
The RNA function `fcurve.update()` currently performs two steps, which
are now exposed to RNA as well, as `keyframe_points.sort()` and
`keyframe_points.handles_recalc()`. This is so that Python code can
sort, deduplicate, and then recalculate the handles only once (calling
`update` + `deduplicate` would do the latter twice).
In Blender 4.0 the deduplication will also be part of `fcurve.update()`,
see #107126 .
Reviewed on https://projects.blender.org/blender/blender/pulls/107089
2023-04-24 12:07:28 +02:00
..
2023-04-24 12:07:28 +02:00
2023-02-12 14:56:05 +11:00
2023-02-12 14:56:05 +11:00
2023-04-21 14:14:27 +02:00
2022-10-04 16:52:10 +11:00
2022-11-01 12:24:58 +11:00
2023-03-30 12:25:42 +02:00
2023-04-14 16:08:05 +02:00
2023-03-30 10:51:59 +02:00
2023-04-19 11:21:06 +02:00
2022-11-26 10:12:58 -06:00
2023-04-11 15:20:52 +02:00
2022-10-06 12:13:00 +11:00
2023-03-02 17:22:42 +01:00
2023-03-17 16:45:42 +11:00
2023-01-18 18:41:13 +11:00
2023-04-12 18:33:53 -07:00
2023-04-17 13:47:41 +02:00
2023-03-30 10:51:59 +02:00
2023-03-09 12:05:30 +11:00
2022-12-20 19:16:33 -03:00
2023-03-30 10:51:59 +02:00
2023-04-17 13:47:41 +02:00
2023-03-21 18:38:04 +01:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2022-12-29 20:46:05 +01:00
2023-03-16 15:40:31 +01:00
2022-11-12 18:33:31 +01:00
2023-03-30 10:51:59 +02:00
2023-02-14 16:33:38 +01:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2023-01-16 12:06:36 -06:00
2023-01-06 11:41:36 -05:00
2023-03-30 10:51:59 +02:00
2023-01-23 14:43:04 -06:00
2023-04-19 15:52:56 -04:00
2023-04-20 23:32:33 +02:00
2023-04-13 14:57:57 +02:00
2023-03-30 10:51:59 +02:00
2023-04-17 13:47:41 +02:00
2023-04-17 13:47:41 +02:00
2023-01-18 18:41:13 +11:00
2022-11-01 12:24:04 +11:00
2022-11-05 13:47:01 +11:00
2022-10-12 20:55:57 -05:00
2023-01-10 01:01:43 -05:00
2022-09-29 18:32:44 -05:00
2022-09-14 21:30:56 +02:00
2023-03-06 16:01:47 +01:00
2023-04-24 12:07:28 +02:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2023-04-21 14:14:27 +02:00
2023-02-06 21:25:45 +01:00
2023-01-18 18:41:13 +11:00
2023-03-28 13:57:51 +02:00
2023-04-05 14:39:51 +10:00
2023-03-13 10:42:51 +01:00
2023-03-13 11:57:03 +01:00
2023-03-29 14:37:34 +11:00
2023-03-13 10:42:51 +01:00
2023-03-13 10:42:51 +01:00
2023-04-16 20:41:22 +10:00
2023-03-30 18:51:33 -04:00
2023-01-20 17:36:47 -06:00
2023-03-08 12:35:58 +01:00
2022-10-03 20:45:06 +02:00
2023-03-29 16:50:54 +02:00
2023-03-29 16:50:54 +02:00
2023-03-27 12:08:14 +11:00
2023-02-06 21:25:45 +01:00
2023-03-30 10:51:59 +02:00
2023-01-13 17:22:07 -06:00
2022-08-17 10:20:25 -04:00
2023-04-17 12:59:03 +02:00
2023-04-19 15:52:56 -04:00
2023-03-30 10:51:59 +02:00
2023-04-14 13:29:19 +02:00
2023-04-14 16:59:47 +02:00
2023-04-17 17:12:19 +02:00
2023-03-30 10:51:59 +02:00
2023-02-06 19:29:21 +01:00
2023-03-14 12:53:37 +11:00
2023-03-30 10:51:59 +02:00
2022-08-17 10:20:25 -04:00
2022-10-05 13:48:01 -05:00
2023-03-30 10:51:59 +02:00
2023-03-03 10:09:20 +11:00
2023-03-27 11:48:10 -04:00
2023-04-17 13:47:41 +02:00
2023-04-17 13:47:41 +02:00
2023-03-30 10:51:59 +02:00
2023-04-17 13:47:41 +02:00
2023-03-30 10:51:59 +02:00
2023-03-20 15:55:13 +01:00
2023-03-20 15:55:13 +01:00
2023-04-04 20:39:28 +02:00
2023-04-23 15:27:20 -04:00
2023-01-18 18:41:13 +11:00
2023-04-19 15:52:56 -04:00
2023-04-19 09:02:21 +10:00
2023-02-06 15:40:15 +01:00
2023-03-30 10:51:59 +02:00
2023-04-04 20:39:28 +02:00
2023-03-02 15:02:30 +01:00
2023-04-03 18:23:30 +02:00
2022-11-18 11:20:13 +01:00
2023-04-22 13:11:51 +02:00
2023-02-12 14:56:05 +11:00
2022-08-19 22:21:04 +02:00
2023-04-13 13:13:56 +10:00
2023-04-04 20:39:28 +02:00
2023-04-05 14:39:51 +10:00
2023-04-14 21:16:42 +02:00
2023-04-12 11:24:10 +10:00
2023-04-19 15:52:56 -04:00
2023-01-02 16:39:51 +01:00
2023-03-30 10:51:59 +02:00
2022-09-14 21:30:56 +02:00
2023-04-05 15:30:32 +02:00
2023-03-30 10:51:59 +02:00
2023-04-04 20:39:28 +02:00
2023-03-30 10:51:59 +02:00
2023-04-21 16:53:27 +02:00
2023-03-30 10:51:59 +02:00
2023-04-16 20:41:22 +10:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2023-04-17 13:47:41 +02:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00
2023-03-01 14:13:05 +01:00
2023-03-30 10:51:59 +02:00
2023-03-24 17:09:39 +11:00
2023-03-30 10:51:59 +02:00
2023-01-07 17:32:28 +01:00
2023-01-23 00:33:55 +01:00
2023-04-21 19:08:44 +02:00
2022-09-28 17:54:59 +02:00
2023-04-04 20:39:28 +02:00
2023-04-19 15:52:56 -04:00
2023-04-18 20:30:00 +10:00
2022-10-21 20:10:17 -06:00
2023-04-14 13:35:08 +02:00
2022-09-06 16:25:20 +10:00
2023-03-30 10:51:59 +02:00
2023-03-30 10:51:59 +02:00