Blender V4.3
blender::bke::MeshRuntime Struct Reference

#include <BKE_mesh_types.hh>

Public Member Functions

 MeshRuntime ()
 
 ~MeshRuntime ()
 

Public Attributes

Meshmesh_eval = nullptr
 
std::mutex eval_mutex
 
std::mutex render_mutex
 
const ImplicitSharingInfoface_offsets_sharing_info = nullptr
 
std::shared_ptr< BMEditMeshedit_mesh
 
SharedCache< Bounds< float3 > > bounds_cache
 
std::unique_ptr< EditMeshDataedit_data
 
void * batch_cache = nullptr
 
TrianglesCache corner_tris_cache
 
SharedCache< Array< int > > corner_tri_faces_cache
 
BVHCachebvh_cache = nullptr
 
CustomData_MeshMasks cd_mask_extra = {}
 
std::unique_ptr< SubdivCCGsubdiv_ccg
 
int subdiv_ccg_tot_level = 0
 
bool deformed_only = false
 
bool is_original_bmesh = false
 
eMeshWrapperType wrapper_type = ME_WRAPPER_TYPE_MDATA
 
SubsurfRuntimeDatasubsurf_runtime_data = nullptr
 
SharedCache< Vector< float3 > > vert_normals_cache
 
SharedCache< Vector< float3 > > face_normals_cache
 
SharedCache< Vector< float3 > > corner_normals_cache
 
SharedCache< Array< int > > vert_to_face_offset_cache
 
SharedCache< Array< int > > vert_to_face_map_cache
 
SharedCache< Array< int > > vert_to_corner_map_cache
 
SharedCache< Array< int > > corner_to_face_map_cache
 
SharedCache< LooseEdgeCacheloose_edges_cache
 
SharedCache< LooseVertCacheloose_verts_cache
 
SharedCache< LooseVertCacheverts_no_face_cache
 
SharedCache< ShrinkwrapBoundaryDatashrinkwrap_boundary_cache
 
BitVector subsurf_face_dot_tags
 
BitVector subsurf_optimal_display_edges
 
std::unique_ptr< bake::BakeMaterialsListbake_materials
 

Detailed Description

Definition at line 110 of file BKE_mesh_types.hh.

Constructor & Destructor Documentation

◆ MeshRuntime()

blender::bke::MeshRuntime::MeshRuntime ( )
default

◆ ~MeshRuntime()

blender::bke::MeshRuntime::~MeshRuntime ( )

Member Data Documentation

◆ bake_materials

std::unique_ptr<bake::BakeMaterialsList> blender::bke::MeshRuntime::bake_materials

Stores weak references to material data blocks.

Definition at line 238 of file BKE_mesh_types.hh.

◆ batch_cache

void* blender::bke::MeshRuntime::batch_cache = nullptr

Data used to efficiently draw the mesh in the viewport, especially useful when the same mesh is used in many objects or instances. See draw_cache_impl_mesh.cc.

Definition at line 154 of file BKE_mesh_types.hh.

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

◆ bounds_cache

SharedCache<Bounds<float3> > blender::bke::MeshRuntime::bounds_cache

A cache of bounds shared between data-blocks with unchanged positions. When changing positions affect the bounds, the cache is "un-shared" with other geometries. See #SharedCache comments.

Definition at line 142 of file BKE_mesh_types.hh.

◆ bvh_cache

BVHCache* blender::bke::MeshRuntime::bvh_cache = nullptr

Cache for BVH trees generated for the mesh. Defined in 'BKE_bvhutil.c'

Definition at line 162 of file BKE_mesh_types.hh.

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

◆ cd_mask_extra

CustomData_MeshMasks blender::bke::MeshRuntime::cd_mask_extra = {}

Needed in case we need to lazily initialize the mesh.

Definition at line 165 of file BKE_mesh_types.hh.

◆ corner_normals_cache

SharedCache<Vector<float3> > blender::bke::MeshRuntime::corner_normals_cache

