Blender
V3.3
|
#include "atomic_ops.h"
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BLI_math_geom.h"
#include "BLI_task.hh"
#include "BKE_bvhutils.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#include "BKE_shrinkwrap.h"
#include "BKE_subdiv_ccg.h"
Go to the source code of this file.
Mesh Batch Cache Callbacks | |
void(* | BKE_mesh_batch_cache_dirty_tag_cb )(Mesh *me, eMeshBatchDirtyMode mode) = nullptr |
void(* | BKE_mesh_batch_cache_free_cb )(Mesh *me) = nullptr |
void | BKE_mesh_batch_cache_dirty_tag (Mesh *me, eMeshBatchDirtyMode mode) |
void | BKE_mesh_batch_cache_free (Mesh *me) |
void BKE_mesh_batch_cache_dirty_tag | ( | Mesh * | me, |
eMeshBatchDirtyMode | mode | ||
) |
Definition at line 294 of file mesh_runtime.cc.
References Mesh_Runtime::batch_cache, BKE_mesh_batch_cache_dirty_tag_cb, and Mesh::runtime.
Referenced by BKE_object_data_batch_cache_dirty_tag(), BKE_object_data_select_update(), geometry_extract_apply(), paint_mask_slice_exec(), paintface_flush_flags(), paintvert_flush_flags(), quadriflow_start_job(), sculpt_face_set_edit_modify_geometry(), sculpt_gesture_trim_end(), sculpt_symmetrize_exec(), shade_smooth_exec(), tag_object_after_update(), uv_select_tag_update_for_object(), uv_shortest_path_pick_ex(), vertex_color_set(), voxel_remesh_exec(), vpaint_mode_toggle_exec(), vpaint_stroke_update_step_intern(), and wpaint_stroke_update_step().
Definition at line 300 of file mesh_runtime.cc.
References Mesh_Runtime::batch_cache, BKE_mesh_batch_cache_free_cb, and Mesh::runtime.
Referenced by BKE_mesh_runtime_clear_cache().
This function clears runtime cache of the given mesh.
Call this function to recalculate runtime data when used.
Definition at line 99 of file mesh_runtime.cc.
References BKE_id_free(), BKE_mesh_batch_cache_free(), BKE_mesh_clear_derived_normals(), BKE_mesh_runtime_clear_edit_data(), BKE_mesh_runtime_clear_geometry(), Mesh::edit_mesh, mesh, Mesh_Runtime::mesh_eval, and Mesh::runtime.
Referenced by BKE_mesh_clear_geometry(), BKE_mesh_runtime_free_data(), mesh_add_edges(), mesh_add_loops(), mesh_add_polys(), mesh_add_verts(), and sculpt_undo_geometry_restore_data().
Definition at line 232 of file mesh_runtime.cc.
References BKE_mesh_runtime_reset_edit_data(), Mesh_Runtime::edit_data, MEM_freeN, mesh, and Mesh::runtime.
Referenced by BKE_mesh_runtime_clear_cache().
Definition at line 245 of file mesh_runtime.cc.
References BKE_mesh_tag_coords_changed(), BKE_shrinkwrap_discard_boundary_data(), BKE_subdiv_ccg_destroy(), MEM_SAFE_FREE, mesh, Mesh::runtime, Mesh_Runtime::subdiv_ccg, and Mesh_Runtime::subsurf_face_dot_tags.
Referenced by BKE_mesh_nomain_to_mesh(), BKE_mesh_runtime_clear_cache(), BM_mesh_bm_to_me(), ED_mesh_join_objects_exec(), quadriflow_start_job(), and voxel_remesh_exec().
Definition at line 207 of file mesh_runtime.cc.
References Mesh_Runtime::edit_data, mesh, and Mesh::runtime.
Referenced by BKE_mesh_wrapper_from_editmesh_with_coords(), and editbmesh_calc_modifiers().
Free all data (and mutexes) inside the runtime of the given mesh.
Definition at line 72 of file mesh_runtime.cc.
References BKE_mesh_runtime_clear_cache(), mesh, and mesh_runtime_free_mutexes().
Referenced by mesh_free_data().
Initialize the runtime of the given mesh.
Function expects that the runtime is already cleared.
Definition at line 67 of file mesh_runtime.cc.
References mesh, and mesh_runtime_init_mutexes().
Referenced by mesh_blend_read_data(), and mesh_init_data().
Definition at line 315 of file mesh_runtime.cc.
References BKE_mesh_validate_all_customdata(), BKE_mesh_validate_arrays(), BLI_assert, Mesh::dvert, Mesh::edata, Mesh::id, is_valid, Mesh::ldata, Mesh::medge, Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mvert, ID::name, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Definition at line 173 of file mesh_runtime.cc.
References MLoopTri_Store::array, BKE_mesh_runtime_looptri_len(), BKE_mesh_runtime_looptri_recalc(), BLI_assert, BLI_mutex_lock(), BLI_mutex_unlock(), Mesh_Runtime::eval_mutex, blender::threading::isolate_task(), MLoopTri_Store::len, Mesh_Runtime::looptris, mesh, and Mesh::runtime.
int BKE_mesh_runtime_looptri_len | ( | const Mesh * | mesh | ) |
Definition at line 165 of file mesh_runtime.cc.
References BLI_assert, ELEM, MLoopTri_Store::len, Mesh_Runtime::looptris, mesh, poly_to_tri_count(), Mesh::runtime, Mesh::totloop, and Mesh::totpoly.
Referenced by BKE_mesh_runtime_looptri_ensure().
Definition at line 146 of file mesh_runtime.cc.
References MLoopTri_Store::array, MLoopTri_Store::array_wip, atomic_cas_ptr(), BKE_mesh_recalc_looptri(), BLI_assert, Mesh_Runtime::looptris, mesh, mesh_ensure_looptri_data(), Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::runtime, Mesh::totloop, and Mesh::totpoly.
Referenced by BKE_mesh_runtime_looptri_ensure().
Definition at line 217 of file mesh_runtime.cc.
References Mesh_Runtime::edit_data, MEM_SAFE_FREE, mesh, EditMeshData::polyCos, EditMeshData::polyNos, Mesh::runtime, EditMeshData::vertexCos, and EditMeshData::vertexNos.
Referenced by BKE_mesh_runtime_clear_edit_data(), and editbmesh_calc_modifiers().
Definition at line 78 of file mesh_runtime.cc.
References Mesh_Runtime::batch_cache, Mesh_Runtime::bvh_cache, Mesh_Runtime::edit_data, Mesh_Runtime::looptris, mesh, Mesh_Runtime::mesh_eval, mesh_runtime_init_mutexes(), Mesh_Runtime::poly_normals, Mesh_Runtime::poly_normals_dirty, Mesh::runtime, Mesh_Runtime::shrinkwrap_data, Mesh_Runtime::subdiv_ccg, Mesh_Runtime::subsurf_face_dot_tags, Mesh_Runtime::vert_normals, and Mesh_Runtime::vert_normals_dirty.
void BKE_mesh_runtime_verttri_from_looptri | ( | MVertTri * | r_verttri, |
const MLoop * | mloop, | ||
const MLoopTri * | looptri, | ||
int | looptri_num | ||
) |
Definition at line 195 of file mesh_runtime.cc.
References MLoopTri::tri, MVertTri::tri, and MLoop::v.
Call after changing vertex positions to tag lazily calculated caches for recomputation.
Definition at line 259 of file mesh_runtime.cc.
References MLoopTri_Store::array, BKE_mesh_normals_tag_dirty(), Mesh_Runtime::bvh_cache, bvhcache_free(), Mesh_Runtime::looptris, MEM_SAFE_FREE, mesh, and Mesh::runtime.
Referenced by BKE_mesh_runtime_clear_geometry(), BKE_mesh_tag_coords_changed_uniformly(), BKE_mesh_transform(), BKE_mesh_vert_coords_apply(), BKE_mesh_vert_coords_apply_with_mat4(), cloth_make_rest_mesh(), dynamicPaint_Modifier_apply(), get_quick_mesh(), multires_reshape_apply_base_refit_base_mesh(), sculpt_undo_restore_list(), SCULPT_vertcos_to_key(), and blender::bke::tag_component_positions_changed().
Call after moving every mesh vertex by the same translation.
Definition at line 269 of file mesh_runtime.cc.
References BKE_mesh_poly_normals_are_dirty(), BKE_mesh_poly_normals_clear_dirty(), BKE_mesh_tag_coords_changed(), BKE_mesh_vertex_normals_are_dirty(), BKE_mesh_vertex_normals_clear_dirty(), and mesh.
Referenced by BKE_mesh_translate().
Ensure the array is large enough
Definition at line 118 of file mesh_runtime.cc.
References MLoopTri_Store::array, MLoopTri_Store::array_wip, BLI_assert, MLoopTri_Store::len, MLoopTri_Store::len_alloc, Mesh_Runtime::looptris, MEM_malloc_arrayN, MEM_SAFE_FREE, mesh, poly_to_tri_count(), Mesh::runtime, SWAP, Mesh::totloop, and Mesh::totpoly.
Referenced by BKE_mesh_runtime_looptri_recalc().
free the mutexes of the given mesh runtime.
Definition at line 48 of file mesh_runtime.cc.
References BLI_mutex_end(), Mesh_Runtime::eval_mutex, MEM_freeN, mesh, Mesh_Runtime::normals_mutex, Mesh_Runtime::render_mutex, and Mesh::runtime.
Referenced by BKE_mesh_runtime_free_data().
Initialize the runtime mutexes of the given mesh.
Any existing mutexes will be overridden.
Definition at line 35 of file mesh_runtime.cc.
References BLI_mutex_init(), Mesh_Runtime::eval_mutex, mesh, Mesh_Runtime::normals_mutex, Mesh_Runtime::render_mutex, and Mesh::runtime.
Referenced by BKE_mesh_runtime_init_data(), and BKE_mesh_runtime_reset_on_copy().
void(* BKE_mesh_batch_cache_dirty_tag_cb) (Mesh *me, eMeshBatchDirtyMode mode) | ( | Mesh * | me, |
eMeshBatchDirtyMode | mode | ||
) | = nullptr |
Definition at line 291 of file mesh_runtime.cc.
Referenced by BKE_mesh_batch_cache_dirty_tag(), and DRW_engines_register().
Definition at line 292 of file mesh_runtime.cc.
Referenced by BKE_mesh_batch_cache_free(), and DRW_engines_register().