diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-03 16:27:12 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-03 16:28:09 +0300 |
commit | c9975088a908d0321271185661309e23e8bc1fb4 (patch) | |
tree | 41ed00898abd0648709bd7f8d1e1ed2c80ffe425 /source/blender/blenkernel/intern | |
parent | 1e255ce0319d6cf45b6951a2a87590d2ca236e9f (diff) |
Move volume to new cache management system for undo.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/volume.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index 39c04d117e2..18859869b4e 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -483,6 +483,20 @@ static void volume_foreach_id(ID *id, LibraryForeachIDData *data) } } +static void volume_foreach_cache(ID *id, + IDTypeForeachCacheFunctionCallback function_callback, + void *user_data) +{ + Volume *volume = (Volume *)id; + IDCacheKey key = { + /* id_session_uuid */ id->session_uuid, + /*offset_in_ID*/ offsetof(Volume, runtime.grids), + /* cache_v */ volume->runtime.grids, + }; + + function_callback(id, &key, (void **)&volume->runtime.grids, user_data); +} + IDTypeInfo IDType_ID_VO = { /* id_code */ ID_VO, /* id_filter */ FILTER_ID_VO, @@ -498,6 +512,7 @@ IDTypeInfo IDType_ID_VO = { /* free_data */ volume_free_data, /* make_local */ nullptr, /* foreach_id */ volume_foreach_id, + /* foreach_cache */ volume_foreach_cache, }; void BKE_volume_init_grids(Volume *volume) |