Blender  V3.3
Macros | Functions | Variables
volume.cc File Reference
#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_compiler_compat.h"
#include "BLI_fileops.h"
#include "BLI_float4x4.hh"
#include "BLI_ghash.h"
#include "BLI_index_range.hh"
#include "BLI_map.hh"
#include "BLI_math.h"
#include "BLI_math_vec_types.hh"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_string_ref.hh"
#include "BLI_task.hh"
#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"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_packedFile.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_volume.h"
#include "BLT_translation.h"
#include "DEG_depsgraph_query.h"
#include "BLO_read_write.h"
#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 *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
 
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_lib (BlendLibReader *reader, ID *id)
 
static void volume_blend_read_expand (BlendExpander *expander, ID *id)
 
void BKE_volume_init_grids (Volume *volume)
 
voidBKE_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)
 
bool BKE_volume_min_max (const Volume *volume, float3 &r_min, float3 &r_max)
 
BoundBoxBKE_volume_boundbox_get (Object *ob)
 
bool BKE_volume_is_y_up (const Volume *volume)
 
bool BKE_volume_is_points_only (const Volume *volume)
 
static void volume_update_simplify_level (Volume *volume, const Depsgraph *depsgraph)
 
static void volume_evaluate_modifiers (struct Depsgraph *depsgraph, struct Scene *scene, Object *object, GeometrySet &geometry_set)
 
void BKE_volume_eval_geometry (struct Depsgraph *depsgraph, Volume *volume)
 
static Volumetake_volume_ownership_from_geometry_set (GeometrySet &geometry_set)
 
