diff options
author | Bastien Montagne <bastien@blender.org> | 2022-02-14 14:05:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-02-14 14:05:11 +0300 |
commit | 3a9a37d6dccb0a981b1fad0cda977b4a445341a1 (patch) | |
tree | a4a29731519ca5baa9cf7d6474ad920027477322 /source/blender/blenkernel/intern | |
parent | e0fd31f083e0cd835635013a31fd3da6cf298ffa (diff) |
Fix T95601: Missing handling of keyingsets ID pointers in lib_query/foreach_id code.
This will have to be backported to 2.93 and possibly 2.83 if possible.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index b5ea68aaadc..0698311ba4b 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -57,6 +57,7 @@ #include "BKE_fcurve.h" #include "BKE_global.h" #include "BKE_lib_id.h" +#include "BKE_lib_query.h" #include "BKE_main.h" #include "BKE_material.h" #include "BKE_nla.h" @@ -265,6 +266,15 @@ void BKE_keyingsets_copy(ListBase *newlist, const ListBase *list) } } +void BKE_keyingsets_foreach_id(LibraryForeachIDData *data, const ListBase *keyingsets) +{ + for (KeyingSet *ksn = keyingsets->first; ksn; ksn = ksn->next) { + for (KS_Path *kspn = ksn->paths.first; kspn; kspn = kspn->next) { + BKE_LIB_FOREACHID_PROCESS_ID(data, kspn->id, IDWALK_CB_NOP); + } + } +} + /* Freeing Tools --------------------------- */ void BKE_keyingset_free(KeyingSet *ks) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index ed9f10aaa91..203676d0dd8 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -816,6 +816,9 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data) data, SEQ_for_each_callback(&scene->ed->seqbase, seq_foreach_member_id_cb, data)); } + BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, + BKE_keyingsets_foreach_id(data, &scene->keyingsets)); + /* This pointer can be NULL during old files reading, better be safe than sorry. */ if (scene->master_collection != NULL) { BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL( |