67 #define VOLUME_FRAME_NONE INT_MAX
77 # include <unordered_set>
79 # include <openvdb/openvdb.h>
80 # include <openvdb/points/PointDataGrid.h>
81 # include <openvdb/tools/GridTransformer.h>
104 static struct VolumeFileCache {
107 Entry(
const std::string &filepath,
const openvdb::GridBase::Ptr &grid)
108 : filepath(filepath),
109 grid_name(grid->getName()),
112 num_metadata_users(0),
118 : filepath(other.filepath),
119 grid_name(other.grid_name),
121 is_loaded(other.is_loaded),
122 num_metadata_users(0),
128 openvdb::GridBase::Ptr simplified_grid(
const int simplify_level)
131 if (simplify_level == 0 || !is_loaded) {
135 std::lock_guard<std::mutex> lock(
mutex);
136 return simplified_grids.lookup_or_add_cb(simplify_level, [&]() {
137 const float resolution_factor = 1.0f / (1 << simplify_level);
138 const VolumeGridType grid_type = BKE_volume_grid_type_openvdb(*grid);
139 return BKE_volume_grid_create_with_changed_resolution(grid_type, *grid, resolution_factor);
144 std::string filepath;
145 std::string grid_name;
148 openvdb::GridBase::Ptr grid;
154 mutable bool is_loaded;
156 std::string error_msg;
158 int num_metadata_users;
167 std::hash<std::string> string_hasher;
169 string_hasher(entry.grid_name));
176 return a.filepath == b.filepath &&
a.grid_name == b.grid_name;
186 Entry *add_metadata_user(
const Entry &template_entry)
188 std::lock_guard<std::mutex> lock(
mutex);
189 EntrySet::iterator it = cache.find(template_entry);
190 if (it == cache.end()) {
191 it = cache.emplace(template_entry).first;
196 entry.num_metadata_users++;
203 void copy_user(
Entry &entry,
const bool tree_user)
205 std::lock_guard<std::mutex> lock(
mutex);
207 entry.num_tree_users++;
210 entry.num_metadata_users++;
214 void remove_user(
Entry &entry,
const bool tree_user)
216 std::lock_guard<std::mutex> lock(
mutex);
218 entry.num_tree_users--;
221 entry.num_metadata_users--;
223 update_for_remove_user(entry);
226 void change_to_tree_user(
Entry &entry)
228 std::lock_guard<std::mutex> lock(
mutex);
229 entry.num_tree_users++;
230 entry.num_metadata_users--;
231 update_for_remove_user(entry);
234 void change_to_metadata_user(
Entry &entry)
236 std::lock_guard<std::mutex> lock(
mutex);
237 entry.num_metadata_users++;
238 entry.num_tree_users--;
239 update_for_remove_user(entry);
243 void update_for_remove_user(
Entry &entry)
245 if (entry.num_metadata_users + entry.num_tree_users == 0) {
248 else if (entry.num_tree_users == 0) {
251 entry.grid = entry.grid->copyGridWithNewTree();
252 entry.simplified_grids.clear();
253 entry.is_loaded =
false;
258 using EntrySet = std::unordered_set<Entry, EntryHasher, EntryEqual>;
271 : entry(nullptr), simplify_level(simplify_level), is_loaded(false)
276 VolumeGrid(
const openvdb::GridBase::Ptr &grid)
277 : entry(nullptr), local_grid(grid), is_loaded(true)
282 : entry(other.entry),
283 simplify_level(other.simplify_level),
284 local_grid(other.local_grid),
285 is_loaded(other.is_loaded)
299 void load(
const char *volume_name,
const char *filepath)
const
302 if (is_loaded || entry ==
nullptr) {
307 std::lock_guard<std::mutex> lock(entry->mutex);
316 if (entry->is_loaded) {
322 CLOG_INFO(&
LOG, 1,
"Volume %s: load grid '%s'", volume_name, name());
324 openvdb::io::File
file(filepath);
327 file.setCopyMaxBytes(0);
329 openvdb::GridBase::Ptr vdb_grid =
file.readGrid(name());
330 entry->grid->setTree(vdb_grid->baseTreePtr());
332 catch (
const openvdb::IoError &
e) {
333 entry->error_msg =
e.what();
336 std::atomic_thread_fence(std::memory_order_release);
337 entry->is_loaded =
true;
341 void unload(
const char *volume_name)
const
344 if (!is_loaded || entry ==
nullptr) {
349 std::lock_guard<std::mutex> lock(entry->mutex);
354 CLOG_INFO(&
LOG, 1,
"Volume %s: unload grid '%s'", volume_name, name());
361 std::atomic_thread_fence(std::memory_order_release);
365 void clear_reference(
const char *
UNUSED(volume_name))
368 local_grid = grid()->copyGridWithNewTree();
376 void duplicate_reference(
const char *volume_name,
const char *filepath)
380 load(volume_name, filepath);
382 local_grid = grid()->deepCopyGrid();
390 const char *name()
const
394 openvdb::StringMetadata::ConstPtr name_meta =
395 main_grid()->getMetadata<openvdb::StringMetadata>(openvdb::GridBase::META_GRID_NAME);
396 return (name_meta) ? name_meta->value().c_str() :
"";
399 const char *error_message()
const
401 if (is_loaded && entry && !entry->error_msg.empty()) {
402 return entry->error_msg.c_str();
408 bool grid_is_loaded()
const
413 openvdb::GridBase::Ptr grid()
const
416 return entry->simplified_grid(simplify_level);
421 void set_simplify_level(
const int simplify_level)
424 this->simplify_level = simplify_level;
428 const openvdb::GridBase::Ptr &main_grid()
const
430 return (entry) ? entry->grid : local_grid;
439 int simplify_level = 0;
441 openvdb::GridBase::Ptr local_grid;
449 mutable bool is_loaded;
457 struct VolumeGridVector :
public std::list<VolumeGrid> {
458 VolumeGridVector() : metadata(
new openvdb::MetaMap())
463 VolumeGridVector(
const VolumeGridVector &other)
464 :
std::list<
VolumeGrid>(other), error_msg(other.error_msg), metadata(other.metadata)
466 memcpy(filepath, other.filepath,
sizeof(filepath));
469 bool is_loaded()
const
471 return filepath[0] !=
'\0';
488 std::string error_msg;
490 openvdb::MetaMap::Ptr metadata;
530 const VolumeGridVector &grids_src = *(volume_src->
runtime.
grids);
531 volume_dst->
runtime.
grids = OBJECT_GUARDED_NEW(VolumeGridVector, grids_src);
545 OBJECT_GUARDED_SAFE_DELETE(volume->
runtime.
grids, VolumeGridVector);
552 for (
int i = 0; i < volume->
totcol; i++) {
564 offsetof(
Volume, runtime.grids),
575 if (volume->
id.
us > 0 || is_undo) {
619 for (
int a = 0;
a < volume->
totcol;
a++) {
627 for (
int a = 0;
a < volume->
totcol;
a++) {
664 volume->
runtime.
grids = OBJECT_GUARDED_NEW(VolumeGridVector);
688 int path_frame, path_digits;
699 if (frame_duration == 0) {
703 int frame = scene_frame - frame_start + 1;
707 if (frame < 1 || frame > frame_duration) {
713 frame =
clamp_i(frame, 1, frame_duration);
717 frame = frame % frame_duration;
719 frame += frame_duration;
722 frame = frame_duration;
727 const int pingpong_duration = frame_duration * 2 - 2;
728 frame = frame % pingpong_duration;
730 frame += pingpong_duration;
733 frame = pingpong_duration;
735 if (frame > frame_duration) {
736 frame = frame_duration * 2 - frame;
743 frame += frame_offset;
749 static void volume_filepath_get(
const Main *bmain,
const Volume *volume,
char r_filepath[
FILE_MAX])
754 int path_frame, path_digits;
780 const VolumeGridVector &const_grids = *volume->
runtime.
grids;
788 return const_grids.error_msg.empty();
792 std::lock_guard<std::mutex> lock(const_grids.mutex);
794 return const_grids.error_msg.empty();
799 VolumeGridVector &grids =
const_cast<VolumeGridVector &
>(const_grids);
802 const char *volume_name = volume->
id.
name + 2;
804 volume_filepath_get(bmain, volume, filepath);
806 CLOG_INFO(&
LOG, 1,
"Volume %s: load %s", volume_name, filepath);
812 grids.error_msg = filename + std::string(
" not found");
813 CLOG_INFO(&
LOG, 1,
"Volume %s: %s", volume_name, grids.error_msg.c_str());
818 openvdb::io::File
file(filepath);
819 openvdb::GridPtrVec vdb_grids;
822 file.setCopyMaxBytes(0);
824 vdb_grids = *(
file.readAllGridMetadata());
825 grids.metadata =
file.getMetadata();
827 catch (
const openvdb::IoError &
e) {
828 grids.error_msg =
e.what();
829 CLOG_INFO(&
LOG, 1,
"Volume %s: %s", volume_name, grids.error_msg.c_str());
833 for (
const openvdb::GridBase::Ptr &vdb_grid : vdb_grids) {
842 return grids.error_msg.empty();
853 if (grids.filepath[0] !=
'\0') {
854 const char *volume_name = volume->
id.
name + 2;
868 const char *filepath)
877 openvdb::GridCPtrVec vdb_grids;
880 vdb_grids.push_back(BKE_volume_grid_openvdb_for_read(volume, &grid));
884 openvdb::io::File
file(filepath);
885 file.write(vdb_grids, *grids.metadata);
888 catch (
const openvdb::IoError &
e) {
902 bool have_minmax =
false;
910 openvdb::GridBase::ConstPtr grid = BKE_volume_grid_openvdb_for_read(volume, volume_grid);
913 if (BKE_volume_grid_bounds(grid, grid_min, grid_max)) {
957 if (grids.metadata) {
958 openvdb::StringMetadata::ConstPtr creator =
959 grids.metadata->getMetadata<openvdb::StringMetadata>(
"creator");
961 creator = grids.metadata->getMetadata<openvdb::StringMetadata>(
"Creator");
963 return (creator && creator->str().rfind(
"Houdini", 0) == 0);
975 if (num_grids == 0) {
979 for (
int i = 0; i < num_grids; i++) {
997 grid.set_simplify_level(simplify_level);
1011 Volume *volume = volume_input;
1025 for (; md; md = md->
next) {
1035 if (volume == volume_input) {
1041 if (volume_next && volume_next != volume) {
1043 if (volume != volume_input) {
1046 volume = volume_next;
1085 const bool is_owned = (volume != volume_eval);
1097 if (!grids->is_loaded()) {
1099 OBJECT_GUARDED_DELETE(grids, VolumeGridVector);
1103 OBJECT_GUARDED_DELETE(grids, VolumeGridVector);
1108 OBJECT_GUARDED_DELETE(volume->
runtime.
grids, VolumeGridVector);
1170 const VolumeGridVector &grids = *volume->
runtime.
grids;
1172 if (grid_index-- == 0) {
1188 if (grid_index-- == 0) {
1202 if (num_grids == 0) {
1214 for (
int i = 0; i < num_grids; i++) {
1230 const char *volume_name = volume->
id.
name + 2;
1231 grid->load(volume_name, grids.filepath);
1232 const char *error_msg = grid->error_message();
1234 grids.error_msg = error_msg;
1247 const char *volume_name = volume->
id.
name + 2;
1248 grid->unload(volume_name);
1257 return grid->grid_is_loaded();
1269 return volume_grid->name();
1277 VolumeGridType BKE_volume_grid_type_openvdb(
const openvdb::GridBase &grid)
1279 if (grid.isType<openvdb::FloatGrid>()) {
1282 if (grid.isType<openvdb::Vec3fGrid>()) {
1285 if (grid.isType<openvdb::BoolGrid>()) {
1288 if (grid.isType<openvdb::DoubleGrid>()) {
1291 if (grid.isType<openvdb::Int32Grid>()) {
1294 if (grid.isType<openvdb::Int64Grid>()) {
1297 if (grid.isType<openvdb::Vec3IGrid>()) {
1300 if (grid.isType<openvdb::Vec3dGrid>()) {
1303 if (grid.isType<openvdb::StringGrid>()) {
1306 if (grid.isType<openvdb::MaskGrid>()) {
1309 if (grid.isType<openvdb::points::PointDataGrid>()) {
1319 const openvdb::GridBase::Ptr grid = volume_grid->grid();
1320 return BKE_volume_grid_type_openvdb(*grid);
1354 const openvdb::GridBase::Ptr grid = volume_grid->grid();
1362 for (
int row = 0; row < 4; row++) {
1363 mat[
col][row] = matrix(
col, row);
1404 struct CreateGridOp {
1405 template<
typename Gr
idType>
typename openvdb::GridBase::Ptr
operator()()
1407 if constexpr (std::is_same_v<GridType, openvdb::points::PointDataGrid>) {
1411 return GridType::create();
1424 openvdb::GridBase::Ptr vdb_grid = BKE_volume_grid_type_operation(
type, CreateGridOp{});
1429 vdb_grid->setName(name);
1430 grids.emplace_back(vdb_grid);
1431 return &grids.back();
1442 for (VolumeGridVector::iterator it = grids.begin(); it != grids.end(); it++) {
1459 if (simplify == 0.0f) {
1463 return ceilf(-log2(simplify));
1484 bool BKE_volume_grid_bounds(openvdb::GridBase::ConstPtr grid,
float3 &r_min,
float3 &r_max)
1487 openvdb::CoordBBox coordbbox;
1488 if (!grid->baseTree().evalLeafBoundingBox(coordbbox)) {
1492 openvdb::BBoxd bbox = grid->transform().indexToWorld(coordbbox);
1494 r_min =
float3((
float)bbox.min().x(), (
float)bbox.min().y(), (
float)bbox.min().z());
1495 r_max =
float3((
float)bbox.max().x(), (
float)bbox.max().y(), (
float)bbox.max().z());
1505 openvdb::GridBase::ConstPtr BKE_volume_grid_shallow_transform(openvdb::GridBase::ConstPtr grid,
1508 openvdb::math::Transform::Ptr grid_transform = grid->transform().copy();
1509 grid_transform->postMult(openvdb::Mat4d(((
float *)
transform.values)));
1512 return grid->copyGridReplacingTransform(grid_transform);
1515 openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_metadata(
const VolumeGrid *grid)
1517 return grid->grid();
1520 openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_read(
const Volume *volume,
1524 return grid->grid();
1527 openvdb::GridBase::Ptr BKE_volume_grid_openvdb_for_write(
const Volume *volume,
1531 const char *volume_name = volume->
id.
name + 2;
1533 grid->clear_reference(volume_name);
1537 grid->duplicate_reference(volume_name, grids.filepath);
1540 return grid->grid();
1549 template<
typename Gr
idType>
1550 static typename GridType::Ptr create_grid_with_changed_resolution(
const GridType &old_grid,
1551 const float resolution_factor)
1555 openvdb::Mat4R xform;
1557 openvdb::tools::GridTransformer transformer{xform};
1559 typename GridType::Ptr new_grid = old_grid.copyWithNewTree();
1560 transformer.transformGrid<openvdb::tools::BoxSampler>(old_grid, *new_grid);
1561 new_grid->transform() = old_grid.transform();
1562 new_grid->transform().preScale(1.0f / resolution_factor);
1563 new_grid->transform().postTranslate(-new_grid->voxelSize() / 2.0f);
1567 struct CreateGridWithChangedResolutionOp {
1568 const openvdb::GridBase &grid;
1569 const float resolution_factor;
1571 template<
typename Gr
idType>
typename openvdb::GridBase::Ptr
operator()()
1573 if constexpr (std::is_same_v<GridType, openvdb::StringGrid>) {
1577 return create_grid_with_changed_resolution(
static_cast<const GridType &
>(grid),
1583 openvdb::GridBase::Ptr BKE_volume_grid_create_with_changed_resolution(
1585 const openvdb::GridBase &old_grid,
1586 const float resolution_factor)
1588 CreateGridWithChangedResolutionOp op{old_grid, resolution_factor};
1589 return BKE_volume_grid_type_operation(grid_type, op);
void BKE_animdata_free(struct ID *id, const bool do_id_user)
void BKE_animdata_blend_read_data(struct BlendDataReader *reader, struct AnimData *adt)
void BKE_animdata_blend_write(struct BlendWriter *writer, struct AnimData *adt)
void(* IDTypeForeachCacheFunctionCallback)(struct ID *id, const struct IDCacheKey *cache_key, void **cache_p, uint flags, void *user_data)
void * BKE_id_new_nomain(const short type, const char *name)
@ LIB_ID_COPY_CD_REFERENCE
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
void * BKE_id_new(struct Main *bmain, const short type, const char *name)
#define BKE_LIB_FOREACHID_PROCESS(_data, _id_super, _cb_flag)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
bool BKE_modifier_is_enabled(const struct Scene *scene, struct ModifierData *md, int required_mode)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
void BKE_boundbox_init_from_minmax(struct BoundBox *bb, const float min[3], const float max[3])
void BKE_object_free_derived_caches(struct Object *ob)
void BKE_object_eval_assign_data(struct Object *object, struct ID *data, bool is_owned)
struct PackedFile * BKE_packedfile_duplicate(const struct PackedFile *pf_src)
void BKE_packedfile_blend_write(struct BlendWriter *writer, struct PackedFile *pf)
void BKE_packedfile_blend_read(struct BlendDataReader *reader, struct PackedFile **pf_p)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ VOLUME_GRID_VECTOR_FLOAT
@ VOLUME_GRID_VECTOR_DOUBLE
struct VolumeGrid VolumeGrid
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b)
KDTree *BLI_kdtree_nd_() new(unsigned int maxsize)
MINLINE int clamp_i(int value, int min, int max)
void unit_m4(float m[4][4])
bool BLI_path_frame(char *path, int frame, int digits) ATTR_NONNULL()
bool BLI_path_frame_get(char *path, int *r_frame, int *numdigits) ATTR_NONNULL()
void BLI_path_frame_strip(char *path, char *ext) ATTR_NONNULL()
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
void BLI_split_file_part(const char *string, char *file, const size_t filelen)
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
#define STRNCPY(dst, src)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define INIT_MINMAX(min, max)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_expand(expander, id)
void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p)
bool BLO_write_is_undo(BlendWriter *writer)
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr)
#define BLT_I18NCONTEXT_ID_VOLUME
#define CLOG_INFO(clg_ref, level,...)
struct Depsgraph Depsgraph
bool DEG_is_active(const struct Depsgraph *depsgraph)
float DEG_get_ctime(const Depsgraph *graph)
struct Scene * DEG_get_input_scene(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
struct ID * DEG_get_original_id(struct ID *id)
@ LIB_TAG_COPIED_ON_WRITE
#define ID_BLEND_PATH(_bmain, _id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define DNA_struct_default_get(struct_name)
Object is a sort of wrapper for general info.
@ VOLUME_SEQUENCE_PING_PONG
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static ImGlobalTileCache GLOBAL_CACHE
const Depsgraph * depsgraph
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void clear(Message *msg)
VecMat::Vec3< double > Vec3d
int load(istream &in, Vec3r &v)
Eigen::Matrix< float, 4, 4 > Mat4f
struct ModifierData * next
struct Volume *(* modifyVolume)(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Volume *volume)
struct VolumeGridVector * grids
int default_simplify_level
struct PackedFile * packedfile
static void initialize(SubdivDisplacement *displacement)
const VolumeGrid * BKE_volume_grid_active_get_for_read(const Volume *volume)
const char * BKE_volume_grids_error_msg(const Volume *volume)
#define VOLUME_FRAME_NONE
int BKE_volume_grid_channels(const VolumeGrid *grid)
bool BKE_volume_grid_is_loaded(const VolumeGrid *grid)
bool BKE_volume_is_loaded(const Volume *volume)
void BKE_volume_batch_cache_free(Volume *volume)
bool BKE_volume_is_y_up(const Volume *volume)
int BKE_volume_num_grids(const Volume *volume)
const VolumeGrid * BKE_volume_grid_get_for_read(const Volume *volume, int grid_index)
const char * BKE_volume_grid_name(const VolumeGrid *volume_grid)
bool BKE_volume_save(const Volume *volume, const Main *bmain, ReportList *reports, const char *filepath)
const char * BKE_volume_grids_frame_filepath(const Volume *volume)
void BKE_volume_data_update(struct Depsgraph *depsgraph, struct Scene *scene, Object *object)
void BKE_volume_batch_cache_dirty_tag(Volume *volume, int mode)
bool BKE_volume_load(const Volume *volume, const Main *bmain)
static Volume * volume_evaluate_modifiers(struct Depsgraph *depsgraph, struct Scene *scene, Object *object, Volume *volume_input)
void BKE_volume_grid_remove(Volume *volume, VolumeGrid *grid)
static void volume_update_simplify_level(Volume *volume, const Depsgraph *depsgraph)
bool BKE_volume_is_points_only(const Volume *volume)
static void volume_init_data(ID *id)
bool BKE_volume_min_max(const Volume *volume, float3 &r_min, float3 &r_max)
static int volume_sequence_frame(const Depsgraph *depsgraph, const Volume *volume)
void(* BKE_volume_batch_cache_dirty_tag_cb)(Volume *volume, int mode)
void * BKE_volume_add(Main *bmain, const char *name)
VolumeGridType BKE_volume_grid_type(const VolumeGrid *volume_grid)
VolumeGrid * BKE_volume_grid_get_for_write(Volume *volume, int grid_index)
static void volume_blend_read_expand(BlendExpander *expander, ID *id)
Volume * BKE_volume_copy_for_eval(Volume *volume_src, bool reference)
static void volume_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
int BKE_volume_simplify_level(const Depsgraph *depsgraph)
static void volume_free_data(ID *id)
void BKE_volume_grid_transform_matrix(const VolumeGrid *volume_grid, float mat[4][4])
float BKE_volume_simplify_factor(const Depsgraph *depsgraph)
void BKE_volume_unload(Volume *volume)
void(* BKE_volume_batch_cache_free_cb)(Volume *volume)
static void volume_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_volume_eval_geometry(struct Depsgraph *depsgraph, Volume *volume)
static void volume_blend_read_data(BlendDataReader *reader, ID *id)
bool BKE_volume_grid_load(const Volume *volume, const VolumeGrid *grid)
const VolumeGrid * BKE_volume_grid_find_for_read(const Volume *volume, const char *name)
static void volume_foreach_id(ID *id, LibraryForeachIDData *data)
Volume * BKE_volume_new_for_eval(const Volume *volume_src)
void BKE_volume_grid_unload(const Volume *volume, const VolumeGrid *grid)
static void volume_blend_read_lib(BlendLibReader *reader, ID *id)
BoundBox * BKE_volume_boundbox_get(Object *ob)
static void volume_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
void BKE_volume_grids_backup_restore(Volume *volume, VolumeGridVector *grids, const char *filepath)
void BKE_volume_init_grids(Volume *volume)
VolumeGrid * BKE_volume_grid_add(Volume *volume, const char *name, VolumeGridType type)