Blender V4.3
mesh_runtime.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_array_utils.hh"
#include "BLI_math_geom.h"
#include "BLI_task.hh"
#include "BKE_bake_data_block_id.hh"
#include "BKE_bvhutils.hh"
#include "BKE_customdata.hh"
#include "BKE_editmesh_cache.hh"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_shrinkwrap.hh"
#include "BKE_subdiv_ccg.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 
namespace  blender::bke
 

Functions

static void blender::bke::free_mesh_eval (MeshRuntime &mesh_runtime)
 
static void blender::bke::free_bvh_cache (MeshRuntime &mesh_runtime)
 
static void blender::bke::free_batch_cache (MeshRuntime &mesh_runtime)
 
static int blender::bke::reset_bits_and_count (MutableBitSpan bits, const Span< int > indices_to_reset)
 
static void blender::bke::bit_vector_with_reset_bits_or_empty (const Span< int > indices_to_reset, const int indexed_elems_num, BitVector<> &r_bits, int &r_count)
 
static void blender::bke::try_tag_verts_no_face_none (const Mesh &mesh)
 
Mesh Runtime Struct Utils
int BKE_mesh_runtime_corner_tris_len (const Mesh *mesh)
 
void BKE_mesh_runtime_ensure_edit_data (Mesh *mesh)
 
void BKE_mesh_runtime_clear_cache (Mesh *mesh)
 
void BKE_mesh_runtime_clear_geometry (Mesh *mesh)
 
Mesh Runtime Validation
bool BKE_mesh_runtime_is_valid (Mesh *mesh_eval)
 

Mesh Batch Cache Callbacks

void(* BKE_mesh_batch_cache_dirty_tag_cb )(Mesh *mesh, eMeshBatchDirtyMode mode) = nullptr
 
void(* BKE_mesh_batch_cache_free_cb )(void *batch_cache) = nullptr
 
void BKE_mesh_batch_cache_dirty_tag (Mesh *mesh, eMeshBatchDirtyMode mode)
 
void BKE_mesh_batch_cache_free (void *batch_cache)
 

Function Documentation

◆ BKE_mesh_batch_cache_dirty_tag()

◆ BKE_mesh_batch_cache_free()

void BKE_mesh_batch_cache_free ( void * batch_cache)

Definition at line 430 of file mesh_runtime.cc.

References BKE_mesh_batch_cache_free_cb.

Referenced by blender::bke::free_batch_cache().

◆ BKE_mesh_runtime_clear_cache()

void BKE_mesh_runtime_clear_cache ( Mesh * mesh)

Similar to BKE_mesh_runtime_clear_geometry, but subtly different in that it also clears data-block level features like evaluated data-blocks and edit mode data. They will be functionally the same in most cases, but prefer this function if unsure, since it clears more data.

Definition at line 303 of file mesh_runtime.cc.

References BKE_mesh_runtime_clear_geometry().

Referenced by BKE_mesh_clear_geometry(), BKE_mesh_clear_geometry_and_metadata(), BKE_mesh_validate(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_vertices(), mesh_add_edges(), mesh_add_faces(), mesh_add_loops(), mesh_add_verts(), and blender::nodes::node_geo_extrude_mesh_cc::tag_mesh_added_faces().

◆ BKE_mesh_runtime_clear_geometry()

void BKE_mesh_runtime_clear_geometry ( Mesh * mesh)

Clear and free any derived caches associated with the mesh geometry data. Examples include BVH caches, normals, triangulation, etc. This should be called when replacing a mesh's geometry directly or making other large changes to topology. It does not need to be called on new meshes.

For "smaller" changes to meshes like updating positions, consider calling a more specific update function like #Mesh::tag_positions_changed().

Also note that some derived caches like CD_TANGENT are stored directly in CustomData.

Definition at line 312 of file mesh_runtime.cc.

Referenced by BKE_mesh_runtime_clear_cache(), and BM_mesh_bm_to_me_compact().

◆ BKE_mesh_runtime_corner_tris_len()

int BKE_mesh_runtime_corner_tris_len ( const Mesh * mesh)

Return the number of derived triangles (corner_tris).

Definition at line 290 of file mesh_runtime.cc.

References poly_to_tri_count().

Referenced by RE_bake_pixels_populate_from_objects().

◆ BKE_mesh_runtime_ensure_edit_data()

void BKE_mesh_runtime_ensure_edit_data ( Mesh * mesh)

Definition at line 296 of file mesh_runtime.cc.

Referenced by BKE_mesh_wrapper_from_editmesh().

◆ BKE_mesh_runtime_is_valid()

Variable Documentation

◆ BKE_mesh_batch_cache_dirty_tag_cb

void(* BKE_mesh_batch_cache_dirty_tag_cb) (Mesh *mesh, eMeshBatchDirtyMode mode) ( Mesh * mesh,
eMeshBatchDirtyMode mode ) = nullptr

Definition at line 421 of file mesh_runtime.cc.

Referenced by BKE_mesh_batch_cache_dirty_tag(), and DRW_engines_register().

◆ BKE_mesh_batch_cache_free_cb

void(* BKE_mesh_batch_cache_free_cb) (void *batch_cache) ( void * batch_cache) = nullptr

Definition at line 422 of file mesh_runtime.cc.

Referenced by BKE_mesh_batch_cache_free(), and DRW_engines_register().