Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-10-13 20:22:44 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-10-16 19:27:10 +0300
commitc7a84c23f11cfccfeacf7ccfdbe7eca967c9b4ed (patch)
treedad85fe356ddde3637544036879ef67dd7f37843 /source/blender/editors/animation/anim_draw.c
parentbd24ee8cb6ee295b7249c7a3e9dce482799c4599 (diff)
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
Diffstat (limited to 'source/blender/editors/animation/anim_draw.c')
-rw-r--r--source/blender/editors/animation/anim_draw.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 0ab6cdb3526..48dd310e2b4 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -551,11 +551,11 @@ static bool find_prev_next_keyframes(struct bContext *C, int *nextfra, int *prev
}
/* populate tree with keyframe nodes */
- scene_to_keylist(&ads, scene, &keys, NULL);
+ scene_to_keylist(&ads, scene, &keys);
gpencil_to_keylist(&ads, scene->gpd, &keys, false);
if (ob) {
- ob_to_keylist(&ads, ob, &keys, NULL);
+ ob_to_keylist(&ads, ob, &keys);
gpencil_to_keylist(&ads, ob->data, &keys, false);
}
@@ -564,9 +564,6 @@ static bool find_prev_next_keyframes(struct bContext *C, int *nextfra, int *prev
mask_to_keylist(&ads, masklay, &keys);
}
- /* build linked-list for searching */
- BLI_dlrbTree_linkedlist_sync(&keys);
-
/* find matching keyframe in the right direction */
do {
aknext = (ActKeyColumn *)BLI_dlrbTree_search_next(&keys, compare_ak_cfraPtr, &cfranext);