[Bf-blender-cvs] [6cb796e98e6] master: IDTypeInfo: add new callback to loop over all cache pointers of an ID.

Bastien Montagne noreply at git.blender.org
Fri Jul 3 12:56:35 CEST 2020


Commit: 6cb796e98e63aa859f5de762e4d542debfd932eb
Author: Bastien Montagne
Date:   Fri Jul 3 11:15:40 2020 +0200
Branches: master
https://developer.blender.org/rB6cb796e98e63aa859f5de762e4d542debfd932eb

IDTypeInfo: add new callback to loop over all cache pointers of an ID.

Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.

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

M	source/blender/blenkernel/BKE_idtype.h

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

diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index 56e788ccfe8..a823693e126 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -76,6 +76,14 @@ typedef void (*IDTypeMakeLocalFunction)(struct Main *bmain, struct ID *id, const
 
 typedef void (*IDTypeForeachIDFunction)(struct ID *id, struct LibraryForeachIDData *data);
 
+typedef void (*IDTypeForeachCacheFunctionCallback)(struct ID *id,
+                                                   const struct IDCacheKey *cache_key,
+                                                   void **cache_p,
+                                                   void *user_data);
+typedef void (*IDTypeForeachCacheFunction)(struct ID *id,
+                                           IDTypeForeachCacheFunctionCallback function_callback,
+                                           void *user_data);
+
 typedef struct IDTypeInfo {
   /* ********** General IDType data. ********** */
 
@@ -143,6 +151,11 @@ typedef struct IDTypeInfo {
    * pointers) of given data-block.
    */
   IDTypeForeachIDFunction foreach_id;
+
+  /**
+   * Iterator over all cache pointers of given ID.
+   */
+  IDTypeForeachCacheFunction foreach_cache;
 } IDTypeInfo;
 
 /* ********** Declaration of each IDTypeInfo. ********** */



More information about the Bf-blender-cvs mailing list