Blender V4.3
bmesh_mesh_convert.hh File Reference
#include "BLI_string_ref.hh"
#include "bmesh.hh"

Go to the source code of this file.

Classes

struct  BMeshFromMeshParams
 
struct  BMeshToMeshParams
 

Functions

bool BM_attribute_stored_in_bmesh_builtin (const blender::StringRef name)
 
void BM_mesh_bm_from_me (BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams *params) ATTR_NONNULL(1
 Mesh -> BMesh.
 
void BM_mesh_bm_to_me (struct Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params) ATTR_NONNULL(2
 
void void BM_mesh_bm_to_me_for_eval (BMesh &bm, Mesh &mesh, const CustomData_MeshMasks *cd_mask_extra)
 
void BM_mesh_bm_to_me_compact (BMesh &bm, Mesh &mesh, const CustomData_MeshMasks *mask, bool add_mesh_attributes)
 

Function Documentation

◆ BM_attribute_stored_in_bmesh_builtin()

bool BM_attribute_stored_in_bmesh_builtin ( const blender::StringRef name)
Returns
Whether attributes with the given name are stored in special flags or fields in BMesh rather than in the regular custom data blocks.

Definition at line 120 of file bmesh_mesh_convert.cc.

References ELEM.

Referenced by CustomData_shallow_copy_remove_non_bmesh_attributes(), and blender::ed::sculpt_paint::dyntopo::dyntopo_supports_layer().

◆ BM_mesh_bm_from_me()

void BM_mesh_bm_from_me ( BMesh * bm,
const Mesh * mesh,
const BMeshFromMeshParams * params )

Mesh -> BMesh.

Parameters
bmThe mesh to write into, while this is typically a newly created BMesh, merging into existing data is supported. Note the custom-data layout isn't used. If more comprehensive merging is needed we should move this into a separate function since this should be kept fast for edit-mode switching and storing undo steps.
Warning
This function doesn't calculate face normals.

◆ BM_mesh_bm_to_me()

void BM_mesh_bm_to_me ( struct Main * bmain,
BMesh * bm,
Mesh * mesh,
const BMeshToMeshParams * params )
Parameters
bmainMay be NULL in case calc_object_remap parameter option is not set.

◆ BM_mesh_bm_to_me_compact()

void BM_mesh_bm_to_me_compact ( BMesh & bm,
Mesh & mesh,
const CustomData_MeshMasks * mask,
bool add_mesh_attributes )

◆ BM_mesh_bm_to_me_for_eval()

void void BM_mesh_bm_to_me_for_eval ( BMesh & bm,
Mesh & mesh,
const CustomData_MeshMasks * cd_mask_extra )

A version of BM_mesh_bm_to_me intended for getting the mesh to pass to the modifier stack for evaluation, instead of mode switching (where we make sure all data is kept and do expensive lookups to maintain shape keys).

Key differences:

  • Don't support merging with existing mesh.
  • Ignore shape-keys.
  • Ignore vertex-parents.
  • Ignore selection history.
  • Uses CD_MASK_DERIVEDMESH instead of CD_MASK_MESH.
Note
Was cddm_from_bmesh_ex in 2.7x, removed MFace support.

Definition at line 1799 of file bmesh_mesh_convert.cc.

References bm, BM_mesh_bm_to_me_compact(), CD_MASK_DERIVEDMESH, and CustomData_MeshMasks_update().

Referenced by BKE_mesh_from_bmesh_for_eval_nomain(), BKE_mesh_wrapper_ensure_mdata(), and blender::ed::spreadsheet::spreadsheet_get_display_geometry_set().