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

#include <BKE_mesh_types.hh>

Public Member Functions

 MeshRuntime ()
 ~MeshRuntime ()

Public Attributes

Mesh * mesh_eval = nullptr
Mutex eval_mutex
const ImplicitSharingInfo * face_offsets_sharing_info = nullptr
std::shared_ptr< BMEditMesh > edit_mesh
SharedCache< Bounds< float3 > > bounds_cache
std::unique_ptr< EditMeshData > edit_data
draw::MeshBatchCache * batch_cache = nullptr
TrianglesCache corner_tris_cache
SharedCache< Array< int > > corner_tri_faces_cache
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_edges
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_faces
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_corner_tris
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_corner_tris_no_hidden
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_verts
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_verts_no_hidden
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_edges
SharedCache< std::unique_ptr< BVHTree, BVHTreeDeleter > > bvh_cache_loose_edges_no_hidden
SharedCache< bke::bvh::Tree > bvh_embree_tris_cache
SharedCache< bke::bvh::Tree > bvh_embree_verts_cache
SharedCache< bke::bvh::Tree > bvh_embree_edges_cache
SharedCache< std::optional< int > > max_material_index
SharedCache< VectorSet< int > > used_material_indices
CustomData_MeshMasks cd_mask_extra = {}
std::unique_ptr< Array< MeshGroup > > spatial_groups
std::unique_ptr< SubdivCCG > subdiv_ccg
int subdiv_ccg_tot_level = 0
bool deformed_only = false
bool is_original_bmesh = false
eMeshWrapperType wrapper_type = ME_WRAPPER_TYPE_MDATA
SubsurfRuntimeData * subsurf_runtime_data = nullptr
SharedCache< NormalsCache > vert_normals_cache
SharedCache< Vector< float3 > > vert_normals_true_cache
SharedCache< NormalsCache > face_normals_cache
SharedCache< Vector< float3 > > face_normals_true_cache
SharedCache< NormalsCache > 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< Array< int > > edge_to_corner_offset_cache
SharedCache< Array< int > > edge_to_corner_map_cache
SharedCache< LooseGeomCache > loose_edges_cache
SharedCache< LooseGeomCache > loose_verts_cache
SharedCache< LooseGeomCache > verts_no_face_cache
SharedCache< ShrinkwrapBoundaryData > shrinkwrap_boundary_cache
BitVector subsurf_face_dot_tags
BitVector subsurf_optimal_display_edges
std::unique_ptr< bake::BakeMaterialsList > bake_materials

Detailed Description

Definition at line 141 of file BKE_mesh_types.hh.

Constructor & Destructor Documentation

◆ MeshRuntime()

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

References MeshRuntime().

Referenced by MeshRuntime().

◆ ~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 293 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ batch_cache

draw::MeshBatchCache* 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 182 of file BKE_mesh_types.hh.

Referenced by blender::BKE_mesh_batch_cache_dirty_tag(), and 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 170 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data(), blender::geometry::mesh_copy_selection_keep_edges(), blender::geometry::mesh_copy_selection_keep_verts(), blender::geometry::mesh_triangulate(), and blender::bke::subdiv::subdiv_to_mesh().

◆ bvh_cache_corner_tris

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_corner_tris

Definition at line 191 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_corner_tris_no_hidden

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_corner_tris_no_hidden

Definition at line 192 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_edges

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_edges

Definition at line 189 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_faces

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_faces

Definition at line 190 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_loose_edges

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_loose_edges

Definition at line 195 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_loose_edges_no_hidden

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_loose_edges_no_hidden

Definition at line 196 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_loose_verts

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_loose_verts

Definition at line 193 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_cache_loose_verts_no_hidden

SharedCache<std::unique_ptr<BVHTree, BVHTreeDeleter> > blender::bke::MeshRuntime::bvh_cache_loose_verts_no_hidden

Definition at line 194 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_embree_edges_cache

SharedCache<bke::bvh::Tree> blender::bke::MeshRuntime::bvh_embree_edges_cache

Definition at line 200 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_embree_tris_cache

SharedCache<bke::bvh::Tree> blender::bke::MeshRuntime::bvh_embree_tris_cache

Definition at line 198 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ bvh_embree_verts_cache

SharedCache<bke::bvh::Tree> blender::bke::MeshRuntime::bvh_embree_verts_cache

Definition at line 199 of file BKE_mesh_types.hh.

Referenced by blender::bke::free_bvh_caches(), and blender::mesh_copy_data().

◆ cd_mask_extra

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

Needed in case we need to lazily initialize the mesh.

Definition at line 206 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ corner_normals_cache

