Blender  V3.3
Functions
mesh_wrapper.cc File Reference
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_task.hh"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_editmesh.h"
#include "BKE_editmesh_cache.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#include "BKE_mesh_wrapper.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h"
#include "BKE_subdiv_modifier.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"

Go to the source code of this file.

Functions

MeshBKE_mesh_wrapper_from_editmesh_with_coords (BMEditMesh *em, const CustomData_MeshMasks *cd_mask_extra, const float(*vert_coords)[3], const Mesh *me_settings)
 
MeshBKE_mesh_wrapper_from_editmesh (BMEditMesh *em, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
 
void BKE_mesh_wrapper_ensure_mdata (Mesh *me)
 
bool BKE_mesh_wrapper_minmax (const Mesh *me, float min[3], float max[3])
 
Mesh Coordinate Access
void BKE_mesh_wrapper_vert_coords_copy (const Mesh *me, float(*vert_coords)[3], int vert_coords_len)
 
void BKE_mesh_wrapper_vert_coords_copy_with_mat4 (const Mesh *me, float(*vert_coords)[3], int vert_coords_len, const float mat[4][4])
 
Mesh Array Length Access
int BKE_mesh_wrapper_vert_len (const Mesh *me)
 
int BKE_mesh_wrapper_edge_len (const Mesh *me)
 
int BKE_mesh_wrapper_loop_len (const Mesh *me)
 
int BKE_mesh_wrapper_poly_len (const Mesh *me)
 
CPU Subdivision Evaluation
static Meshmesh_wrapper_ensure_subdivision (Mesh *me)
 
MeshBKE_mesh_wrapper_ensure_subdivision (Mesh *me)
 

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 (MPoly, MLoop, MEdge, MVert). 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.

Function Documentation

◆ BKE_mesh_wrapper_edge_len()

int BKE_mesh_wrapper_edge_len ( const Mesh me)

◆ BKE_mesh_wrapper_ensure_mdata()

void BKE_mesh_wrapper_ensure_mdata ( Mesh me)

◆ BKE_mesh_wrapper_ensure_subdivision()

Mesh* BKE_mesh_wrapper_ensure_subdivision ( Mesh me)

◆ BKE_mesh_wrapper_from_editmesh()

Mesh* BKE_mesh_wrapper_from_editmesh ( BMEditMesh em,
const CustomData_MeshMasks cd_mask_extra,
const Mesh me_settings 
)

Definition at line 87 of file mesh_wrapper.cc.

References BKE_mesh_wrapper_from_editmesh_with_coords().

◆ BKE_mesh_wrapper_from_editmesh_with_coords()

Mesh* BKE_mesh_wrapper_from_editmesh_with_coords ( BMEditMesh em,
const CustomData_MeshMasks cd_mask_extra,
const float(*)  vert_coords[3],
const Mesh me_settings 
)

◆ BKE_mesh_wrapper_loop_len()

int BKE_mesh_wrapper_loop_len ( const Mesh me)

◆ BKE_mesh_wrapper_minmax()

bool BKE_mesh_wrapper_minmax ( const Mesh me,
float  min[3],
float  max[3] 
)

◆ BKE_mesh_wrapper_poly_len()

int BKE_mesh_wrapper_poly_len ( const Mesh me)

◆ BKE_mesh_wrapper_vert_coords_copy()

void BKE_mesh_wrapper_vert_coords_copy ( const Mesh me,
float(*)  vert_coords[3],
int  vert_coords_len 
)

◆ BKE_mesh_wrapper_vert_coords_copy_with_mat4()

void BKE_mesh_wrapper_vert_coords_copy_with_mat4 ( const Mesh me,
float(*)  vert_coords[3],
int  vert_coords_len,
const float  mat[4][4] 
)

◆ BKE_mesh_wrapper_vert_len()

int BKE_mesh_wrapper_vert_len ( const Mesh me)

◆ mesh_wrapper_ensure_subdivision()

static Mesh* mesh_wrapper_ensure_subdivision ( Mesh me)
static