diff options
-rw-r--r-- | source/blender/blenkernel/BKE_animsys.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index bc6936ea21c..b448214ce28 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -23,6 +23,7 @@ struct FCurve; struct ID; struct KS_Path; struct KeyingSet; +struct LibraryForeachIDData; struct ListBase; struct Main; struct NlaKeyframingContext; @@ -86,6 +87,9 @@ struct KS_Path *BKE_keyingset_find_path(struct KeyingSet *ks, /* Copy all KeyingSets in the given list */ void BKE_keyingsets_copy(struct ListBase *newlist, const struct ListBase *list); +/** Process the ID pointers inside a scene's keyingsets, in see `BKE_lib_query.h` for details. */ +void BKE_keyingsets_foreach_id(struct LibraryForeachIDData *data, const struct ListBase *keyingsets); + /* Free the given Keying Set path */ void BKE_keyingset_free_path(struct KeyingSet *ks, struct KS_Path *ksp); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 6544ebd05df..4a522efc467 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -41,6 +41,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" @@ -249,6 +250,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 6d567bd050e..7827c40e2c2 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -800,6 +800,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( |