SharedCache<NormalsCache> blender::bke::MeshRuntime::corner_normals_cache

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

Definition at line 251 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ 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 263 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ 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 187 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ 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 185 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ deformed_only

◆ edge_to_corner_map_cache

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

Cache of indices for the edge to corner map.

Definition at line 267 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ edge_to_corner_offset_cache

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

Cache of offsets for the edge to corner map.

Definition at line 265 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ edit_data

◆ 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 164 of file BKE_mesh_types.hh.

Referenced by blender::BKE_editmesh_eval_orig_map_available(), blender::BKE_mesh_copy_parameters_for_eval(), blender::BKE_mesh_new_from_object(), blender::bke::cage_mesh_or_fallback(), blender::ED_mesh_get_edit_shape_key(), blender::bke::editbmesh_calc_modifiers(), blender::knifetool_init_obinfo(), blender::lineart_object_load_single_instance(), blender::mesh_copy_data(), blender::mesh_new_from_mesh_object(), blender::draw::mesh_render_data_create(), object_to_mesh(), and blender::deg::ObjectRuntimeBackup::restore_to_object().

◆ eval_mutex

Mutex blender::bke::MeshRuntime::eval_mutex

Definition at line 149 of file BKE_mesh_types.hh.

Referenced by blender::BKE_object_select_update().

◆ face_normals_cache

SharedCache<NormalsCache> blender::bke::MeshRuntime::face_normals_cache

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

Definition at line 248 of file BKE_mesh_types.hh.

Referenced by blender::geometry::face_normals_if_worthwhile(), and blender::mesh_copy_data().

◆ face_normals_true_cache

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

◆ face_offsets_sharing_info

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

◆ 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 232 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data(), and blender::draw::mesh_render_data_create().

◆ loose_edges_cache

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

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

Definition at line 269 of file BKE_mesh_types.hh.

Referenced by blender::copy_loose_edge_hint(), blender::geometry::copy_loose_edge_hint(), and blender::mesh_copy_data().

◆ loose_verts_cache

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

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

Definition at line 271 of file BKE_mesh_types.hh.

Referenced by blender::copy_loose_vert_hint(), blender::geometry::copy_loose_vert_hint(), and blender::mesh_copy_data().

◆ max_material_index

SharedCache<std::optional<int> > blender::bke::MeshRuntime::max_material_index

◆ 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 148 of file BKE_mesh_types.hh.

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

◆ shrinkwrap_boundary_cache

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

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

Definition at line 276 of file BKE_mesh_types.hh.

◆ spatial_groups

std::unique_ptr<Array<MeshGroup> > blender::bke::MeshRuntime::spatial_groups

Pre-computed groups of vertices and faces for a mesh's BVH (Bounding Volume Hierarchy) nodes, used to quickly access the node data for the BVH. Used to avoid recomputing the offsets every time the BVH is built.

Definition at line 213 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 data corresponds to the unsubdivided base mesh; it is conceptually replaced with the limited data stored in the grids.

Definition at line 220 of file BKE_mesh_types.hh.

Referenced by blender::object_update_from_subsurf_ccg(), blender::bke::object::pbvh_ensure(), blender::sculptsession_update(), and blender::stats_mesheval().

◆ subdiv_ccg_tot_level

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

Definition at line 221 of file BKE_mesh_types.hh.

Referenced by blender::object_update_from_subsurf_ccg().

◆ 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 283 of file BKE_mesh_types.hh.

Referenced by blender::draw::calc_face_visibility_mesh(), blender::draw::extract_face_dot_positions_mesh(), blender::draw::mesh_buffer_cache_create_requested(), and blender::mesh_copy_data().

◆ 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 290 of file BKE_mesh_types.hh.

Referenced by blender::arrayModifier_doArray(), blender::draw::calc_mesh_edge_visibility(), blender::draw::extract_edge_factor_mesh(), and blender::mesh_copy_data().

◆ 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 modifier in the object.

Definition at line 242 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data(), and blender::stats_mesheval().

◆ used_material_indices

SharedCache<VectorSet<int> > blender::bke::MeshRuntime::used_material_indices

Definition at line 203 of file BKE_mesh_types.hh.

◆ vert_normals_cache

SharedCache<NormalsCache> blender::bke::MeshRuntime::vert_normals_cache

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

Definition at line 245 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ vert_normals_true_cache

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

◆ 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 261 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ 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 259 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ 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 257 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ verts_no_face_cache

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

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

Definition at line 273 of file BKE_mesh_types.hh.

Referenced by blender::mesh_copy_data().

◆ wrapper_type


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