diff options
author | Jeroen Bakker <jbakker> | 2021-08-03 09:10:07 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-08-03 09:10:21 +0300 |
commit | 6f50969406a751ac69d41e792d859d74410ebef6 (patch) | |
tree | 79caf3176af7b9947fd7919b8e7227858563448a /source/blender/editors/armature/pose_lib.c | |
parent | ebd55b4acdc47ba2a412fd769aa6ab657abe97ca (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/armature/pose_lib.c')
-rw-r--r-- | source/blender/editors/armature/pose_lib.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index cb70b2810d1..646356e7a45 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -304,8 +304,6 @@ static int poselib_sanitize_exec(bContext *C, wmOperator *op) { Object *ob = get_poselib_object(C); bAction *act = (ob) ? ob->poselib : NULL; - DLRBT_Tree keys; - ActKeyColumn *ak; TimeMarker *marker, *markern; /* validate action */ @@ -315,11 +313,11 @@ static int poselib_sanitize_exec(bContext *C, wmOperator *op) } /* determine which frames have keys */ - BLI_dlrbTree_init(&keys); - action_to_keylist(NULL, act, &keys, 0); + struct AnimKeylist *keylist = ED_keylist_create(); + action_to_keylist(NULL, act, keylist, 0); /* for each key, make sure there is a corresponding pose */ - for (ak = keys.first; ak; ak = ak->next) { + LISTBASE_FOREACH (const ActKeyColumn *, ak, ED_keylist_listbase(keylist)) { /* check if any pose matches this */ /* TODO: don't go looking through the list like this every time... */ for (marker = act->markers.first; marker; marker = marker->next) { @@ -356,7 +354,7 @@ static int poselib_sanitize_exec(bContext *C, wmOperator *op) } /* free temp memory */ - BLI_dlrbTree_free(&keys); + ED_keylist_free(keylist); /* send notifiers for this - using keyframe editing notifiers, since action * may be being shown in anim editors as active action |