void BKE_volume_data_update (struct Depsgraph *depsgraph, struct 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 VolumeGridBKE_volume_grid_get_for_read (const Volume *volume, int grid_index)
 
VolumeGridBKE_volume_grid_get_for_write (Volume *volume, int grid_index)
 
const VolumeGridBKE_volume_grid_active_get_for_read (const Volume *volume)
 
const VolumeGridBKE_volume_grid_find_for_read (const Volume *volume, const char *name)
 
bool BKE_volume_grid_load (const Volume *volume, const VolumeGrid *grid)
 
void BKE_volume_grid_unload (const Volume *volume, const VolumeGrid *grid)
 
bool BKE_volume_grid_is_loaded (const VolumeGrid *grid)
 
const char * BKE_volume_grid_name (const VolumeGrid *volume_grid)
 
VolumeGridType BKE_volume_grid_type (const VolumeGrid *volume_grid)
 
int BKE_volume_grid_channels (const VolumeGrid *grid)
 
void BKE_volume_grid_transform_matrix (const VolumeGrid *volume_grid, float mat[4][4])
 
void BKE_volume_grid_transform_matrix_set (struct VolumeGrid *volume_grid, const float mat[4][4])
 
VolumeBKE_volume_new_for_eval (const Volume *volume_src)
 
VolumeBKE_volume_copy_for_eval (Volume *volume_src, bool reference)
 
VolumeGridBKE_volume_grid_add (Volume *volume, const char *name, VolumeGridType type)
 
void BKE_volume_grid_remove (Volume *volume, VolumeGrid *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 57 of file volume.cc.

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 1222 of file volume.cc.

References Volume::batch_cache, and BKE_volume_batch_cache_free_cb.

Referenced by volume_free_data().

◆ BKE_volume_boundbox_get()

BoundBox* BKE_volume_boundbox_get ( Object ob)

◆ BKE_volume_copy_for_eval()

Volume* BKE_volume_copy_for_eval ( Volume volume_src,
bool  reference 
)

◆ BKE_volume_data_update()

void BKE_volume_data_update ( struct Depsgraph depsgraph,
struct Scene scene,
Object object 
)

◆ BKE_volume_eval_geometry()

void BKE_volume_eval_geometry ( struct Depsgraph depsgraph,
Volume volume 
)

◆ BKE_volume_grid_active_get_for_read()

const VolumeGrid* BKE_volume_grid_active_get_for_read ( const Volume volume)

◆ BKE_volume_grid_add()

VolumeGrid* BKE_volume_grid_add ( Volume volume,
const char *  name,
VolumeGridType  type 
)

◆ BKE_volume_grid_channels()

int BKE_volume_grid_channels ( const VolumeGrid grid)

◆ 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 1593 of file volume.cc.

References blender::math::abs(), determinant(), and UNUSED_VARS.

Referenced by blender::nodes::transform_volume().

◆ BKE_volume_grid_find_for_read()

const VolumeGrid* BKE_volume_grid_find_for_read ( const Volume volume,
const char *  name 
)

◆ BKE_volume_grid_get_for_read()

const VolumeGrid* BKE_volume_grid_get_for_read ( const Volume volume,
int  grid_index 
)

◆ BKE_volume_grid_get_for_write()

VolumeGrid* BKE_volume_grid_get_for_write ( Volume volume,
int  grid_index 
)

Definition at line 1277 of file volume.cc.

References Volume_Runtime::grids, Volume::runtime, and UNUSED_VARS.

Referenced by displace_volume(), and blender::nodes::transform_volume().

◆ BKE_volume_grid_is_loaded()

bool BKE_volume_grid_is_loaded ( const VolumeGrid grid)

Definition at line 1347 of file volume.cc.

References UNUSED_VARS.

◆ BKE_volume_grid_load()

bool BKE_volume_grid_load ( const Volume volume,
const VolumeGrid grid 
)

Definition at line 1319 of file volume.cc.

References Volume_Runtime::grids, Volume::id, ID::name, Volume::runtime, and UNUSED_VARS.

◆ BKE_volume_grid_name()

const char* BKE_volume_grid_name ( const VolumeGrid volume_grid)

Definition at line 1359 of file volume.cc.

References UNUSED_VARS.

Referenced by BKE_volume_grid_find_for_read().

◆ BKE_volume_grid_remove()

void BKE_volume_grid_remove ( Volume volume,
VolumeGrid grid 
)

Definition at line 1578 of file volume.cc.

References Volume_Runtime::grids, Volume::runtime, and UNUSED_VARS.

◆ BKE_volume_grid_transform_matrix()

void BKE_volume_grid_transform_matrix ( const VolumeGrid volume_grid,
float  mat[4][4] 
)

Definition at line 1459 of file volume.cc.

References col, transform(), unit_m4(), and UNUSED_VARS.

◆ BKE_volume_grid_transform_matrix_set()

void BKE_volume_grid_transform_matrix_set ( struct VolumeGrid volume_grid,
const float  mat[4][4] 
)

Definition at line 1480 of file volume.cc.

References col, and UNUSED_VARS.

Referenced by blender::nodes::transform_volume().

◆ BKE_volume_grid_type()

VolumeGridType BKE_volume_grid_type ( const VolumeGrid volume_grid)

Definition at line 1426 of file volume.cc.

References UNUSED_VARS, and VOLUME_GRID_UNKNOWN.

Referenced by BKE_volume_grid_channels(), and BKE_volume_is_points_only().

◆ BKE_volume_grid_unload()

void BKE_volume_grid_unload ( const Volume volume,
const VolumeGrid grid 
)

Definition at line 1337 of file volume.cc.

References Volume::id, ID::name, and UNUSED_VARS.

◆ 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 1241 of file volume.cc.

References Volume_Runtime::grids, Volume::runtime, and UNUSED_VARS.

◆ BKE_volume_grids_frame_filepath()

const char* BKE_volume_grids_frame_filepath ( const Volume volume)

Definition at line 1251 of file volume.cc.

References Volume_Runtime::grids, Volume::runtime, and UNUSED_VARS.

◆ BKE_volume_init_grids()

void BKE_volume_init_grids ( Volume volume)

◆ BKE_volume_is_loaded()

bool BKE_volume_is_loaded ( const Volume volume)

Definition at line 785 of file volume.cc.

References Volume::filepath, Volume_Runtime::grids, Volume::runtime, and 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 1033 of file volume.cc.

References Volume_Runtime::grids, Volume::runtime, and UNUSED_VARS.

◆ BKE_volume_load()

bool BKE_volume_load ( const Volume volume,
const Main bmain 
)

◆ BKE_volume_min_max()

bool BKE_volume_min_max ( const Volume volume,
float3 r_min,
float3 r_max 
)

◆ BKE_volume_new_for_eval()

Volume* BKE_volume_new_for_eval ( const Volume volume_src)

◆ BKE_volume_num_grids()

int BKE_volume_num_grids ( const Volume volume)

◆ 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 
)

◆ 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()

void BKE_volume_unload ( Volume volume)

◆ BKE_volumes_init()

void BKE_volumes_init ( void  )

Definition at line 500 of file volume.cc.

References initialize().

Referenced by main().

◆ take_volume_ownership_from_geometry_set()

static Volume* take_volume_ownership_from_geometry_set ( GeometrySet geometry_set)
static

◆ volume_blend_read_data()

static void volume_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ volume_blend_read_expand()

static void volume_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 641 of file volume.cc.

References Freestyle::a, BLO_expand, Volume::mat, and Volume::totcol.

◆ volume_blend_read_lib()

static void volume_blend_read_lib ( BlendLibReader 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 UNUSEDbmain,
ID id_dst,
const ID id_src,
const int   UNUSEDflag 
)
static

◆ volume_evaluate_modifiers()

static void volume_evaluate_modifiers ( struct Depsgraph depsgraph,
struct Scene scene,
Object object,
GeometrySet geometry_set 
)
static

◆ volume_foreach_cache()

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

Definition at line 564 of file volume.cc.

References Volume_Runtime::grids, Volume::runtime, and user_data.

◆ 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 ( 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

Definition at line 1212 of file volume.cc.

Referenced by BKE_volume_batch_cache_dirty_tag(), and DRW_engines_register().

◆ BKE_volume_batch_cache_free_cb

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

Definition at line 1213 of file volume.cc.

Referenced by BKE_volume_batch_cache_free(), and DRW_engines_register().

◆ IDType_ID_VO

IDTypeInfo IDType_ID_VO
Initial value:
= {
sizeof(Volume),
"Volume",
"volumes",
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition: BKE_idtype.h:39
#define BLT_I18NCONTEXT_ID_VOLUME
@ INDEX_ID_VO
Definition: DNA_ID.h:1031
#define FILTER_ID_VO
Definition: DNA_ID.h:932
@ ID_VO
Definition: DNA_ID_enums.h:83
struct Volume Volume
static void volume_init_data(ID *id)
Definition: volume.cc:509
static void volume_blend_read_expand(BlendExpander *expander, ID *id)
Definition: volume.cc:641
static void volume_foreach_path(ID *id, BPathForeachPathData *bpath_data)
Definition: volume.cc:577
static void volume_foreach_cache(ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
Definition: volume.cc:564
static void volume_free_data(ID *id)
Definition: volume.cc:544
static void volume_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: volume.cc:589
static void volume_blend_read_data(BlendDataReader *reader, ID *id)
Definition: volume.cc:615
static void volume_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: volume.cc:556
static void volume_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: volume.cc:628
static void volume_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
Definition: volume.cc:521

Definition at line 649 of file volume.cc.