Blender V4.3
volume.cc File Reference
#include <optional>
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_volume_types.h"
#include "BLI_bounds.hh"
#include "BLI_compiler_compat.h"
#include "BLI_fileops.h"
#include "BLI_ghash.h"
#include "BLI_index_range.hh"
#include "BLI_map.hh"
#include "BLI_math_matrix.h"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#include "BKE_anim_data.hh"
#include "BKE_bake_data_block_id.hh"
#include "BKE_bpath.hh"
#include "BKE_geometry_set.hh"
#include "BKE_global.hh"
#include "BKE_idtype.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_packedFile.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_volume.hh"
#include "BKE_volume_grid.hh"
#include "BKE_volume_grid_file_cache.hh"
#include "BKE_volume_openvdb.hh"
#include "BLT_translation.hh"
#include "DEG_depsgraph_query.hh"
#include "BLO_read_write.hh"
#include "CLG_log.h"

Go to the source code of this file.

Macros

#define VOLUME_FRAME_NONE   INT_MAX
 

Functions

void BKE_volumes_init ()
 
static void volume_init_data (ID *id)
 
static void volume_copy_data (Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
 
static void volume_free_data (ID *id)
 
static void volume_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void volume_foreach_cache (ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
 
static void volume_foreach_path (ID *id, BPathForeachPathData *bpath_data)
 
static void volume_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void volume_blend_read_data (BlendDataReader *reader, ID *id)
 
static void volume_blend_read_after_liblink (BlendLibReader *, ID *id)
 
void BKE_volume_init_grids (Volume *volume)
 
void * BKE_volume_add (Main *bmain, const char *name)
 
static int volume_sequence_frame (const Depsgraph *depsgraph, const Volume *volume)
 
bool BKE_volume_is_loaded (const Volume *volume)
 
bool BKE_volume_set_velocity_grid_by_name (Volume *volume, const char *base_name)
 
bool BKE_volume_load (const Volume *volume, const Main *bmain)
 
void BKE_volume_unload (Volume *volume)
 
bool BKE_volume_save (const Volume *volume, const Main *bmain, ReportList *reports, const char *filepath)
 
void BKE_volume_count_memory (const Volume &volume, blender::MemoryCounter &memory)
 
std::optional< blender::Bounds< blender::float3 > > BKE_volume_min_max (const Volume *volume)
 
bool BKE_volume_is_y_up (const Volume *volume)
 
bool BKE_volume_is_points_only (const Volume *volume)
 
static void volume_update_simplify_level (Main *bmain, Volume *volume, const Depsgraph *depsgraph)
 
static void volume_evaluate_modifiers (Depsgraph *depsgraph, Scene *scene, Object *object, blender::bke::GeometrySet &geometry_set)
 
void BKE_volume_eval_geometry (Depsgraph *depsgraph, Volume *volume)
 
static Volumetake_volume_ownership_from_geometry_set (blender::bke::GeometrySet &geometry_set)
 
void BKE_volume_data_update (Depsgraph *depsgraph, Scene *scene, Object *object)
 
void BKE_volume_grids_backup_restore (Volume *volume, VolumeGridVector *grids, const char *filepath)
 
void BKE_volume_batch_cache_dirty_tag (Volume *volume, int mode)
 
void BKE_volume_batch_cache_free (Volume *volume)
 
int BKE_volume_num_grids (const Volume *volume)
 
const char * BKE_volume_grids_error_msg (const Volume *volume)
 
const char * BKE_volume_grids_frame_filepath (const Volume *volume)
 
const blender::bke::VolumeGridData * BKE_volume_grid_get (const Volume *volume, int grid_index)
 
blender::bke::VolumeGridData * BKE_volume_grid_get_for_write (Volume *volume, int grid_index)
 
const blender::bke::VolumeGridData * BKE_volume_grid_active_get_for_read (const Volume *volume)
 
const blender::bke::VolumeGridData * BKE_volume_grid_find (const Volume *volume, const char *name)
 
blender::bke::VolumeGridData * BKE_volume_grid_find_for_write (Volume *volume, const char *name)
 
VolumeBKE_volume_new_for_eval (const Volume *volume_src)
 
VolumeBKE_volume_copy_for_eval (const Volume *volume_src)
 
void BKE_volume_grid_remove (Volume *volume, const blender::bke::VolumeGridData *grid)
 
void BKE_volume_grid_add (Volume *volume, const blender::bke::VolumeGridData &grid)
 
bool BKE_volume_grid_determinant_valid (const double determinant)
 
int BKE_volume_simplify_level (const Depsgraph *depsgraph)
 
float BKE_volume_simplify_factor (const Depsgraph *depsgraph)
 

Variables

IDTypeInfo IDType_ID_VO
 
void(* BKE_volume_batch_cache_dirty_tag_cb )(Volume *volume, int mode) = nullptr
 
void(* BKE_volume_batch_cache_free_cb )(Volume *volume) = nullptr
 

Macro Definition Documentation

◆ VOLUME_FRAME_NONE

#define VOLUME_FRAME_NONE   INT_MAX

Definition at line 67 of file blenkernel/intern/volume.cc.

Referenced by BKE_volume_load(), and volume_sequence_frame().

Function Documentation

◆ BKE_volume_add()

void * BKE_volume_add ( Main * bmain,
const char * name )

◆ BKE_volume_batch_cache_dirty_tag()

void BKE_volume_batch_cache_dirty_tag ( Volume * volume,
int mode )

◆ BKE_volume_batch_cache_free()

void BKE_volume_batch_cache_free ( Volume * volume)

Definition at line 836 of file blenkernel/intern/volume.cc.

References BKE_volume_batch_cache_free_cb.

Referenced by volume_free_data().

◆ BKE_volume_copy_for_eval()

◆ BKE_volume_count_memory()

void BKE_volume_count_memory ( const Volume & volume,
blender::MemoryCounter & memory )

Definition at line 601 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

Referenced by blender::bke::VolumeComponent::count_memory().

◆ BKE_volume_data_update()

◆ BKE_volume_eval_geometry()

◆ BKE_volume_grid_active_get_for_read()

◆ BKE_volume_grid_add()

void BKE_volume_grid_add ( Volume * volume,
const blender::bke::VolumeGridData & grid )

Adds a new grid to the volume with the name stored in the grid. The caller is responsible for making sure that the user count already contains the volume as a user.

Definition at line 1011 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

◆ BKE_volume_grid_determinant_valid()

bool BKE_volume_grid_determinant_valid ( double determinant)

OpenVDB crashes when the determinant of the transform matrix becomes too small.

Definition at line 1021 of file blenkernel/intern/volume.cc.

References determinant(), and UNUSED_VARS.

Referenced by blender::nodes::node_geo_volume_cube_cc::node_geo_exec(), and blender::geometry::transform_volume().

◆ BKE_volume_grid_find()

◆ BKE_volume_grid_find_for_write()

blender::bke::VolumeGridData * BKE_volume_grid_find_for_write ( Volume * volume,
const char * name )

◆ BKE_volume_grid_get()

◆ BKE_volume_grid_get_for_write()

blender::bke::VolumeGridData * BKE_volume_grid_get_for_write ( Volume * volume,
int grid_index )

◆ BKE_volume_grid_remove()

void BKE_volume_grid_remove ( Volume * volume,
const blender::bke::VolumeGridData * grid )

◆ BKE_volume_grids_backup_restore()

void BKE_volume_grids_backup_restore ( Volume * volume,
VolumeGridVector * grids,
const char * filepath )

◆ BKE_volume_grids_error_msg()

const char * BKE_volume_grids_error_msg ( const Volume * volume)

Definition at line 855 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

Referenced by blender::ed::object::volume_import_exec().

◆ BKE_volume_grids_frame_filepath()

const char * BKE_volume_grids_frame_filepath ( const Volume * volume)

Definition at line 865 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

Referenced by blender::io::hydra::VolumeData::init().

◆ BKE_volume_init_grids()

void BKE_volume_init_grids ( Volume * volume)

Definition at line 313 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

Referenced by volume_blend_read_after_liblink(), and volume_init_data().

◆ BKE_volume_is_loaded()

bool BKE_volume_is_loaded ( const Volume * volume)

Definition at line 417 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

Referenced by BKE_volume_load().

◆ BKE_volume_is_points_only()

bool BKE_volume_is_points_only ( const Volume * volume)

◆ BKE_volume_is_y_up()

bool BKE_volume_is_y_up ( const Volume * volume)

Definition at line 636 of file blenkernel/intern/volume.cc.

References UNUSED_VARS.

Referenced by blender::ed::object::volume_import_exec().

◆ BKE_volume_load()

◆ BKE_volume_min_max()

◆ BKE_volume_new_for_eval()

Volume * BKE_volume_new_for_eval ( const Volume * volume_src)

◆ BKE_volume_num_grids()

◆ BKE_volume_save()

bool BKE_volume_save ( const Volume * volume,
const Main * bmain,
ReportList * reports,
const char * filepath )

◆ BKE_volume_set_velocity_grid_by_name()

bool BKE_volume_set_velocity_grid_by_name ( Volume * volume,
const char * base_name )

Definition at line 428 of file blenkernel/intern/volume.cc.

References BKE_volume_grid_find(), and STRNCPY.

Referenced by BKE_volume_load().

◆ BKE_volume_simplify_factor()

float BKE_volume_simplify_factor ( const Depsgraph * depsgraph)

◆ BKE_volume_simplify_level()

int BKE_volume_simplify_level ( const Depsgraph * depsgraph)

◆ BKE_volume_unload()

◆ BKE_volumes_init()

void BKE_volumes_init ( )

Definition at line 130 of file blenkernel/intern/volume.cc.

Referenced by main().

◆ take_volume_ownership_from_geometry_set()

◆ volume_blend_read_after_liblink()

static void volume_blend_read_after_liblink ( BlendLibReader * ,
ID * id )
static

Definition at line 273 of file blenkernel/intern/volume.cc.

References BKE_volume_init_grids().

◆ volume_blend_read_data()

static void volume_blend_read_data ( BlendDataReader * reader,
ID * id )
static

◆ volume_blend_write()

static void volume_blend_write ( BlendWriter * writer,
ID * id,
const void * id_address )
static

◆ volume_copy_data()

static void volume_copy_data ( Main * ,
std::optional< Library * > ,
ID * id_dst,
const ID * id_src,
const int  )
static

◆ volume_evaluate_modifiers()

◆ volume_foreach_cache()

static void volume_foreach_cache ( ID * id,
IDTypeForeachCacheFunctionCallback function_callback,
void * user_data )
static

Definition at line 215 of file blenkernel/intern/volume.cc.

◆ volume_foreach_id()

static void volume_foreach_id ( ID * id,
LibraryForeachIDData * data )
static

◆ volume_foreach_path()

static void volume_foreach_path ( ID * id,
BPathForeachPathData * bpath_data )
static

◆ volume_free_data()

static void volume_free_data ( ID * id)
static

◆ volume_init_data()

static void volume_init_data ( ID * id)
static

◆ volume_sequence_frame()

static int volume_sequence_frame ( const Depsgraph * depsgraph,
const Volume * volume )
static

◆ volume_update_simplify_level()

static void volume_update_simplify_level ( Main * bmain,
Volume * volume,
const Depsgraph * depsgraph )
static

Variable Documentation

◆ BKE_volume_batch_cache_dirty_tag_cb

void(* BKE_volume_batch_cache_dirty_tag_cb) (Volume *volume, int mode) ( Volume * volume,
int mode ) = nullptr

◆ BKE_volume_batch_cache_free_cb

void(* BKE_volume_batch_cache_free_cb) (Volume *volume) ( Volume * volume) = nullptr

◆ IDType_ID_VO

IDTypeInfo IDType_ID_VO
Initial value:
= {
sizeof(Volume),
"Volume",
N_("volumes"),
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition BKE_idtype.hh:39
#define BLT_I18NCONTEXT_ID_VOLUME
#define FILTER_ID_MA
Definition DNA_ID.h:1175
@ INDEX_ID_VO
Definition DNA_ID.h:1298
#define FILTER_ID_VO
Definition DNA_ID.h:1197
@ ID_VO
struct Volume Volume
static void volume_blend_read_after_liblink(BlendLibReader *, ID *id)
static void volume_init_data(ID *id)
static void volume_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
static void volume_foreach_path(ID *id, BPathForeachPathData *bpath_data)
static void volume_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
static void volume_free_data(ID *id)
static void volume_blend_write(BlendWriter *writer, ID *id, const void *id_address)
static void volume_blend_read_data(BlendDataReader *reader, ID *id)
static void volume_foreach_id(ID *id, LibraryForeachIDData *data)
#define N_(msgid)

Definition at line 283 of file blenkernel/intern/volume.cc.