Dope Sheet: rewrite computation of keyframe hold blocks.
authorAlexander Gavrilov <angavrilov@gmail.com>
Sat, 13 Oct 2018 17:22:44 +0000 (20:22 +0300)
committerAlexander Gavrilov <angavrilov@gmail.com>
Tue, 16 Oct 2018 16:27:10 +0000 (19:27 +0300)
commitc7a84c23f11cfccfeacf7ccfdbe7eca967c9b4ed
treedad85fe356ddde3637544036879ef67dd7f37843
parentbd24ee8cb6ee295b7249c7a3e9dce482799c4599
Dope Sheet: rewrite computation of keyframe hold blocks.

Computation of hold blocks was done by storing ranges (with start and
an end, and likely overlapping) in a tree keyed only by the block start.
This cannot work well, and there even were comments that it is not
reliable in complex cases.

A much better way to deal with it is to split all ranges so they don't
overlap. The most thorough way of doing this is to split at all and every
known keyframe, and in this case the data can actually be stored in the
key column data structures, avoiding the need for a second tree.

In practice, splitting requires a pass to copy this data to newly added
keys, and the necessity to loop over all keyframes in the range being
added. Both are linear and don't add excess algorithmic complexity.

The new implementation also calls BLI_dlrbTree_linkedlist_sync for
its own needs, so the users of the *_to_keylist functions don't have
to do it themselves anymore.

Differential Revision: https://developer.blender.org/D3790
source/blender/blenkernel/intern/anim.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/armature/pose_lib.c
source/blender/editors/armature/pose_slide.c
source/blender/editors/include/ED_keyframes_draw.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_nla/nla_draw.c