|
Blender V4.5
|
#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_fileops.h"#include "BLI_index_range.hh"#include "BLI_math_base.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_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_library.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 |
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 |
| #define VOLUME_FRAME_NONE INT_MAX |
Definition at line 64 of file blenkernel/intern/volume.cc.
Referenced by BKE_volume_load(), and volume_sequence_frame().
Definition at line 318 of file blenkernel/intern/volume.cc.
References BKE_id_new(), and name.
Referenced by BKE_object_obdata_add_from_type(), and blender::io::usd::USDVolumeReader::create_object().
| void BKE_volume_batch_cache_dirty_tag | ( | Volume * | volume, |
| int | mode ) |
Definition at line 822 of file blenkernel/intern/volume.cc.
References Volume::batch_cache, and BKE_volume_batch_cache_dirty_tag_cb.
Referenced by BKE_object_batch_cache_dirty_tag().
| void BKE_volume_batch_cache_free | ( | Volume * | volume | ) |
Definition at line 829 of file blenkernel/intern/volume.cc.
References Volume::batch_cache, and BKE_volume_batch_cache_free_cb.
Referenced by volume_free_data().
Definition at line 955 of file blenkernel/intern/volume.cc.
References BKE_id_copy_ex(), Volume::id, and LIB_ID_COPY_LOCALIZE.
Referenced by blender::bke::VolumeComponent::copy(), blender::bke::VolumeComponent::ensure_owns_direct_data(), and blender::bke::VolumeComponent::get_for_write().
| void BKE_volume_count_memory | ( | const Volume & | volume, |
| blender::MemoryCounter & | memory ) |
Definition at line 595 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by blender::bke::VolumeComponent::count_memory().
Definition at line 766 of file blenkernel/intern/volume.cc.
References BKE_object_eval_assign_data(), BKE_object_free_derived_caches(), BKE_volume_new_for_eval(), Object::data, depsgraph, Volume::id, blender::bke::ReadOnly, blender::bke::GeometrySet::replace_volume(), scene, take_volume_ownership_from_geometry_set(), and volume_evaluate_modifiers().
Referenced by BKE_object_handle_data_update(), and blender::ed::object::object_force_modifier_update_for_bind().
| void BKE_volume_eval_geometry | ( | Depsgraph * | depsgraph, |
| Volume * | volume ) |
Definition at line 725 of file blenkernel/intern/volume.cc.
References BKE_volume_unload(), DEG_get_bmain(), DEG_get_original(), DEG_is_active(), depsgraph, frame, Volume::runtime, volume_sequence_frame(), and volume_update_simplify_level().
Referenced by blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock().
| const blender::bke::VolumeGridData * BKE_volume_grid_active_get_for_read | ( | const Volume * | volume | ) |
Definition at line 900 of file blenkernel/intern/volume.cc.
References Volume::active_grid, BKE_volume_grid_get(), BKE_volume_num_grids(), and clamp_i().
Referenced by blender::draw::DRW_volume_batch_cache_get_selection_surface(), blender::draw::DRW_volume_batch_cache_get_wireframes_face(), and blender::workbench::VolumePass::object_sync_volume().
| 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 1010 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by blender::nodes::node_geo_import_vdb::node_geo_exec().
| bool BKE_volume_grid_determinant_valid | ( | double | determinant | ) |
OpenVDB crashes when the determinant of the transform matrix becomes too small.
Definition at line 1020 of file blenkernel/intern/volume.cc.
References determinant(), and UNUSED_VARS.
Referenced by BKE_volume_grid_transform_valid(), BKE_volume_voxel_size_valid(), and blender::geometry::transform_volume().
| const blender::bke::VolumeGridData * BKE_volume_grid_find | ( | const Volume * | volume, |
| const StringRef | name ) |
Definition at line 911 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_get(), BKE_volume_num_grids(), blender::bke::volume_grid::get_name(), and name.
Referenced by BKE_volume_set_velocity_grid_by_name(), modify_mesh(), blender::nodes::node_geo_get_named_grid_cc::node_geo_exec(), and blender::draw::volume_object_grids_init().
| blender::bke::VolumeGridData * BKE_volume_grid_find_for_write | ( | Volume * | volume, |
| const StringRef | name ) |
Definition at line 925 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_get(), BKE_volume_grid_get_for_write(), BKE_volume_num_grids(), blender::bke::volume_grid::get_name(), and name.
| const blender::bke::VolumeGridData * BKE_volume_grid_get | ( | const Volume * | volume, |
| int | grid_index ) |
Definition at line 868 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by BKE_volume_grid_active_get_for_read(), BKE_volume_grid_find(), BKE_volume_grid_find_for_write(), BKE_volume_is_points_only(), BKE_volume_min_max(), blender::io::usd::USDVolumeWriter::do_write(), blender::ed::spreadsheet::VolumeDataSource::get_column_values(), blender::io::hydra::VolumeData::init(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), and blender::bke::bake::serialize_geometry_set().
| blender::bke::VolumeGridData * BKE_volume_grid_get_for_write | ( | Volume * | volume, |
| int | grid_index ) |
Definition at line 884 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by BKE_volume_grid_find_for_write(), displace_volume(), and blender::geometry::transform_volume().
| void BKE_volume_grid_remove | ( | Volume * | volume, |
| const blender::bke::VolumeGridData * | grid ) |
Definition at line 995 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by blender::nodes::node_geo_get_named_grid_cc::node_geo_exec().
| bool BKE_volume_grid_transform_valid | ( | const float4x4 & | transform | ) |
Definition at line 1036 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_determinant_valid(), blender::math::determinant(), and transform().
| void BKE_volume_grids_backup_restore | ( | Volume * | volume, |
| VolumeGridVector * | grids, | ||
| const char * | filepath ) |
Definition at line 790 of file blenkernel/intern/volume.cc.
References BLI_assert, Volume::filepath, Volume::id, ID_TAG_COPIED_ON_EVAL, Volume::runtime, STREQ, ID::tag, and UNUSED_VARS.
Referenced by blender::deg::VolumeBackup::restore_to_volume().
| const char * BKE_volume_grids_error_msg | ( | const Volume * | volume | ) |
Definition at line 848 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by blender::ed::object::volume_import_exec().
| const char * BKE_volume_grids_frame_filepath | ( | const Volume * | volume | ) |
Definition at line 858 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by blender::io::hydra::VolumeData::init().
| void BKE_volume_init_grids | ( | Volume * | volume | ) |
Definition at line 307 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by volume_blend_read_after_liblink(), and volume_init_data().
| bool BKE_volume_is_loaded | ( | const Volume * | volume | ) |
Definition at line 411 of file blenkernel/intern/volume.cc.
References Volume::filepath, Volume::runtime, and UNUSED_VARS.
Referenced by BKE_volume_load().
| bool BKE_volume_is_points_only | ( | const Volume * | volume | ) |
Definition at line 650 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_get(), BKE_volume_num_grids(), blender::bke::volume_grid::get_type(), and VOLUME_GRID_POINTS.
Referenced by blender::ed::object::volume_import_exec().
| bool BKE_volume_is_y_up | ( | const Volume * | volume | ) |
Definition at line 630 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by blender::ed::object::volume_import_exec().
Definition at line 467 of file blenkernel/intern/volume.cc.
References BKE_volume_is_loaded(), BKE_volume_set_velocity_grid_by_name(), BLI_exists(), BLI_path_basename(), CLOG_INFO, FILE_MAX, Volume::id, lock, LOG, ID::name, Volume::runtime, STRNCPY(), UNUSED_VARS, and VOLUME_FRAME_NONE.
Referenced by BKE_volume_min_max(), BKE_volume_save(), displace_volume(), blender::io::usd::USDVolumeWriter::do_write(), blender::io::hydra::VolumeData::init(), modify_mesh(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), blender::workbench::VolumePass::object_sync_volume(), blender::draw::volume_grid_cache_get(), blender::ed::object::volume_import_exec(), blender::draw::volume_object_grids_init(), and volume_update_simplify_level().
| std::optional< blender::Bounds< blender::float3 > > BKE_volume_min_max | ( | const Volume * | volume | ) |
Definition at line 608 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_get(), BKE_volume_load(), BKE_volume_num_grids(), G, blender::bounds::merge(), result, and UNUSED_VARS.
Referenced by BKE_object_boundbox_get(), blender::bke::GeometrySet::compute_boundbox_without_instances(), and blender::io::usd::USDVolumeWriter::do_write().
Definition at line 942 of file blenkernel/intern/volume.cc.
References BKE_id_new_nomain(), Volume::display, Volume::id, Volume::mat, MEM_dupallocN(), ID::name, Volume::render, STRNCPY(), and Volume::totcol.
Referenced by BKE_volume_data_update(), and mesh_to_volume().
| int BKE_volume_num_grids | ( | const Volume * | volume | ) |
Definition at line 838 of file blenkernel/intern/volume.cc.
References Volume::runtime, and UNUSED_VARS.
Referenced by BKE_volume_grid_active_get_for_read(), BKE_volume_grid_find(), BKE_volume_grid_find_for_write(), BKE_volume_is_points_only(), BKE_volume_min_max(), blender::ed::spreadsheet::VolumeGridsViewItem::build_row(), displace_volume(), blender::io::usd::USDVolumeWriter::do_write(), blender::io::hydra::VolumeData::init(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), blender::bke::bake::serialize_geometry_set(), blender::ed::spreadsheet::VolumeDataSource::tot_rows(), blender::geometry::transform_volume(), and blender::draw::volume_object_grids_init().
| bool BKE_volume_save | ( | const Volume * | volume, |
| const Main * | bmain, | ||
| ReportList * | reports, | ||
| const char * | filepath ) |
Definition at line 552 of file blenkernel/intern/volume.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append_as(), BKE_reportf(), BKE_volume_load(), e, file, blender::Vector< T, InlineBufferCapacity, Allocator >::last(), RPT_ERROR, Volume::runtime, and UNUSED_VARS.
Definition at line 422 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_find(), Volume::runtime, STRNCPY(), and Volume::velocity_grid.
Referenced by BKE_volume_load().
| float BKE_volume_simplify_factor | ( | const Depsgraph * | depsgraph | ) |
Definition at line 1057 of file blenkernel/intern/volume.cc.
References DAG_EVAL_RENDER, DEG_get_input_scene(), DEG_get_mode(), depsgraph, RenderData::mode, Scene::r, R_SIMPLIFY, scene, and RenderData::simplify_volumes.
| int BKE_volume_simplify_level | ( | const Depsgraph * | depsgraph | ) |
Definition at line 1041 of file blenkernel/intern/volume.cc.
References ceilf, DAG_EVAL_RENDER, DEG_get_input_scene(), DEG_get_mode(), depsgraph, log2, RenderData::mode, Scene::r, R_SIMPLIFY, scene, and RenderData::simplify_volumes.
Referenced by volume_update_simplify_level().
| void BKE_volume_unload | ( | Volume * | volume | ) |
Definition at line 536 of file blenkernel/intern/volume.cc.
References CLOG_INFO, Volume::id, LOG, ID::name, Volume::runtime, and UNUSED_VARS.
Referenced by BKE_packedfile_unpack_volume(), BKE_volume_eval_geometry(), blender::io::usd::USDVolumeWriter::do_write(), blender::io::hydra::VolumeData::init(), and blender::ed::object::volume_import_exec().
| bool BKE_volume_voxel_size_valid | ( | const float3 & | voxel_size | ) |
Definition at line 1031 of file blenkernel/intern/volume.cc.
References BKE_volume_grid_determinant_valid().
| void BKE_volumes_init | ( | ) |
Definition at line 124 of file blenkernel/intern/volume.cc.
Referenced by main().
|
static |
Definition at line 748 of file blenkernel/intern/volume.cc.
References blender::bke::GeometrySet::get_component_for_write(), blender::bke::GeometrySet::has(), blender::bke::ReadOnly, and blender::bke::GeometrySet::remove().
Referenced by BKE_volume_data_update().
|
static |
Definition at line 267 of file blenkernel/intern/volume.cc.
References BKE_volume_init_grids().
|
static |
Definition at line 255 of file blenkernel/intern/volume.cc.
References BKE_packedfile_blend_read(), BLO_read_pointer_array(), Volume::filepath, Volume::mat, Volume::packedfile, Volume::runtime, and Volume::totcol.
|
static |
Definition at line 235 of file blenkernel/intern/volume.cc.
References BKE_id_blend_write(), BKE_packedfile_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_pointer_array(), Volume::id, ID_IS_OVERRIDE_LIBRARY, Volume::mat, Volume::packedfile, and Volume::totcol.
|
static |
Definition at line 147 of file blenkernel/intern/volume.cc.
References Volume::batch_cache, BKE_packedfile_duplicate(), Volume::mat, MEM_dupallocN(), Volume::packedfile, Volume::runtime, and STRNCPY().
|
static |
Definition at line 691 of file blenkernel/intern/volume.cc.
References BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_clear_errors(), BKE_modifiers_get_virtual_modifierlist(), DAG_EVAL_RENDER, DEG_get_mode(), depsgraph, eModifierMode_Realtime, eModifierMode_Render, MOD_APPLY_RENDER, MOD_APPLY_USECACHE, ModifierTypeInfo::modify_geometry_set, ModifierData::next, scene, and ModifierData::type.
Referenced by BKE_volume_data_update().
|
static |
Definition at line 209 of file blenkernel/intern/volume.cc.
References key, and Volume::runtime.
|
static |
Definition at line 201 of file blenkernel/intern/volume.cc.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, data, IDWALK_CB_USER, Volume::mat, and Volume::totcol.
|
static |
Definition at line 222 of file blenkernel/intern/volume.cc.
References BKE_bpath_foreach_path_fixed_process(), BKE_BPATH_FOREACH_PATH_SKIP_PACKED, Volume::filepath, BPathForeachPathData::flag, and Volume::packedfile.
|
static |
Definition at line 182 of file blenkernel/intern/volume.cc.
References BKE_animdata_free(), BKE_packedfile_free(), BKE_volume_batch_cache_free(), Volume::id, Volume::mat, MEM_SAFE_FREE, Volume::packedfile, and Volume::runtime.
|
static |
Definition at line 133 of file blenkernel/intern/volume.cc.
References BKE_volume_init_grids(), BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, Volume::runtime, STRNCPY(), and Volume::velocity_grid.
|
static |
Definition at line 327 of file blenkernel/intern/volume.cc.
References BLI_path_frame_get(), clamp_i(), DEG_get_ctime(), depsgraph, Volume::filepath, frame, Volume::frame_duration, Volume::frame_offset, Volume::frame_start, Volume::is_sequence, Volume::sequence_mode, VOLUME_FRAME_NONE, VOLUME_SEQUENCE_CLIP, VOLUME_SEQUENCE_EXTEND, VOLUME_SEQUENCE_PING_PONG, and VOLUME_SEQUENCE_REPEAT.
Referenced by BKE_volume_eval_geometry().
|
static |
Definition at line 669 of file blenkernel/intern/volume.cc.
References BKE_volume_load(), BKE_volume_simplify_level(), BLI_assert, depsgraph, Volume::runtime, and UNUSED_VARS.
Referenced by BKE_volume_eval_geometry().
| void(* BKE_volume_batch_cache_dirty_tag_cb) (Volume *volume, int mode) | ( | Volume * | volume, |
| int | mode ) = nullptr |
Definition at line 819 of file blenkernel/intern/volume.cc.
Referenced by BKE_volume_batch_cache_dirty_tag(), and DRW_module_init().
Definition at line 820 of file blenkernel/intern/volume.cc.
Referenced by BKE_volume_batch_cache_free(), and DRW_module_init().
| IDTypeInfo IDType_ID_VO |
Definition at line 277 of file blenkernel/intern/volume.cc.