diff options
Diffstat (limited to 'source/blender/blenkernel/intern/volume.cc')
-rw-r--r-- | source/blender/blenkernel/intern/volume.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index a72b5268e1d..130aa957491 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -41,6 +41,7 @@ #include "BLI_utildefines.h" #include "BKE_anim_data.h" +#include "BKE_bpath.h" #include "BKE_geometry_set.hh" #include "BKE_global.h" #include "BKE_idtype.h" @@ -576,6 +577,18 @@ static void volume_foreach_cache(ID *id, function_callback(id, &key, (void **)&volume->runtime.grids, 0, user_data); } +static void volume_foreach_path(ID *id, BPathForeachPathData *bpath_data) +{ + Volume *volume = reinterpret_cast<Volume *>(id); + + if (volume->packedfile != nullptr && + (bpath_data->flag & BKE_BPATH_FOREACH_PATH_SKIP_PACKED) != 0) { + return; + } + + BKE_bpath_foreach_path_fixed_process(bpath_data, volume->filepath); +} + static void volume_blend_write(BlendWriter *writer, ID *id, const void *id_address) { Volume *volume = (Volume *)id; @@ -645,6 +658,7 @@ IDTypeInfo IDType_ID_VO = { /* name_plural */ "volumes", /* translation_context */ BLT_I18NCONTEXT_ID_VOLUME, /* flags */ IDTYPE_FLAGS_APPEND_IS_REUSABLE, + /* asset_type_info */ nullptr, /* init_data */ volume_init_data, /* copy_data */ volume_copy_data, @@ -652,6 +666,7 @@ IDTypeInfo IDType_ID_VO = { /* make_local */ nullptr, /* foreach_id */ volume_foreach_id, /* foreach_cache */ volume_foreach_cache, + /* foreach_path */ volume_foreach_path, /* owner_get */ nullptr, /* blend_write */ volume_blend_write, @@ -1225,7 +1240,6 @@ const VolumeGrid *BKE_volume_grid_active_get_for_read(const Volume *volume) return BKE_volume_grid_get_for_read(volume, index); } -/* Tries to find a grid with the given name. Make sure that the volume has been loaded. */ const VolumeGrid *BKE_volume_grid_find_for_read(const Volume *volume, const char *name) { int num_grids = BKE_volume_num_grids(volume); @@ -1365,7 +1379,6 @@ int BKE_volume_grid_channels(const VolumeGrid *grid) return 0; } -/* Transformation from index space to object space. */ void BKE_volume_grid_transform_matrix(const VolumeGrid *volume_grid, float mat[4][4]) { #ifdef WITH_OPENVDB |