Blender V5.3
mesh_wrapper.cc File Reference
#include "BLI_math_matrix_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_string.hh"
#include "BLI_task.hh"
#include "BLI_utildefines.hh"
#include "BKE_editmesh.hh"
#include "BKE_editmesh_cache.hh"
#include "BKE_lib_id.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_runtime.hh"
#include "BKE_mesh_wrapper.hh"
#include "BKE_modifier.hh"
#include "BKE_subdiv.hh"
#include "BKE_subdiv_mesh.hh"
#include "BKE_subdiv_modifier.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Functions

Mesh * blender::BKE_mesh_wrapper_from_editmesh (std::shared_ptr< BMEditMesh > em, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
void blender::BKE_mesh_wrapper_ensure_mdata (Mesh *mesh)
Mesh Coordinate Access
Span< float3 > blender::BKE_mesh_wrapper_vert_coords (const Mesh *mesh)
Span< float3 > blender::BKE_mesh_wrapper_face_normals (Mesh *mesh)
void blender::BKE_mesh_wrapper_tag_positions_changed (Mesh *mesh)
void blender::BKE_mesh_wrapper_vert_coords_copy (const Mesh *mesh, MutableSpan< float3 > positions)
void blender::BKE_mesh_wrapper_vert_coords_copy_with_mat4 (const Mesh *mesh, float(*vert_coords)[3], int vert_coords_len, const float mat[4][4])
Mesh Array Length Access
int blender::BKE_mesh_wrapper_vert_len (const Mesh *mesh)
int blender::BKE_mesh_wrapper_edge_len (const Mesh *mesh)
int blender::BKE_mesh_wrapper_loop_len (const Mesh *mesh)
int blender::BKE_mesh_wrapper_face_len (const Mesh *mesh)
CPU Subdivision Evaluation
static Mesh * blender::mesh_wrapper_ensure_subdivision (Mesh *mesh)
Mesh * blender::BKE_mesh_wrapper_ensure_subdivision (Mesh *mesh)
const Mesh * blender::BKE_mesh_wrapper_ensure_subdivision (const Mesh *mesh)

Detailed Description

The primary purpose of this API is to avoid unnecessary mesh conversion for the final output of a modified mesh.

This API handles the case when the modifier stack outputs a mesh which does not have Mesh data (#Mesh::faces(), corner verts, corner edges, edges, etc). Currently this is used so the resulting mesh can have #BMEditMesh data, postponing the converting until it's needed or avoiding conversion entirely which can be an expensive operation. Once converted, the meshes type changes to #ME_WRAPPER_TYPE_MDATA, although the edit mesh is not cleared.

This API exposes functions that abstract over the different kinds of internal data, as well as supporting converting the mesh into regular mesh.

Definition in file mesh_wrapper.cc.