[Bf-blender-cvs] [ae97a7ac102] master: Refactor: Move action foreach_id to new IDTypeInfo structure.

Bastien Montagne noreply at git.blender.org
Mon May 18 19:01:42 CEST 2020


Commit: ae97a7ac1026f1fe40365a2692abee7ef3ea06d2
Author: Bastien Montagne
Date:   Mon May 18 18:43:11 2020 +0200
Branches: master
https://developer.blender.org/rBae97a7ac1026f1fe40365a2692abee7ef3ea06d2

Refactor: Move action foreach_id to new IDTypeInfo structure.

===================================================================

M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/lib_query.c

===================================================================

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;
       }



More information about the Bf-blender-cvs mailing list