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:
authorJeroen Bakker <jbakker>2021-08-03 09:10:07 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-03 09:10:21 +0300
commit6f50969406a751ac69d41e792d859d74410ebef6 (patch)
tree79caf3176af7b9947fd7919b8e7227858563448a /source/blender/editors/screen/screen_ops.c
parentebd55b4acdc47ba2a412fd769aa6ab657abe97ca (diff)
Cleanup: Hide implementation details for ED_keyframe_keylist.
For T78995 we want to change the data structure of keylists to improve performance. (Probably a Vector with bin-search capabilities). This patch hides the internal structure of the keylists behind `AnimKeylist` structure. This allows us to change the internals without 'breaking' where it is being used. The change adds functions to create, free, find and walk over the keylist. Reviewed By: sybren Maniphest Tasks: T78995 Differential Revision: https://developer.blender.org/D11974
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r--source/blender/editors/screen/screen_ops.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index f172e22ea56..107466a8a0b 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3057,8 +3057,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
float cfra = (float)(CFRA);
/* init binarytree-list for getting keyframes */
- DLRBT_Tree keys;
- BLI_dlrbTree_init(&keys);
+ struct AnimKeylist *keylist = ED_keylist_create();
/* seed up dummy dopesheet context with flags to perform necessary filtering */
if ((scene->flag & SCE_KEYS_NO_SELONLY) == 0) {
@@ -3067,14 +3066,14 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
}
/* populate tree with keyframe nodes */
- scene_to_keylist(&ads, scene, &keys, 0);
+ scene_to_keylist(&ads, scene, keylist, 0);
if (ob) {
- ob_to_keylist(&ads, ob, &keys, 0);
+ ob_to_keylist(&ads, ob, keylist, 0);
if (ob->type == OB_GPENCIL) {
const bool active = !(scene->flag & SCE_KEYS_NO_SELONLY);
- gpencil_to_keylist(&ads, ob->data, &keys, active);
+ gpencil_to_keylist(&ads, ob->data, keylist, active);
}
}
@@ -3082,17 +3081,17 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
Mask *mask = CTX_data_edit_mask(C);
if (mask) {
MaskLayer *masklay = BKE_mask_layer_active(mask);
- mask_to_keylist(&ads, masklay, &keys);
+ mask_to_keylist(&ads, masklay, keylist);
}
}
/* find matching keyframe in the right direction */
ActKeyColumn *ak;
if (next) {
- ak = (ActKeyColumn *)BLI_dlrbTree_search_next(&keys, compare_ak_cfraPtr, &cfra);
+ ak = ED_keylist_find_next(keylist, cfra);
}
else {
- ak = (ActKeyColumn *)BLI_dlrbTree_search_prev(&keys, compare_ak_cfraPtr, &cfra);
+ ak = ED_keylist_find_prev(keylist, cfra);
}
while ((ak != NULL) && (done == false)) {
@@ -3113,7 +3112,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
}
/* free temp stuff */
- BLI_dlrbTree_free(&keys);
+ ED_keylist_free(keylist);
/* any success? */
if (done == false) {