diff options
author | Bastien Montagne <bastien@blender.org> | 2020-05-18 19:43:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-05-18 19:43:11 +0300 |
commit | ae97a7ac1026f1fe40365a2692abee7ef3ea06d2 (patch) | |
tree | ce67f24cfa3e915668ebffc9d44a2353f32c7d01 /source/blender/blenkernel | |
parent | 38a8d3aff1a8362530497299da351683a330ab59 (diff) |
Refactor: Move action foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_query.c | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 4f51e23496c..bd39ffc65e7 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -52,6 +52,7 @@ #include "BKE_idprop.h" #include "BKE_idtype.h" #include "BKE_lib_id.h" +#include "BKE_lib_query.h" #include "BKE_main.h" #include "BKE_object.h" @@ -154,6 +155,15 @@ static void action_free_data(struct ID *id) BLI_freelistN(&action->markers); } +static void action_foreach_id(ID *id, LibraryForeachIDData *data) +{ + bAction *act = (bAction *)id; + + LISTBASE_FOREACH (TimeMarker *, marker, &act->markers) { + BKE_LIB_FOREACHID_PROCESS(data, marker->camera, IDWALK_CB_NOP); + } +} + IDTypeInfo IDType_ID_AC = { .id_code = ID_AC, .id_filter = FILTER_ID_AC, @@ -168,6 +178,7 @@ IDTypeInfo IDType_ID_AC = { .copy_data = action_copy_data, .free_data = action_free_data, .make_local = NULL, + .foreach_id = action_foreach_id, }; /* ***************** Library data level operations on action ************** */ diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index 228620d5d34..ec9225258a0 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -982,11 +982,7 @@ static void library_foreach_ID_link(Main *bmain, } case ID_AC: { - bAction *act = (bAction *)id; - - LISTBASE_FOREACH (TimeMarker *, marker, &act->markers) { - CALLBACK_INVOKE(marker->camera, IDWALK_CB_NOP); - } + BLI_assert(0); break; } |