Lazily computed face corner normals (#Mesh::corner_normals()).

Definition at line 200 of file BKE_mesh_types.hh.

◆ corner_to_face_map_cache

SharedCache<Array<int> > blender::bke::MeshRuntime::corner_to_face_map_cache

Cache of face indices for each face corner.

Definition at line 212 of file BKE_mesh_types.hh.

◆ corner_tri_faces_cache

SharedCache<Array<int> > blender::bke::MeshRuntime::corner_tri_faces_cache

Cache for triangle to original face index map, accessed with #Mesh::corner_tri_faces().

Definition at line 159 of file BKE_mesh_types.hh.

◆ corner_tris_cache

TrianglesCache blender::bke::MeshRuntime::corner_tris_cache

Cache for derived triangulation of the mesh, accessed with #Mesh::corner_tris().

Definition at line 157 of file BKE_mesh_types.hh.

◆ deformed_only

bool blender::bke::MeshRuntime::deformed_only = false

Set by modifier stack if only deformed from original.

Definition at line 175 of file BKE_mesh_types.hh.

◆ edit_data

std::unique_ptr<EditMeshData> blender::bke::MeshRuntime::edit_data

Lazily initialized SoA data from the edit_mesh field in Mesh. Used when the mesh is a BMesh wrapper (ME_WRAPPER_TYPE_BMESH).

Definition at line 148 of file BKE_mesh_types.hh.

◆ edit_mesh

std::shared_ptr<BMEditMesh> blender::bke::MeshRuntime::edit_mesh

Storage of the edit mode BMesh with some extra data for quick access in edit mode.

  • For original (non-evaluated) meshes, when it exists, it generally has the most up-to-date information about the mesh. That's because this is only allocated in edit mode.
  • For evaluated meshes, this just references the BMesh from an original object in edit mode. Conceptually this is a weak pointer for evaluated meshes. In other words, it doesn't have ownership over the BMesh, and using shared_ptr is just a convenient way to avoid copying the whole struct and making sure the reference is valid.
    Note
    When the object is available, the preferred access method is BKE_editmesh_from_object.

Definition at line 136 of file BKE_mesh_types.hh.

◆ eval_mutex

std::mutex blender::bke::MeshRuntime::eval_mutex

Definition at line 118 of file BKE_mesh_types.hh.

◆ face_normals_cache

SharedCache<Vector<float3> > blender::bke::MeshRuntime::face_normals_cache

Lazily computed face normals (#Mesh::face_normals()).

Definition at line 198 of file BKE_mesh_types.hh.

◆ face_offsets_sharing_info

const ImplicitSharingInfo* blender::bke::MeshRuntime::face_offsets_sharing_info = nullptr

Implicit sharing user count for Mesh::face_offset_indices.

Definition at line 124 of file BKE_mesh_types.hh.

Referenced by mesh_blend_write().

◆ is_original_bmesh

bool blender::bke::MeshRuntime::is_original_bmesh = false

Copied from edit-mesh (hint, draw with edit-mesh data when true).

Modifiers that edit the mesh data in-place must set this to false (most ModifierTypeType::NonGeometrical modifiers). Otherwise the edit-mesh data will be used for drawing, missing changes from modifiers. See #79517.

Definition at line 183 of file BKE_mesh_types.hh.

◆ loose_edges_cache

SharedCache<LooseEdgeCache> blender::bke::MeshRuntime::loose_edges_cache

Cache of data about edges not used by faces. See #Mesh::loose_edges().

Definition at line 214 of file BKE_mesh_types.hh.

◆ loose_verts_cache

SharedCache<LooseVertCache> blender::bke::MeshRuntime::loose_verts_cache

Cache of data about vertices not used by edges. See #Mesh::loose_verts().

Definition at line 216 of file BKE_mesh_types.hh.

◆ mesh_eval

Mesh* blender::bke::MeshRuntime::mesh_eval = nullptr

"Evaluated" mesh owned by this mesh. Used for objects which don't have effective modifiers, so that the evaluated mesh can be shared between objects. Also stores the lazily created Mesh for BMesh and GPU subdivision mesh wrappers. Since this is accessed and set from multiple threads, access and use must be protected by the eval_mutex lock.

Definition at line 117 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_mesh_eval(), and blender::bke::mesh_calc_modifiers().

◆ render_mutex

std::mutex blender::bke::MeshRuntime::render_mutex

Needed to ensure some thread-safety during render data pre-processing.

Definition at line 121 of file BKE_mesh_types.hh.

◆ shrinkwrap_boundary_cache

SharedCache<ShrinkwrapBoundaryData> blender::bke::MeshRuntime::shrinkwrap_boundary_cache

Cache of non-manifold boundary data for shrinkwrap target Project.

Definition at line 221 of file BKE_mesh_types.hh.

◆ subdiv_ccg

std::unique_ptr<SubdivCCG> blender::bke::MeshRuntime::subdiv_ccg

Grids representation for multi-resolution sculpting. When this is set, the mesh will be empty, since it is conceptually replaced with the limited data stored in the grids.

Definition at line 171 of file BKE_mesh_types.hh.

◆ subdiv_ccg_tot_level

int blender::bke::MeshRuntime::subdiv_ccg_tot_level = 0

Definition at line 172 of file BKE_mesh_types.hh.

◆ subsurf_face_dot_tags

BitVector blender::bke::MeshRuntime::subsurf_face_dot_tags

A bit vector the size of the number of vertices, set to true for the center vertices of subdivided faces. The values are set by the subdivision surface modifier and used by drawing code instead of face center face dots. Otherwise this will be empty.

Definition at line 228 of file BKE_mesh_types.hh.

◆ subsurf_optimal_display_edges

BitVector blender::bke::MeshRuntime::subsurf_optimal_display_edges

A bit vector the size of the number of edges, set to true for edges that should be drawn in the viewport. Created by the "Optimal Display" feature of the subdivision surface modifier. Otherwise it will be empty.

Definition at line 235 of file BKE_mesh_types.hh.

◆ subsurf_runtime_data

SubsurfRuntimeData* blender::bke::MeshRuntime::subsurf_runtime_data = nullptr

Settings for lazily evaluating the subdivision on the CPU if needed. These are set in the modifier when GPU subdivision can be performed, and owned by the by the modifier in the object.

Definition at line 193 of file BKE_mesh_types.hh.

◆ vert_normals_cache

SharedCache<Vector<float3> > blender::bke::MeshRuntime::vert_normals_cache

Lazily computed vertex normals (#Mesh::vert_normals()).

Definition at line 196 of file BKE_mesh_types.hh.

◆ vert_to_corner_map_cache

SharedCache<Array<int> > blender::bke::MeshRuntime::vert_to_corner_map_cache

Cache of indices for vert to corner map.

Definition at line 210 of file BKE_mesh_types.hh.

◆ vert_to_face_map_cache

SharedCache<Array<int> > blender::bke::MeshRuntime::vert_to_face_map_cache

Cache of indices for vert to face map.

Definition at line 208 of file BKE_mesh_types.hh.

◆ vert_to_face_offset_cache

SharedCache<Array<int> > blender::bke::MeshRuntime::vert_to_face_offset_cache

Cache of offsets for vert to face/corner maps. The same offsets array is used to group indices for both the vertex to face and vertex to corner maps.

Definition at line 206 of file BKE_mesh_types.hh.

◆ verts_no_face_cache

SharedCache<LooseVertCache> blender::bke::MeshRuntime::verts_no_face_cache

Cache of data about vertices not used by faces. See #Mesh::verts_no_face().

Definition at line 218 of file BKE_mesh_types.hh.

◆ wrapper_type

eMeshWrapperType blender::bke::MeshRuntime::wrapper_type = ME_WRAPPER_TYPE_MDATA

eMeshWrapperType and others.

Definition at line 186 of file BKE_mesh_types.hh.


The documentation for this struct was generated from the following files: