Blender V5.0
bmesh_interp.hh File Reference
#include "BLI_string_ref.hh"
#include "bmesh_class.hh"

Go to the source code of this file.

Classes

struct  BMDataLayerLookup

Namespaces

namespace  blender
namespace  blender::bke

Functions

void BM_loop_interp_multires_ex (BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const float f_dst_center[3], const float f_src_center[3], int cd_loop_mdisp_offset)
void BM_loop_interp_multires (BMesh *bm, BMLoop *l_dst, const BMFace *f_src)
void BM_face_interp_multires_ex (BMesh *bm, BMFace *f_dst, const BMFace *f_src, const float f_dst_center[3], const float f_src_center[3], int cd_loop_mdisp_offset)
void BM_face_interp_multires (BMesh *bm, BMFace *f_dst, const BMFace *f_src)
void BM_vert_interp_from_face (BMesh *bm, BMVert *v_dst, const BMFace *f_src)
void BM_data_interp_from_verts (BMesh *bm, const BMVert *v_src_1, const BMVert *v_src_2, BMVert *v_dst, float fac)
 Data, Interpolate From Verts.
void BM_data_interp_from_edges (BMesh *bm, const BMEdge *e_src_1, const BMEdge *e_src_2, BMEdge *e_dst, float fac)
 Data, Interpolate From Edges.
void BM_data_interp_face_vert_edge (BMesh *bm, const BMVert *v_src_1, const BMVert *v_src_2, BMVert *v, BMEdge *e, float fac)
 Data Face-Vert Edge Interpolate.
void BM_data_layer_add (BMesh *bm, CustomData *data, int type)
void BM_data_layer_add_named (BMesh *bm, CustomData *data, int type, blender::StringRef name)
void BM_data_layer_ensure_named (BMesh *bm, CustomData *data, int type, blender::StringRef name)
bool BM_data_layer_has_named (const BMesh *bm, const CustomData *data, int type, blender::StringRef name)
void BM_data_layer_free (BMesh *bm, CustomData *data, int type)
void BM_uv_map_attr_pin_ensure_for_all_layers (BMesh *bm)
void BM_uv_map_attr_pin_ensure_named (BMesh *bm, blender::StringRef uv_map_name)
bool BM_uv_map_attr_pin_exists (const BMesh *bm, blender::StringRef uv_map_name)
bool BM_data_layer_free_named (BMesh *bm, CustomData *data, blender::StringRef name)
void BM_data_layer_free_n (BMesh *bm, CustomData *data, int type, int n)
void BM_data_layer_copy (BMesh *bm, CustomData *data, int type, int src_n, int dst_n)
BMDataLayerLookup BM_data_layer_lookup (const BMesh &bm, const blender::StringRef name)
float BM_elem_float_data_get (CustomData *cd, void *element, int type)
void BM_elem_float_data_set (CustomData *cd, void *element, int type, float val)
void BM_face_interp_from_face_ex (BMesh *bm, BMFace *f_dst, const BMFace *f_src, bool do_vertex, const void **blocks, const void **blocks_v, float(*cos_2d)[2], float axis_mat[3][3])
 Data Interpolate From Face.
void BM_face_interp_from_face (BMesh *bm, BMFace *f_dst, const BMFace *f_src, bool do_vertex)
void BM_loop_interp_from_face (BMesh *bm, BMLoop *l_dst, const BMFace *f_src, bool do_vertex, bool do_multires)
void BM_face_multires_bounds_smooth (BMesh *bm, BMFace *f)
LinkNodeBM_vert_loop_groups_data_layer_create (BMesh *bm, BMVert *v, int layer_n, const float *loop_weights, MemArena *arena)
void BM_vert_loop_groups_data_layer_merge (BMesh *bm, LinkNode *groups, int layer_n)
void BM_vert_loop_groups_data_layer_merge_weights (BMesh *bm, LinkNode *groups, int layer_n, const float *loop_weights)

Function Documentation

◆ BM_data_interp_face_vert_edge()

void BM_data_interp_face_vert_edge ( BMesh * bm,
const BMVert * v_src_1,
const BMVert * v_src_2,
BMVert * v,
BMEdge * e,
float fac )

Data Face-Vert Edge Interpolate.

Walks around the faces of e and interpolates the loop data between two sources.

Definition at line 97 of file bmesh_interp.cc.

References bm, CustomData_bmesh_interp(), BMHeader::data, e, BMLoop::head, BMLoop::next, BMLoop::prev, BMLoop::radial_next, BMLoop::v, v, and w().

Referenced by BM_edge_split().

◆ BM_data_interp_from_edges()

void BM_data_interp_from_edges ( BMesh * bm,
const BMEdge * e_src_1,
const BMEdge * e_src_2,
BMEdge * e_dst,
float fac )

Data, Interpolate From Edges.

Interpolates per-edge data from two sources to e_dst.

Note
This is an exact match to BM_data_interp_from_verts.

Definition at line 79 of file bmesh_interp.cc.

References bm, and bm_data_interp_from_elem().

Referenced by bm_edge_collapse(), and blender::bke::pbvh::merge_edge_data().

◆ BM_data_interp_from_verts()

void BM_data_interp_from_verts ( BMesh * bm,
const BMVert * v_src_1,
const BMVert * v_src_2,
BMVert * v_dst,
float fac )

Data, Interpolate From Verts.

Interpolates per-vertex data from two sources to v_dst

Note
This is an exact match to BM_data_interp_from_edges.

Definition at line 72 of file bmesh_interp.cc.

References bm, and bm_data_interp_from_elem().

Referenced by bm_bridge_splice_loops(), bm_edge_collapse(), BM_edge_split(), BM_vert_collapse_faces(), bpy_bmvert_copy_from_vert_interp(), and blender::bke::pbvh::pbvh_bmesh_vert_create().

◆ BM_data_layer_add()

◆ BM_data_layer_add_named()

◆ BM_data_layer_copy()

◆ BM_data_layer_ensure_named()

◆ BM_data_layer_free()

◆ BM_data_layer_free_n()

◆ BM_data_layer_free_named()

bool BM_data_layer_free_named ( BMesh * bm,
CustomData * data,
blender::StringRef name )

◆ BM_data_layer_has_named()

bool BM_data_layer_has_named ( const BMesh * bm,
const CustomData * data,
int type,
blender::StringRef name )

References bm, data, and name.

◆ BM_data_layer_lookup()

BMDataLayerLookup BM_data_layer_lookup ( const BMesh & bm,
const blender::StringRef name )

Search for a named custom data layer on all attribute domains and return the domain and type. This is roughly analogous to Mesh::attributes().lookup(...), but keep in mind that certain attributes stored on Mesh are not stored as attributes on BMesh.

Definition at line 1039 of file bmesh_interp.cc.

References bm, blender::bke::Corner, blender::bke::custom_data_type_to_attr_type(), blender::bke::Edge, blender::bke::Face, name, and blender::bke::Point.

Referenced by blender::draw::extract_attribute(), blender::draw::extract_attribute_subdiv(), and blender::draw::pbvh::update_generic_attribute_bmesh().

◆ BM_elem_float_data_get()

float BM_elem_float_data_get ( CustomData * cd,
void * element,
int type )

Definition at line 1023 of file bmesh_interp.cc.

References CustomData_bmesh_get(), data, and element.

Referenced by TEST().

◆ BM_elem_float_data_set()

void BM_elem_float_data_set ( CustomData * cd,
void * element,
int type,
float val )

Definition at line 1030 of file bmesh_interp.cc.

References CustomData_bmesh_get(), data, and element.

Referenced by TEST().

◆ BM_face_interp_from_face()

◆ BM_face_interp_from_face_ex()

void BM_face_interp_from_face_ex ( BMesh * bm,
BMFace * f_dst,
const BMFace * f_src,
bool do_vertex,
const void ** blocks,
const void ** blocks_v,
float(*) cos_2d[2],
float axis_mat[3][3] )

Data Interpolate From Face.

Projects target onto source, and pulls interpolated custom-data from source.

Note
Only handles loop custom-data. multi-res is handled.
Attributes such as selection, material & normals must be handled with a separate call to BM_elem_attrs_copy.

Definition at line 140 of file bmesh_interp.cc.

References BLI_array_alloca, bm, BM_FACE_FIRST_LOOP, BMVert::co, CustomData_bmesh_interp(), BMHeader::data, BMLoop::head, BMVert::head, interp_weights_poly_v2(), BMFace::len, mul_v2_m3v3(), BMLoop::next, BMLoop::v, and w().

Referenced by BM_face_interp_from_face(), bmo_face_inset_individual(), and bmo_inset_region_exec().

◆ BM_face_interp_multires()

void BM_face_interp_multires ( BMesh * bm,
BMFace * f_dst,
const BMFace * f_src )

◆ BM_face_interp_multires_ex()

void BM_face_interp_multires_ex ( BMesh * bm,
BMFace * f_dst,
const BMFace * f_src,
const float f_dst_center[3],
const float f_src_center[3],
int cd_loop_mdisp_offset )

◆ BM_face_multires_bounds_smooth()

void BM_face_multires_bounds_smooth ( BMesh * bm,
BMFace * f )

Smooths boundaries between multi-res grids, including some borders in adjacent faces.

mdisps is a grid of displacements, ordered thus:

                   v4/next
                     |
 |      v1/cent-----mid2 ---> x
 |         |         |
 |         |         |
v2/prev---mid1-----v3/cur
           |
           V
           y

mdisps is a grid of displacements, ordered thus:

                   v4/next
                     |
 |      v1/cent-----mid2 ---> x
 |         |         |
 |         |         |
v2/prev---mid1-----v3/cur
           |
           V
           y

Definition at line 576 of file bmesh_interp.cc.

References add_v3_v3v3(), bm, BM_ELEM_CD_GET_VOID_P, BM_ITER_ELEM, BM_LOOPS_OF_FACE, CD_MDISPS, copy_v3_v3(), CustomData_get_offset(), MDisps::disps, l, mid_v3_v3v3(), mul_v3_fl(), sqrt, MDisps::totdisp, and y.

Referenced by BM_edge_split(), and BM_face_split().

◆ BM_loop_interp_from_face()

void BM_loop_interp_from_face ( BMesh * bm,
BMLoop * l_dst,
const BMFace * f_src,
bool do_vertex,
bool do_multires )

◆ BM_loop_interp_multires()

void BM_loop_interp_multires ( BMesh * bm,
BMLoop * l_dst,
const BMFace * f_src )

Project the multi-resolution grid in target onto f_src's set of multi-resolution grids.

Definition at line 531 of file bmesh_interp.cc.

References bm, BM_face_calc_center_median(), BM_loop_interp_multires_ex(), CD_MDISPS, CustomData_get_offset(), and BMLoop::f.

Referenced by BM_loop_interp_from_face().

◆ BM_loop_interp_multires_ex()

◆ BM_uv_map_attr_pin_ensure_for_all_layers()

◆ BM_uv_map_attr_pin_ensure_named()

void BM_uv_map_attr_pin_ensure_named ( BMesh * bm,
blender::StringRef uv_map_name )

◆ BM_uv_map_attr_pin_exists()

bool BM_uv_map_attr_pin_exists ( const BMesh * bm,
blender::StringRef uv_map_name )

◆ BM_vert_interp_from_face()

◆ BM_vert_loop_groups_data_layer_create()

◆ BM_vert_loop_groups_data_layer_merge()

void BM_vert_loop_groups_data_layer_merge ( BMesh * bm,
LinkNode * groups,
int layer_n )

Take existing custom data and merge each fan's data.

Definition at line 1291 of file bmesh_interp.cc.

References bm, bm_vert_loop_groups_data_layer_merge__single(), CustomData_sizeof(), LinkNode::link, LinkNode::next, and size().

Referenced by blender::ed::transform::mesh_customdatacorrect_apply_vert().

◆ BM_vert_loop_groups_data_layer_merge_weights()

void BM_vert_loop_groups_data_layer_merge_weights ( BMesh * bm,
LinkNode * groups,
int layer_n,
const float * loop_weights )