Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | MLoopNorSpace |
struct | MLoopNorSpaceArray |
Macros | |
#define | BKE_MESH_OMP_LIMIT 10000 |
Typedefs | |
typedef struct MLoopNorSpace | MLoopNorSpace |
typedef struct MLoopNorSpaceArray | MLoopNorSpaceArray |
Enumerations | |
enum | { MLNOR_SPACE_IS_SINGLE = 1 << 0 } |
enum | { MLNOR_SPACEARR_LOOP_INDEX = 0 , MLNOR_SPACEARR_BMLOOP_PTR = 1 } |
enum | { MESH_MERGE_VERTS_DUMP_IF_MAPPED , MESH_MERGE_VERTS_DUMP_IF_EQUAL } |
Functions | |
void | BKE_mesh_tag_coords_changed (struct Mesh *mesh) |
void | BKE_mesh_tag_coords_changed_uniformly (struct Mesh *mesh) |
struct BMesh * | BKE_mesh_to_bmesh_ex (const struct Mesh *me, const struct BMeshCreateParams *create_params, const struct BMeshFromMeshParams *convert_params) |
struct BMesh * | BKE_mesh_to_bmesh (struct Mesh *me, struct Object *ob, bool add_key_index, const struct BMeshCreateParams *params) |
struct Mesh * | BKE_mesh_from_bmesh_nomain (struct BMesh *bm, const struct BMeshToMeshParams *params, const struct Mesh *me_settings) |
struct Mesh * | BKE_mesh_from_bmesh_for_eval_nomain (struct BMesh *bm, const struct CustomData_MeshMasks *cd_mask_extra, const struct Mesh *me_settings) |
void | BKE_mesh_ensure_default_orig_index_customdata (struct Mesh *mesh) |
void | BKE_mesh_ensure_default_orig_index_customdata_no_check (struct Mesh *mesh) |
int | poly_find_loop_from_vert (const struct MPoly *poly, const struct MLoop *loopstart, uint vert) |
int | poly_get_adj_loops_from_vert (const struct MPoly *poly, const struct MLoop *mloop, unsigned int vert, unsigned int r_adj[2]) |
int | BKE_mesh_edge_other_vert (const struct MEdge *e, int v) |
void | BKE_mesh_looptri_get_real_edges (const struct Mesh *mesh, const struct MLoopTri *looptri, int r_edges[3]) |
void | BKE_mesh_free_data_for_undo (struct Mesh *me) |
void | BKE_mesh_clear_geometry (struct Mesh *me) |
struct Mesh * | BKE_mesh_add (struct Main *bmain, const char *name) |
void | BKE_mesh_free_editmesh (struct Mesh *mesh) |
void | BKE_mesh_copy_parameters_for_eval (struct Mesh *me_dst, const struct Mesh *me_src) |
void | BKE_mesh_copy_parameters (struct Mesh *me_dst, const struct Mesh *me_src) |
void | BKE_mesh_update_customdata_pointers (struct Mesh *me, bool do_ensure_tess_cd) |
void | BKE_mesh_ensure_skin_customdata (struct Mesh *me) |
struct Mesh * | BKE_mesh_new_nomain (int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len) |
struct Mesh * | BKE_mesh_new_nomain_from_template (const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len) |
struct Mesh * | BKE_mesh_new_nomain_from_template_ex (const struct Mesh *me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len, struct CustomData_MeshMasks mask) |
void | BKE_mesh_eval_delete (struct Mesh *mesh_eval) |
struct Mesh * | BKE_mesh_copy_for_eval (const struct Mesh *source, bool reference) |
struct Mesh * | BKE_mesh_new_nomain_from_curve (const struct Object *ob) |
struct Mesh * | BKE_mesh_new_nomain_from_curve_displist (const struct Object *ob, const struct ListBase *dispbase) |
bool | BKE_mesh_ensure_facemap_customdata (struct Mesh *me) |
bool | BKE_mesh_clear_facemap_customdata (struct Mesh *me) |
float(* | BKE_mesh_orco_verts_get (struct Object *ob))[3] |
void | BKE_mesh_orco_verts_transform (struct Mesh *me, float(*orco)[3], int totvert, int invert) |
void | BKE_mesh_orco_ensure (struct Object *ob, struct Mesh *mesh) |
struct Mesh * | BKE_mesh_from_object (struct Object *ob) |
void | BKE_mesh_assign_object (struct Main *bmain, struct Object *ob, struct Mesh *me) |
void | BKE_mesh_from_metaball (struct ListBase *lb, struct Mesh *me) |
void | BKE_mesh_to_curve_nurblist (const struct Mesh *me, struct ListBase *nurblist, int edge_users_test) |
void | BKE_mesh_to_curve (struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob) |
void | BKE_pointcloud_from_mesh (struct Mesh *me, struct PointCloud *pointcloud) |
void | BKE_mesh_to_pointcloud (struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob) |
void | BKE_mesh_from_pointcloud (const struct PointCloud *pointcloud, struct Mesh *me) |
void | BKE_pointcloud_to_mesh (struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob) |
void | BKE_mesh_material_index_remove (struct Mesh *me, short index) |
bool | BKE_mesh_material_index_used (struct Mesh *me, short index) |
void | BKE_mesh_material_index_clear (struct Mesh *me) |
void | BKE_mesh_material_remap (struct Mesh *me, const unsigned int *remap, unsigned int remap_len) |
void | BKE_mesh_smooth_flag_set (struct Mesh *me, bool use_smooth) |
void | BKE_mesh_auto_smooth_flag_set (struct Mesh *me, bool use_auto_smooth, float auto_smooth_angle) |
void | BKE_mesh_edges_set_draw_render (struct Mesh *me) |
const char * | BKE_mesh_cmp (struct Mesh *me1, struct Mesh *me2, float thresh) |
struct BoundBox * | BKE_mesh_boundbox_get (struct Object *ob) |
void | BKE_mesh_texspace_calc (struct Mesh *me) |
void | BKE_mesh_texspace_ensure (struct Mesh *me) |
void | BKE_mesh_texspace_get (struct Mesh *me, float r_loc[3], float r_size[3]) |
void | BKE_mesh_texspace_get_reference (struct Mesh *me, char **r_texflag, float **r_loc, float **r_size) |
void | BKE_mesh_texspace_copy_from_object (struct Mesh *me, struct Object *ob) |
void | BKE_mesh_split_faces (struct Mesh *mesh, bool free_loop_normals) |
struct Mesh * | BKE_mesh_new_from_object (struct Depsgraph *depsgraph, struct Object *object, bool preserve_all_data_layers, bool preserve_origindex) |
struct Mesh * | BKE_mesh_new_from_object_to_bmain (struct Main *bmain, struct Depsgraph *depsgraph, struct Object *object, bool preserve_all_data_layers) |
struct Mesh * | BKE_mesh_create_derived_for_modifier (struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob_eval, struct ModifierData *md_eval, bool use_virtual_modifiers, bool build_shapekey_layers) |
void | BKE_mesh_nomain_to_mesh (struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob, const struct CustomData_MeshMasks *mask, bool take_ownership) |
void | BKE_mesh_nomain_to_meshkey (struct Mesh *mesh_src, struct Mesh *mesh_dst, struct KeyBlock *kb) |
bool | BKE_mesh_minmax (const struct Mesh *me, float r_min[3], float r_max[3]) |
void | BKE_mesh_transform (struct Mesh *me, const float mat[4][4], bool do_keys) |
void | BKE_mesh_translate (struct Mesh *me, const float offset[3], bool do_keys) |
void | BKE_mesh_tessface_clear (struct Mesh *mesh) |
void | BKE_mesh_do_versions_cd_flag_init (struct Mesh *mesh) |
void | BKE_mesh_mselect_clear (struct Mesh *me) |
void | BKE_mesh_mselect_validate (struct Mesh *me) |
int | BKE_mesh_mselect_find (struct Mesh *me, int index, int type) |
int | BKE_mesh_mselect_active_get (struct Mesh *me, int type) |
void | BKE_mesh_mselect_active_set (struct Mesh *me, int index, int type) |
void | BKE_mesh_count_selected_items (const struct Mesh *mesh, int r_count[3]) |
float(* | BKE_mesh_vert_coords_alloc (const struct Mesh *mesh, int *r_vert_len))[3] |
void | BKE_mesh_vert_coords_get (const struct Mesh *mesh, float(*vert_coords)[3]) |
void | BKE_mesh_vert_coords_apply_with_mat4 (struct Mesh *mesh, const float(*vert_coords)[3], const float mat[4][4]) |
void | BKE_mesh_vert_coords_apply (struct Mesh *mesh, const float(*vert_coords)[3]) |
void | BKE_mesh_recalc_looptri (const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri) |
void | BKE_mesh_recalc_looptri_with_normals (const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri, const float(*poly_normals)[3]) |
const float(* | BKE_mesh_vertex_normals_ensure (const struct Mesh *mesh))[3] |
const float(* | BKE_mesh_poly_normals_ensure (const struct Mesh *mesh))[3] |
void | BKE_mesh_normals_tag_dirty (struct Mesh *mesh) |
void | BKE_mesh_assert_normals_dirty_or_calculated (const struct Mesh *mesh) |
float(* | BKE_mesh_vertex_normals_for_write (struct Mesh *mesh))[3] |
float(* | BKE_mesh_poly_normals_for_write (struct Mesh *mesh))[3] |
void | BKE_mesh_clear_derived_normals (struct Mesh *mesh) |
void | BKE_mesh_vertex_normals_clear_dirty (struct Mesh *mesh) |
void | BKE_mesh_poly_normals_clear_dirty (struct Mesh *mesh) |
bool | BKE_mesh_vertex_normals_are_dirty (const struct Mesh *mesh) |
bool | BKE_mesh_poly_normals_are_dirty (const struct Mesh *mesh) |
void | BKE_mesh_calc_normals_poly (const struct MVert *mvert, int mvert_len, const struct MLoop *mloop, int mloop_len, const struct MPoly *mpoly, int mpoly_len, float(*r_poly_normals)[3]) |
void | BKE_mesh_calc_normals_poly_and_vertex (const struct MVert *mvert, int mvert_len, const struct MLoop *mloop, int mloop_len, const struct MPoly *mpoly, int mpoly_len, float(*r_poly_normals)[3], float(*r_vert_normals)[3]) |
void | BKE_mesh_calc_normals (struct Mesh *me) |
void | BKE_mesh_ensure_normals_for_display (struct Mesh *mesh) |
void | BKE_mesh_calc_normals_looptri (struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num, float(*r_tri_nors)[3]) |
void | BKE_mesh_loop_manifold_fan_around_vert_next (const struct MLoop *mloops, const struct MPoly *mpolys, const int *loop_to_poly, const int *e2lfan_curr, uint mv_pivot_index, const struct MLoop **r_mlfan_curr, int *r_mlfan_curr_index, int *r_mlfan_vert_index, int *r_mpfan_curr_index) |
void | BKE_edges_sharp_from_angle_set (const struct MVert *mverts, int numVerts, struct MEdge *medges, int numEdges, struct MLoop *mloops, int numLoops, struct MPoly *mpolys, const float(*polynors)[3], int numPolys, float split_angle) |
void | BKE_lnor_spacearr_init (MLoopNorSpaceArray *lnors_spacearr, int numLoops, char data_type) |
void | BKE_lnor_spacearr_clear (MLoopNorSpaceArray *lnors_spacearr) |
void | BKE_lnor_spacearr_free (MLoopNorSpaceArray *lnors_spacearr) |
void | BKE_lnor_spacearr_tls_init (MLoopNorSpaceArray *lnors_spacearr, MLoopNorSpaceArray *lnors_spacearr_tls) |
void | BKE_lnor_spacearr_tls_join (MLoopNorSpaceArray *lnors_spacearr, MLoopNorSpaceArray *lnors_spacearr_tls) |
MLoopNorSpace * | BKE_lnor_space_create (MLoopNorSpaceArray *lnors_spacearr) |
void | BKE_lnor_space_define (MLoopNorSpace *lnor_space, const float lnor[3], float vec_ref[3], float vec_other[3], struct BLI_Stack *edge_vectors) |
void | BKE_lnor_space_add_loop (MLoopNorSpaceArray *lnors_spacearr, MLoopNorSpace *lnor_space, int ml_index, void *bm_loop, bool is_single) |
void | BKE_lnor_space_custom_data_to_normal (MLoopNorSpace *lnor_space, const short clnor_data[2], float r_custom_lnor[3]) |
void | BKE_lnor_space_custom_normal_to_data (MLoopNorSpace *lnor_space, const float custom_lnor[3], short r_clnor_data[2]) |
void | BKE_mesh_normals_loop_split (const struct MVert *mverts, const float(*vert_normals)[3], int numVerts, struct MEdge *medges, int numEdges, struct MLoop *mloops, float(*r_loopnors)[3], int numLoops, struct MPoly *mpolys, const float(*polynors)[3], int numPolys, bool use_split_normals, float split_angle, MLoopNorSpaceArray *r_lnors_spacearr, short(*clnors_data)[2], int *r_loop_to_poly) |
void | BKE_mesh_normals_loop_custom_set (const struct MVert *mverts, const float(*vert_normals)[3], int numVerts, struct MEdge *medges, int numEdges, struct MLoop *mloops, float(*r_custom_loopnors)[3], int numLoops, struct MPoly *mpolys, const float(*polynors)[3], int numPolys, short(*r_clnors_data)[2]) |
void | BKE_mesh_normals_loop_custom_from_vertices_set (const struct MVert *mverts, const float(*vert_normals)[3], float(*r_custom_vertnors)[3], int numVerts, struct MEdge *medges, int numEdges, struct MLoop *mloops, int numLoops, struct MPoly *mpolys, const float(*polynors)[3], int numPolys, short(*r_clnors_data)[2]) |
void | BKE_mesh_normals_loop_to_vertex (int numVerts, const struct MLoop *mloops, int numLoops, const float(*clnors)[3], float(*r_vert_clnors)[3]) |
bool | BKE_mesh_has_custom_loop_normals (struct Mesh *me) |
void | BKE_mesh_calc_normals_split (struct Mesh *mesh) |
void | BKE_mesh_calc_normals_split_ex (struct Mesh *mesh, struct MLoopNorSpaceArray *r_lnors_spacearr, float(*r_corner_normals)[3]) |
void | BKE_mesh_set_custom_normals (struct Mesh *mesh, float(*r_custom_loopnors)[3]) |
void | BKE_mesh_set_custom_normals_from_vertices (struct Mesh *mesh, float(*r_custom_vertnors)[3]) |
void | BKE_mesh_calc_poly_normal (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_no[3]) |
void | BKE_mesh_calc_poly_normal_coords (const struct MPoly *mpoly, const struct MLoop *loopstart, const float(*vertex_coords)[3], float r_no[3]) |
void | BKE_mesh_calc_poly_center (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_cent[3]) |
float | BKE_mesh_calc_poly_area (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray) |
float | BKE_mesh_calc_area (const struct Mesh *me) |
float | BKE_mesh_calc_poly_uv_area (const struct MPoly *mpoly, const struct MLoopUV *uv_array) |
void | BKE_mesh_calc_poly_angles (const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float angles[]) |
void | BKE_mesh_poly_edgehash_insert (struct EdgeHash *ehash, const struct MPoly *mp, const struct MLoop *mloop) |
void | BKE_mesh_poly_edgebitmap_insert (unsigned int *edge_bitmap, const struct MPoly *mp, const struct MLoop *mloop) |
bool | BKE_mesh_center_median (const struct Mesh *me, float r_cent[3]) |
bool | BKE_mesh_center_median_from_polys (const struct Mesh *me, float r_cent[3]) |
bool | BKE_mesh_center_bounds (const struct Mesh *me, float r_cent[3]) |
bool | BKE_mesh_center_of_surface (const struct Mesh *me, float r_cent[3]) |
bool | BKE_mesh_center_of_volume (const struct Mesh *me, float r_cent[3]) |
void | BKE_mesh_calc_volume (const struct MVert *mverts, int mverts_num, const struct MLoopTri *mlooptri, int looptri_num, const struct MLoop *mloop, float *r_volume, float r_center[3]) |
void | BKE_mesh_mdisp_flip (struct MDisps *md, bool use_loop_mdisp_flip) |
void | BKE_mesh_polygon_flip_ex (struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata, float(*lnors)[3], struct MDisps *mdisp, bool use_loop_mdisp_flip) |
void | BKE_mesh_polygon_flip (struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata) |
void | BKE_mesh_polygons_flip (struct MPoly *mpoly, struct MLoop *mloop, struct CustomData *ldata, int totpoly) |
struct Mesh * | BKE_mesh_merge_verts (struct Mesh *mesh, const int *vtargetmap, int tot_vtargetmap, int merge_mode) |
void | BKE_mesh_merge_customdata_for_apply_modifier (struct Mesh *me) |
void | BKE_mesh_flush_hidden_from_verts_ex (const struct MVert *mvert, const struct MLoop *mloop, struct MEdge *medge, int totedge, struct MPoly *mpoly, int totpoly) |
void | BKE_mesh_flush_hidden_from_verts (struct Mesh *me) |
void | BKE_mesh_flush_hidden_from_polys_ex (struct MVert *mvert, const struct MLoop *mloop, struct MEdge *medge, int totedge, const struct MPoly *mpoly, int totpoly) |
void | BKE_mesh_flush_hidden_from_polys (struct Mesh *me) |
void | BKE_mesh_flush_select_from_polys_ex (struct MVert *mvert, int totvert, const struct MLoop *mloop, struct MEdge *medge, int totedge, const struct MPoly *mpoly, int totpoly) |
void | BKE_mesh_flush_select_from_polys (struct Mesh *me) |
void | BKE_mesh_flush_select_from_verts (struct Mesh *me) |
void | BKE_mesh_calc_relative_deform (const struct MPoly *mpoly, int totpoly, const struct MLoop *mloop, int totvert, const float(*vert_cos_src)[3], const float(*vert_cos_dst)[3], const float(*vert_cos_org)[3], float(*vert_cos_new)[3]) |
bool | BKE_mesh_validate (struct Mesh *me, bool do_verbose, bool cddata_check_mask) |
bool | BKE_mesh_is_valid (struct Mesh *me) |
bool | BKE_mesh_validate_material_indices (struct Mesh *me) |
bool | BKE_mesh_validate_arrays (struct Mesh *me, struct MVert *mverts, unsigned int totvert, struct MEdge *medges, unsigned int totedge, struct MFace *mfaces, unsigned int totface, struct MLoop *mloops, unsigned int totloop, struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, bool do_verbose, bool do_fixes, bool *r_change) |
bool | BKE_mesh_validate_all_customdata (struct CustomData *vdata, uint totvert, struct CustomData *edata, uint totedge, struct CustomData *ldata, uint totloop, struct CustomData *pdata, uint totpoly, bool check_meshmask, bool do_verbose, bool do_fixes, bool *r_change) |
void | BKE_mesh_strip_loose_faces (struct Mesh *me) |
void | BKE_mesh_strip_loose_polysloops (struct Mesh *me) |
void | BKE_mesh_strip_loose_edges (struct Mesh *me) |
void | BKE_mesh_calc_edges_legacy (struct Mesh *me, bool use_old) |
void | BKE_mesh_calc_edges_loose (struct Mesh *mesh) |
void | BKE_mesh_calc_edges (struct Mesh *mesh, bool keep_existing_edges, bool select_new_edges) |
void | BKE_mesh_calc_edges_tessface (struct Mesh *mesh) |
void | BKE_mesh_wrapper_deferred_finalize_mdata (struct Mesh *me_eval, const struct CustomData_MeshMasks *cd_mask_finalize) |
void | BKE_mesh_eval_geometry (struct Depsgraph *depsgraph, struct Mesh *mesh) |
void | BKE_mesh_batch_cache_dirty_tag (struct Mesh *me, eMeshBatchDirtyMode mode) |
void | BKE_mesh_batch_cache_free (struct Mesh *me) |
char * | BKE_mesh_debug_info (const struct Mesh *me) ATTR_NONNULL(1) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT |
void | BKE_mesh_debug_print (const struct Mesh *me) ATTR_NONNULL(1) |
Variables | |
void(* | BKE_mesh_batch_cache_dirty_tag_cb )(struct Mesh *me, eMeshBatchDirtyMode mode) |
void(* | BKE_mesh_batch_cache_free_cb )(struct Mesh *me) |
#define BKE_MESH_OMP_LIMIT 10000 |
Definition at line 52 of file BKE_mesh.h.
typedef struct MLoopNorSpace MLoopNorSpace |
References a contiguous loop-fan with normal offset vars.
typedef struct MLoopNorSpaceArray MLoopNorSpaceArray |
Collection of MLoopNorSpace basic storage & pre-allocation.
anonymous enum |
anonymous enum |
Enumerator | |
---|---|
MLNOR_SPACEARR_LOOP_INDEX | |
MLNOR_SPACEARR_BMLOOP_PTR |
Definition at line 570 of file BKE_mesh.h.
anonymous enum |
Enumerator | |
---|---|
MESH_MERGE_VERTS_DUMP_IF_MAPPED | |
MESH_MERGE_VERTS_DUMP_IF_EQUAL |
Definition at line 817 of file BKE_mesh.h.
void BKE_edges_sharp_from_angle_set | ( | const struct MVert * | mverts, |
int | numVerts, | ||
struct MEdge * | medges, | ||
int | numEdges, | ||
struct MLoop * | mloops, | ||
int | numLoops, | ||
struct MPoly * | mpolys, | ||
const float(*) | polynors[3], | ||
int | numPolys, | ||
float | split_angle | ||
) |
Define sharp edges as needed to mimic 'autosmooth' from angle threshold.
Used when defining an empty custom loop normals data layer, to keep same shading as with auto-smooth!
Referenced by mesh_customdata_custom_splitnormals_add_exec().
void BKE_lnor_space_add_loop | ( | MLoopNorSpaceArray * | lnors_spacearr, |
MLoopNorSpace * | lnor_space, | ||
int | ml_index, | ||
void * | bm_loop, | ||
bool | is_single | ||
) |
Add a new given loop to given lnor_space. Depending on lnor_space->data_type, we expect bm_loop to be a pointer to BMLoop struct (in case of BMLOOP_PTR), or nullptr (in case of LOOP_INDEX), loop index is then stored in pointer. If is_single is set, the BMLoop or loop index is directly stored in lnor_space->loops pointer (since there is only one loop in this fan), else it is added to the linked list of loops in the fan.
Definition at line 660 of file mesh_normals.cc.
References BLI_assert, BLI_linklist_prepend_nlink(), MLoopNorSpaceArray::data_type, MLoopNorSpace::flags, MLoopNorSpace::loops, MLoopNorSpaceArray::loops_pool, MLoopNorSpaceArray::lspacearr, MLNOR_SPACE_IS_SINGLE, MLNOR_SPACEARR_BMLOOP_PTR, MLNOR_SPACEARR_LOOP_INDEX, and POINTER_FROM_INT.
Referenced by bm_mesh_loops_calc_normals_for_loop(), split_loop_nor_fan_do(), and split_loop_nor_single_do().
MLoopNorSpace* BKE_lnor_space_create | ( | MLoopNorSpaceArray * | lnors_spacearr | ) |
Definition at line 579 of file mesh_normals.cc.
References BLI_memarena_calloc(), MLoopNorSpaceArray::mem, and MLoopNorSpaceArray::spaces_num.
Referenced by bm_mesh_loops_calc_normals_for_loop(), and loop_split_generator().
void BKE_lnor_space_custom_data_to_normal | ( | MLoopNorSpace * | lnor_space, |
const short | clnor_data[2], | ||
float | r_custom_lnor[3] | ||
) |
Definition at line 695 of file mesh_normals.cc.
References beta(), copy_v3_v3(), cosf, float(), M_PI, madd_v3_v3fl(), mul_v3_v3fl(), MLoopNorSpace::ref_alpha, MLoopNorSpace::ref_beta, sinf, unit_short_to_float(), MLoopNorSpace::vec_lnor, MLoopNorSpace::vec_ortho, and MLoopNorSpace::vec_ref.
Referenced by BM_custom_loop_normals_to_vector_layer(), BM_lnorspace_rebuild(), bm_mesh_loops_calc_normals_for_loop(), edbm_average_normals_exec(), edbm_smooth_normals_exec(), loop_normal_editdata_init(), split_loop_nor_fan_do(), and split_loop_nor_single_do().
void BKE_lnor_space_custom_normal_to_data | ( | MLoopNorSpace * | lnor_space, |
const float | custom_lnor[3], | ||
short | r_clnor_data[2] | ||
) |
Definition at line 729 of file mesh_normals.cc.
References add_v3_v3(), beta(), compare_v3v3(), dot_v3v3(), float(), is_zero_v3(), LNOR_SPACE_TRIGO_THRESHOLD, M_PI, mul_v3_v3fl(), normalize_v3(), MLoopNorSpace::ref_alpha, MLoopNorSpace::ref_beta, saacosf(), unit_float_to_short(), MLoopNorSpace::vec_lnor, MLoopNorSpace::vec_ortho, and MLoopNorSpace::vec_ref.
Referenced by applyNormalRotation(), bevel_harden_normals(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BM_lnorspace_rebuild(), bm_mesh_loops_assign_normal_data(), edbm_average_normals_exec(), edbm_flip_normals_custom_loop_normals(), edbm_normals_tools_exec(), edbm_set_normals_from_faces_exec(), edbm_smooth_normals_exec(), flip_custom_normals(), freeCustomNormalArray(), mesh_normals_loop_custom_set(), normals_merge(), normals_split(), and point_normals_apply().
void BKE_lnor_space_define | ( | MLoopNorSpace * | lnor_space, |
const float | lnor[3], | ||
float | vec_ref[3], | ||
float | vec_other[3], | ||
struct BLI_Stack * | edge_vectors | ||
) |
Should only be called once. Beware, this modifies ref_vec and other_vec in place! In case no valid space can be generated, ref_alpha and ref_beta are set to zero (which means 'use auto lnors').
Definition at line 588 of file mesh_normals.cc.
References beta(), BLI_assert, BLI_stack_clear(), BLI_stack_discard(), BLI_stack_is_empty(), BLI_stack_peek(), copy_v3_v3(), count, cross_v3_v3v3(), dot_v3v3(), fabsf, float(), LIKELY, LNOR_SPACE_TRIGO_THRESHOLD, M_PI, mul_v3_v3fl(), normalize_v3(), normalize_v3_v3(), MLoopNorSpace::ref_alpha, MLoopNorSpace::ref_beta, saacos(), saacosf(), sub_v3_v3(), UNLIKELY, MLoopNorSpace::vec_lnor, MLoopNorSpace::vec_ortho, and MLoopNorSpace::vec_ref.
Referenced by bm_mesh_loops_calc_normals_for_loop(), split_loop_nor_fan_do(), and split_loop_nor_single_do().
void BKE_lnor_spacearr_clear | ( | MLoopNorSpaceArray * | lnors_spacearr | ) |
Definition at line 560 of file mesh_normals.cc.
References BLI_memarena_clear(), MLoopNorSpaceArray::loops_pool, MLoopNorSpaceArray::lspacearr, MLoopNorSpaceArray::mem, and MLoopNorSpaceArray::spaces_num.
Referenced by BKE_lnor_spacearr_tls_join(), BM_lnorspace_rebuild(), bm_mesh_loops_custom_normals_set(), mesh_customdata_custom_splitnormals_clear_exec(), and mesh_normals_loop_custom_set().
void BKE_lnor_spacearr_free | ( | MLoopNorSpaceArray * | lnors_spacearr | ) |
Definition at line 570 of file mesh_normals.cc.
References BLI_memarena_free(), MLoopNorSpaceArray::loops_pool, MLoopNorSpaceArray::lspacearr, MLoopNorSpaceArray::mem, and MLoopNorSpaceArray::spaces_num.
Referenced by apply_weights_vertex_normal(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_normals_loop_split(), BKE_mesh_split_faces(), BM_lnorspace_err(), BM_mesh_data_free(), bm_mesh_loops_calc_normals__multi_threaded(), bm_mesh_loops_calc_normals__single_threaded(), and mesh_normals_loop_custom_set().
void BKE_lnor_spacearr_init | ( | MLoopNorSpaceArray * | lnors_spacearr, |
int | numLoops, | ||
char | data_type | ||
) |
Definition at line 519 of file mesh_normals.cc.
References BLI_assert, BLI_memarena_alloc(), BLI_memarena_calloc(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, MLoopNorSpaceArray::data_type, ELEM, MLoopNorSpaceArray::loops_pool, MLoopNorSpaceArray::lspacearr, MLoopNorSpaceArray::mem, MLNOR_SPACEARR_BMLOOP_PTR, MLNOR_SPACEARR_LOOP_INDEX, and MLoopNorSpaceArray::spaces_num.
Referenced by BKE_mesh_normals_loop_split(), BM_lnorspace_err(), bm_mesh_loops_calc_normals__multi_threaded(), and bm_mesh_loops_calc_normals__single_threaded().
void BKE_lnor_spacearr_tls_init | ( | MLoopNorSpaceArray * | lnors_spacearr, |
MLoopNorSpaceArray * | lnors_spacearr_tls | ||
) |
Utility for multi-threaded calculation that ensures lnors_spacearr_tls
doesn't share memory with lnors_spacearr
that would cause it not to be thread safe.
Definition at line 541 of file mesh_normals.cc.
References BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, and MLoopNorSpaceArray::mem.
Referenced by bm_mesh_loops_calc_normals_for_vert_init_fn().
void BKE_lnor_spacearr_tls_join | ( | MLoopNorSpaceArray * | lnors_spacearr, |
MLoopNorSpaceArray * | lnors_spacearr_tls | ||
) |
Utility for multi-threaded calculation that merges lnors_spacearr_tls
into lnors_spacearr
.
Definition at line 548 of file mesh_normals.cc.
References BKE_lnor_spacearr_clear(), BLI_assert, BLI_memarena_free(), BLI_memarena_merge(), MLoopNorSpaceArray::data_type, MLoopNorSpaceArray::mem, and MLoopNorSpaceArray::spaces_num.
Referenced by bm_mesh_loops_calc_normals_for_vert_reduce_fn().
Definition at line 963 of file mesh.cc.
References BKE_id_new(), and ID_ME.
Referenced by BKE_mesh_new_from_object_to_bmain(), BKE_object_obdata_add_from_type(), BKE_pointcloud_to_mesh(), blender::io::usd::USDMeshReader::create_object(), Freestyle::BlenderStrokeRenderer::NewMesh(), object_convert_exec(), blender::io::stl::read_stl_ascii(), blender::io::stl::read_stl_binary(), blender::io::alembic::AbcMeshReader::readObjectData(), blender::io::alembic::AbcSubDReader::readObjectData(), blender::io::alembic::AbcPointsReader::readObjectData(), blender::bke::tests::MeshTestData::setup(), blender::bke::tests::TwoMeshesTestData::setup(), blender::bke::tests::TEST(), blender::io::stl::STLMeshHelper::to_mesh(), and MeshImporter::write_geometry().
Check that a mesh with non-dirty normals has vertex and face custom data layers. If these asserts fail, it means some area cleared the dirty flag but didn't copy or add the normal layers, or removed normals but didn't set the dirty flag.
Referenced by BKE_mesh_calc_normals_split_ex(), BKE_mesh_copy_parameters_for_eval(), BKE_mesh_is_valid(), BKE_mesh_nomain_to_mesh(), BKE_mesh_split_faces(), BKE_mesh_validate_arrays(), mesh_blend_read_data(), mesh_calc_modifiers(), mesh_copy_data(), and mesh_get_eval_final().
Definition at line 1377 of file mesh.cc.
References BKE_modifiers_test_object(), BKE_object_materials_test(), Object::data, Mesh::id, id_us_min(), id_us_plus(), if(), multires_force_sculpt_rebuild(), OB_MESH, and Object::type.
Referenced by MeshImporter::create_mesh_object(), and blender::io::stl::importer_main().
void BKE_mesh_auto_smooth_flag_set | ( | struct Mesh * | me, |
bool | use_auto_smooth, | ||
float | auto_smooth_angle | ||
) |
Definition at line 1500 of file mesh.cc.
References Mesh::flag, ME_AUTOSMOOTH, and Mesh::smoothresh.
Referenced by shade_smooth_exec().
void BKE_mesh_batch_cache_dirty_tag | ( | struct Mesh * | me, |
eMeshBatchDirtyMode | mode | ||
) |
Definition at line 294 of file mesh_runtime.cc.
References Mesh_Runtime::batch_cache, BKE_mesh_batch_cache_dirty_tag_cb, and Mesh::runtime.
Referenced by BKE_object_data_batch_cache_dirty_tag(), BKE_object_data_select_update(), geometry_extract_apply(), paint_mask_slice_exec(), paintface_flush_flags(), paintvert_flush_flags(), quadriflow_start_job(), sculpt_face_set_edit_modify_geometry(), sculpt_gesture_trim_end(), sculpt_symmetrize_exec(), shade_smooth_exec(), tag_object_after_update(), uv_select_tag_update_for_object(), uv_shortest_path_pick_ex(), vertex_color_set(), voxel_remesh_exec(), vpaint_mode_toggle_exec(), vpaint_stroke_update_step_intern(), and wpaint_stroke_update_step().
Definition at line 300 of file mesh_runtime.cc.
References Mesh_Runtime::batch_cache, BKE_mesh_batch_cache_free_cb, and Mesh::runtime.
Referenced by BKE_mesh_runtime_clear_cache().
Definition at line 1207 of file mesh.cc.
References Object_Runtime::bb, BKE_boundbox_init_from_minmax(), BKE_mesh_wrapper_minmax(), BOUNDBOX_DIRTY, Object::data, BoundBox::flag, INIT_MINMAX, max, MEM_mallocN, min, and Object::runtime.
Referenced by BKE_object_boundbox_get(), BKE_object_minmax(), blender::io::obj::transform_object(), and voxel_size_edit_invoke().
Referenced by quadriflow_check().
Calculate edges from polygons.
Definition at line 207 of file mesh_calc_edges.cc.
References blender::bke::calc_edges::add_existing_edges_to_hash_maps(), blender::bke::calc_edges::add_polygon_edges_to_hash_maps(), BLI_assert, CD_ASSIGN, CD_MEDGE, blender::bke::calc_edges::clear_hash_tables(), CustomData_add_layer(), CustomData_free(), CustomData_reset(), Mesh::edata, blender::bke::calc_edges::get_parallel_maps_count(), is_power_of_2_i(), ME_EDGEDRAW, ME_EDGERENDER, Mesh::medge, MEM_calloc_arrayN, mesh, blender::bke::calc_edges::reserve_hash_maps(), SELECT, blender::bke::calc_edges::serialize_and_initialize_deduplicated_edges(), Mesh::totedge, and blender::bke::calc_edges::update_edge_indices_in_poly_loops().
Referenced by BKE_mesh_from_metaball(), BKE_mesh_validate_arrays(), blender::nodes::node_geo_curve_fill_cc::cdt_to_mesh(), blender::geometry::create_cuboid_mesh(), ED_mesh_update(), blender::io::obj::OBJMesh::ensure_mesh_edges(), blender::io::alembic::read_mpolys(), sculpt_gesture_trim_geometry_generate(), and MeshImporter::write_geometry().
If the mesh is from a very old blender version, convert MFace.edcode to edge ME_EDGEDRAW.
Definition at line 1474 of file mesh_validate.cc.
References BKE_mesh_strip_loose_faces(), CD_ASSIGN, CD_MEDGE, CustomData_add_layer(), Mesh::edata, Mesh::medge, mesh_calc_edges_mdata(), Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by blo_do_versions_pre250().
Definition at line 1505 of file mesh_validate.cc.
References MLoop::e, MEdge::flag, ME_EDGEDRAW, ME_LOOSEEDGE, Mesh::medge, mesh, Mesh::mloop, Mesh::totedge, and Mesh::totloop.
Referenced by blo_do_versions_280(), blender::nodes::node_geo_delete_geometry_cc::do_mesh_separation(), ED_mesh_update(), blender::io::obj::OBJMesh::ensure_mesh_edges(), and modifyMesh().
Calculate/create edges from tessface data
mesh | The mesh to add edges into |
Definition at line 1523 of file mesh_validate.cc.
References BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS, BLI_edgeset_add(), BLI_edgeset_free(), BLI_edgeset_len(), BLI_edgeset_new_ex(), BLI_edgesetIterator_free(), BLI_edgesetIterator_getKey(), BLI_edgesetIterator_isDone(), BLI_edgesetIterator_new(), BLI_edgesetIterator_step(), CD_CALLOC, CD_MEDGE, CD_ORIGINDEX, CustomData_add_layer(), CustomData_free(), CustomData_get_layer(), CustomData_reset(), Mesh::edata, MEdge::flag, ME_EDGEDRAW, ME_EDGERENDER, Mesh::medge, mesh, Mesh::mface, ORIGINDEX_NONE, Mesh::totedge, Mesh::totface, MEdge::v1, MFace::v1, MEdge::v2, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cutEdges(), and explodeMesh().
Calculate vertex and face normals, storing the result in custom data layers on the mesh.
Definition at line 454 of file mesh_normals.cc.
References BKE_mesh_calc_normals(), BKE_mesh_vertex_normals_ensure(), mesh, TIMEIT_END_AVERAGED, and TIMEIT_START_AVERAGED.
Referenced by BKE_mesh_calc_normals().
void BKE_mesh_calc_normals_looptri | ( | struct MVert * | mverts, |
int | numVerts, | ||
const struct MLoop * | mloop, | ||
const struct MLoopTri * | looptri, | ||
int | looptri_num, | ||
float(*) | r_tri_nors[3] | ||
) |
Referenced by BKE_pbvh_vert_coords_apply().
void BKE_mesh_calc_normals_poly | ( | const struct MVert * | mvert, |
int | mvert_len, | ||
const struct MLoop * | mloop, | ||
int | mloop_len, | ||
const struct MPoly * | mpoly, | ||
int | mpoly_len, | ||
float(*) | r_poly_normals[3] | ||
) |
Calculate face normals directly into a result array.
Referenced by BKE_keyblock_mesh_calc_normals().
void BKE_mesh_calc_normals_poly_and_vertex | ( | const struct MVert * | mvert, |
int | mvert_len, | ||
const struct MLoop * | mloop, | ||
int | mloop_len, | ||
const struct MPoly * | mpoly, | ||
int | mpoly_len, | ||
float(*) | r_poly_normals[3], | ||
float(*) | r_vert_normals[3] | ||
) |
Calculate face and vertex normals directly into result arrays.
Referenced by BKE_keyblock_mesh_calc_normals().
Definition at line 1911 of file mesh.cc.
References BKE_mesh_calc_normals_split_ex(), ensure_corner_normal_layer(), and mesh.
Referenced by GeometryExporter::create_normals(), displaceModifier_do(), editbmesh_calc_modifier_final_normals(), blender::io::obj::OBJMesh::ensure_mesh_normals(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::io::alembic::get_loop_normals(), Freestyle::BlenderFileLoader::insertShapeNode(), mesh_calc_modifier_final_normals(), mesh_calc_tri_tessface(), mesh_wrapper_ensure_subdivision(), modifyMesh(), and triangulate_mesh().
void BKE_mesh_calc_normals_split_ex | ( | struct Mesh * | mesh, |
struct MLoopNorSpaceArray * | r_lnors_spacearr, | ||
float(*) | r_corner_normals[3] | ||
) |
Compute 'split' (aka loop, or per face corner's) normals.
r_lnors_spacearr | Allows to get computed loop normal space array. That data, among other things, contains 'smooth fan' info, useful e.g. to split geometry along sharp edges. |
Definition at line 1875 of file mesh.cc.
References BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_normals_loop_split(), BKE_mesh_poly_normals_ensure(), BKE_mesh_vertex_normals_ensure(), CD_CUSTOMLOOPNORMAL, CustomData_get_layer(), Mesh::flag, Mesh::ldata, M_PI, ME_AUTOSMOOTH, Mesh::medge, mesh, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::smoothresh, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_mesh_calc_normals_split(), BKE_mesh_split_faces(), and blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec().
void BKE_mesh_calc_poly_angles | ( | const struct MPoly * | mpoly, |
const struct MLoop * | loopstart, | ||
const struct MVert * | mvarray, | ||
float | angles[] | ||
) |
Referenced by wn_corner_angle(), and wn_face_with_angle().
void BKE_mesh_calc_poly_center | ( | const struct MPoly * | mpoly, |
const struct MLoop * | loopstart, | ||
const struct MVert * | mvarray, | ||
float | r_cent[3] | ||
) |
Referenced by BKE_mesh_foreach_mapped_face_center(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remap_calc_polys_from_mesh(), BKE_remesh_reproject_sculpt_face_sets(), do_draw_face_sets_brush_task_cb_ex(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), mesh_island_to_astar_graph_edge_process(), and multires_subdivide_create_object_space_linear_grids().
void BKE_mesh_calc_poly_normal | ( | const struct MPoly * | mpoly, |
const struct MLoop * | loopstart, | ||
const struct MVert * | mvarray, | ||
float | r_no[3] | ||
) |
Referenced by BKE_mesh_foreach_mapped_face_center(), blender::io::obj::OBJMesh::calc_poly_normal(), GeometryExporter::create_normals(), blender::nodes::node_geo_input_mesh_edge_angle_cc::AngleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), GPU_pbvh_mesh_buffers_update(), mesh_calc_normals_poly_fn(), mesh_calc_tri_tessface(), mesh_init_origspace(), multiresbake_get_normal(), and pbvh_update_normals_accum_task_cb().
void BKE_mesh_calc_poly_normal_coords | ( | const struct MPoly * | mpoly, |
const struct MLoop * | loopstart, | ||
const float(*) | vertex_coords[3], | ||
float | r_no[3] | ||
) |
Referenced by multires_reshape_apply_base_refit_base_mesh(), and uvprojectModifier_do().
Referenced by blender::draw::compute_area_ratio().
void BKE_mesh_calc_relative_deform | ( | const struct MPoly * | mpoly, |
int | totpoly, | ||
const struct MLoop * | mloop, | ||
int | totvert, | ||
const float(*) | vert_cos_src[3], | ||
const float(*) | vert_cos_dst[3], | ||
const float(*) | vert_cos_org[3], | ||
float(*) | vert_cos_new[3] | ||
) |
This function takes the difference between 2 vertex-coord-arrays (vert_cos_src, vert_cos_dst), and applies the difference to vert_cos_new relative to vert_cos_org.
vert_cos_src | reference deform source. |
vert_cos_dst | reference deform destination. |
vert_cos_org | reference for the output location. |
vert_cos_new | resulting coords. |
Referenced by meshcache_do().
void BKE_mesh_calc_volume | ( | const struct MVert * | mverts, |
int | mverts_num, | ||
const struct MLoopTri * | mlooptri, | ||
int | looptri_num, | ||
const struct MLoop * | mloop, | ||
float * | r_volume, | ||
float | r_center[3] | ||
) |
Calculate the volume and center.
r_volume | Volume (unsigned). |
r_center | Center of mass. |
Referenced by object_origin_set_exec().
Referenced by object_origin_set_exec().
Calculate the center from polygons, use when we want to ignore vertex locations that don't have connected faces.
Referenced by object_origin_set_exec().
Referenced by object_origin_set_exec().
Free any cached vertex or poly normals. Face corner (loop) normals are also derived data, but are not handled with the same method yet, so they are not included. It's important that this is called after the mesh changes size, since otherwise cached normal arrays might not be large enough (though it may be called indirectly by other functions).
Definition at line 147 of file mesh_normals.cc.
References MEM_SAFE_FREE, mesh, Mesh_Runtime::poly_normals, Mesh_Runtime::poly_normals_dirty, Mesh::runtime, Mesh_Runtime::vert_normals, and Mesh_Runtime::vert_normals_dirty.
Referenced by BKE_mesh_nomain_to_mesh(), BKE_mesh_runtime_clear_cache(), BM_mesh_bm_to_me(), BM_mesh_bm_to_me_for_eval(), and ED_mesh_join_objects_exec().
Definition at line 838 of file mesh.cc.
References BMEditMesh::bm, bm, BM_data_layer_free(), CD_FACEMAP, CustomData_free_layers(), CustomData_has_layer(), Mesh::edit_mesh, BMesh::pdata, Mesh::pdata, and Mesh::totpoly.
Definition at line 941 of file mesh.cc.
References BKE_animdata_free(), BKE_mesh_runtime_clear_cache(), Mesh::id, mesh, and mesh_clear_geometry().
Used for unit testing; compares two meshes, checking only differences we care about. should be usable with leaf's testing framework I get RNA work done, will use hackish testing code for now.
Definition at line 702 of file mesh.cc.
References Freestyle::c, cmpcode_to_str(), customdata_compare(), Mesh::edata, Mesh::ldata, Mesh::pdata, Mesh::totedge, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Performs copy for use during evaluation, optional referencing original arrays to reduce memory.
Referenced by BKE_crazyspace_build_sculpt(), BKE_multires_create_mesh(), BKE_sculpt_get_first_deform_matrices(), canvas_copyMesh(), cloth_make_rest_mesh(), MeshComponent::copy(), create_orco_mesh(), deformVerts(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_Modifier_apply(), dynamicPaint_paintMesh(), editbmesh_calc_modifiers(), MeshComponent::ensure_owns_direct_data(), MeshComponent::get_for_write(), mesh_calc_modifiers(), mesh_new_from_evaluated_curve_type_object(), object_convert_exec(), quadriflow_start_job(), RE_bake_normal_world_to_tangent(), RE_bake_pixels_populate_from_objects(), and remesh_symmetry_bisect().
Copy user editable settings that we want to preserve when a new mesh is based on an existing mesh.
Referenced by BKE_id_eval_properties_copy().
A version of BKE_mesh_copy_parameters that is intended for evaluated output (the modifier stack for example).
Referenced by BKE_mesh_wrapper_from_editmesh_with_coords(), create_empty_mesh(), blender::geometry::execute_realize_mesh_tasks(), geometry_extract_apply(), modifier_modify_mesh_and_geometry_set(), modifyMesh(), and paint_mask_slice_exec().
struct Mesh* BKE_mesh_create_derived_for_modifier | ( | struct Depsgraph * | depsgraph, |
struct Scene * | scene, | ||
struct Object * | ob_eval, | ||
struct ModifierData * | md_eval, | ||
bool | use_virtual_modifiers, | ||
bool | build_shapekey_layers | ||
) |
use_virtual_modifiers | When enabled calculate virtual-modifiers before applying md_eval support this since virtual-modifiers are not modifiers from a user perspective, allowing shape keys to be included with the modifier being applied, see: T91923. |
Definition at line 1283 of file mesh_convert.cc.
References add_shapekey_layers(), ASSERT_IS_VALID_MESH, BKE_id_copy_ex(), BKE_id_free(), BKE_keyblock_convert_to_mesh(), BKE_mesh_vert_coords_alloc(), BKE_mesh_vert_coords_apply(), BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), BLI_assert, BLI_findlink(), Key::block, Object::data, Object_Runtime::data_orig, ModifierTypeInfo::deformVerts, depsgraph, eModifierMode_Realtime, eModifierTypeType_OnlyDeform, ListBase::first, float(), Mesh::id, ModifierTypeInfo::isDisabled, Mesh::key, LIB_ID_COPY_LOCALIZE, MEM_freeN, MOD_APPLY_TO_BASE_MESH, ModifierData::mode, Object::modifiers, ModifierTypeInfo::modifyMesh, Mesh::mvert, ModifierData::next, result, Object::runtime, scene, Object::shapenr, Mesh::totvert, ModifierTypeInfo::type, and ModifierData::type.
Referenced by modifier_apply_create_mesh_for_modifier().
char* BKE_mesh_debug_info | ( | const struct Mesh * | me | ) |
Definition at line 1659 of file mesh.cc.
References MEdge::bweight, Mesh::cd_flag, MEdge::crease, ME_CDFLAG_EDGE_BWEIGHT, ME_CDFLAG_EDGE_CREASE, ME_CDFLAG_VERT_BWEIGHT, Mesh::medge, mesh, Mesh::mvert, and UNLIKELY.
Referenced by blo_do_versions_260().
int BKE_mesh_edge_other_vert | ( | const struct MEdge * | e, |
int | v | ||
) |
Return the index of the edge vert that is not equal to v. If neither edge vertex is equal to v, returns -1.
Referenced by BKE_mesh_remap_calc_edges_from_mesh(), build_edge_mats(), build_emats_stack(), and collect_hull_frames().
Needed after converting a mesh with subsurf optimal display to mesh.
Definition at line 826 of file mesh_convert.cc.
References MEdge::flag, ME_EDGEDRAW, ME_EDGERENDER, Mesh::medge, mesh, and Mesh::totedge.
Referenced by object_convert_exec().
Add original index (CD_ORIGINDEX) layers if they don't already exist. This is meant to be used when creating an evaluated mesh from an original edit mode mesh, to allow mapping from the evaluated vertices to the originals.
The mesh is expected to of a ME_WRAPPER_TYPE_MDATA
wrapper type. This is asserted.
Definition at line 1194 of file mesh.cc.
References BKE_mesh_ensure_default_orig_index_customdata_no_check(), BLI_assert, ME_WRAPPER_TYPE_MDATA, mesh, Mesh::runtime, and Mesh_Runtime::wrapper_type.
Referenced by create_orco_mesh(), and editbmesh_calc_modifiers().
Same as BKE_mesh_ensure_default_orig_index_customdata but does not perform any checks: they must be done by the caller.
Definition at line 1200 of file mesh.cc.
References Mesh::edata, ensure_orig_index_layer(), mesh, Mesh::pdata, Mesh::totedge, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_ensure_default_orig_index_customdata().
Definition at line 819 of file mesh.cc.
References BMEditMesh::bm, bm, BM_data_layer_add(), CD_DEFAULT, CD_FACEMAP, CustomData_add_layer(), CustomData_has_layer(), Mesh::edit_mesh, BMesh::pdata, Mesh::pdata, and Mesh::totpoly.
Called after calculating all modifiers.
Definition at line 434 of file mesh_normals.cc.
References BKE_editmesh_cache_ensure_poly_normals(), BKE_editmesh_cache_ensure_vert_normals(), BKE_mesh_poly_normals_ensure(), BKE_mesh_vertex_normals_ensure(), Mesh_Runtime::edit_data, Mesh::edit_mesh, ME_WRAPPER_TYPE_BMESH, ME_WRAPPER_TYPE_MDATA, ME_WRAPPER_TYPE_SUBD, mesh, Mesh::runtime, EditMeshData::vertexCos, and Mesh_Runtime::wrapper_type.
Referenced by curve_calc_modifiers_post(), editbmesh_calc_modifier_final_normals(), mesh_calc_modifier_final_normals(), and mesh_calc_tri_tessface().
Definition at line 786 of file mesh.cc.
References BMEditMesh::bm, bm, BM_data_layer_add(), BM_ITER_MESH, BM_VERTS_OF_MESH, CD_DEFAULT, CD_MVERT_SKIN, CustomData_add_layer(), CustomData_bmesh_get(), CustomData_has_layer(), BMHeader::data, Mesh::edit_mesh, MVertSkin::flag, BMVert::head, MVERT_SKIN_ROOT, Mesh::totvert, v, BMesh::vdata, and Mesh::vdata.
Referenced by BKE_object_copy_modifier(), ED_object_modifier_add(), mesh_customdata_skin_add_exec(), and skin_root_mark_exec().
Definition at line 1117 of file mesh.cc.
References BKE_libblock_free_data(), Mesh::edit_mesh, Mesh::id, MEM_freeN, and mesh_free_data().
Referenced by BKE_object_free_derived_caches(), and object_force_modifier_update_for_bind().
Definition at line 2199 of file mesh.cc.
References BKE_id_free(), BKE_mesh_texspace_calc(), copy_v3_v3(), DEG_debug_print_eval(), DEG_get_original_id(), DEG_is_active(), depsgraph, Mesh::edit_mesh, Mesh::id, Mesh::loc, ME_AUTOSPACE_EVALUATED, mesh, Mesh_Runtime::mesh_eval, ID::name, Mesh::runtime, Mesh::size, and Mesh::texflag.
Referenced by blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock().
Definition at line 800 of file mesh_evaluate.cc.
References BKE_mesh_flush_hidden_from_polys_ex(), Mesh::medge, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::totedge, and Mesh::totpoly.
Referenced by BKE_sculpt_sync_face_sets_visibility_to_base_mesh(), paintface_hide(), and paintface_reveal().
void BKE_mesh_flush_hidden_from_polys_ex | ( | struct MVert * | mvert, |
const struct MLoop * | mloop, | ||
struct MEdge * | medge, | ||
int | totedge, | ||
const struct MPoly * | mpoly, | ||
int | totpoly | ||
) |
Definition at line 763 of file mesh_evaluate.cc.
References BKE_mesh_flush_hidden_from_verts_ex(), Mesh::medge, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::totedge, and Mesh::totpoly.
Referenced by face_set_edit_do_post_visibility_updates(), hide_show_exec(), paintvert_hide(), paintvert_reveal(), sculpt_face_set_init_exec(), and sculpt_undo_restore_list().
void BKE_mesh_flush_hidden_from_verts_ex | ( | const struct MVert * | mvert, |
const struct MLoop * | mloop, | ||
struct MEdge * | medge, | ||
int | totedge, | ||
struct MPoly * | mpoly, | ||
int | totpoly | ||
) |
Update the hide flag for edges and faces from the corresponding flag in verts.
Definition at line 843 of file mesh_evaluate.cc.
References BKE_mesh_flush_select_from_polys_ex(), Mesh::medge, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::totedge, Mesh::totpoly, and Mesh::totvert.
Referenced by ed_vwpaintmode_exit_generic(), paint_weight_gradient_exec(), and paintface_flush_flags().
void BKE_mesh_flush_select_from_polys_ex | ( | struct MVert * | mvert, |
int | totvert, | ||
const struct MLoop * | mloop, | ||
struct MEdge * | medge, | ||
int | totedge, | ||
const struct MPoly * | mpoly, | ||
int | totpoly | ||
) |
simple poly -> vert/edge selection.
Definition at line 886 of file mesh_evaluate.cc.
References Mesh::medge, mesh_flush_select_from_verts(), Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by ed_vwpaintmode_exit_generic(), and paintvert_flush_flags().
Free (or release) any data used by this mesh (does not free the mesh itself). Only use for undo, in most cases BKE_id_free(nullptr, me)
should be used.
Definition at line 903 of file mesh.cc.
References Mesh::id, and mesh_free_data().
Referenced by undomesh_free_data().
Definition at line 169 of file mesh.cc.
References BKE_editmesh_free_data(), Mesh::edit_mesh, BMEditMesh::is_shallow_copy, MEM_freeN, and mesh.
Referenced by editbmesh_build_data(), and mesh_free_data().
struct Mesh* BKE_mesh_from_bmesh_for_eval_nomain | ( | struct BMesh * | bm, |
const struct CustomData_MeshMasks * | cd_mask_extra, | ||
const struct Mesh * | me_settings | ||
) |
Referenced by base_skin(), BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(), construct_param_handle_subsurfed(), create_orco_mesh(), deformVerts(), blender::io::alembic::ABCGenericMeshWriter::do_write(), doEdgeSplit(), editbmesh_calc_modifiers(), blender::nodes::node_geo_edge_split_cc::mesh_edge_split(), modifyMesh(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), triangulate_mesh(), blender::nodes::node_geo_triangulate_cc::triangulate_mesh_selection(), and WireframeModifier_do().
struct Mesh* BKE_mesh_from_bmesh_nomain | ( | struct BMesh * | bm, |
const struct BMeshToMeshParams * | params, | ||
const struct Mesh * | me_settings | ||
) |
Definition at line 72 of file mesh_convert.cc.
References Freestyle::a, BKE_mesh_calc_edges(), BKE_mesh_update_customdata_pointers(), CD_CALLOC, CD_MLOOP, CD_MPOLY, CD_MVERT, MVert::co, copy_v3_v3(), count, CustomData_add_layer(), DL_INDEX4, ListBase::first, MPoly::flag, if(), DispList::index, Mesh::ldata, MPoly::loopstart, ME_SMOOTH, Mesh::mloop, Mesh::mpoly, Mesh::mvert, DispList::nr, DispList::parts, Mesh::pdata, Mesh::totloop, MPoly::totloop, Mesh::totpoly, Mesh::totvert, DispList::type, MLoop::v, Mesh::vdata, and DispList::verts.
Referenced by mesh_new_from_mball_object(), and object_convert_exec().
Definition at line 1365 of file mesh.cc.
References Object::data, OB_MESH, and Object::type.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), build_pbvh_from_ccg(), createTransEdge(), do_paintface_box_select(), ED_mesh_join_objects_exec(), ED_object_sculptmode_enter_ex(), ED_object_sculptmode_exit_ex(), ED_object_texture_paint_mode_enter_ex(), ED_object_texture_paint_mode_exit_ex(), ED_paint_proj_mesh_data_check(), ed_vwpaintmode_enter_generic(), ed_vwpaintmode_exit_generic(), ED_wpaint_ensure_data(), multires_force_external_reload(), multiresModifier_del_levels(), paint_proj_new_stroke(), paintface_deselect_all_visible(), paintface_flush_flags(), paintface_hide(), paintface_minmax(), paintface_mouse_select(), paintface_reveal(), paintface_select_linked(), paintvert_deselect_all_visible(), paintvert_flush_flags(), paintvert_hide(), paintvert_reveal(), paintvert_select_ungrouped(), quadriflow_remesh_exec(), SCULPT_boundary_info_ensure(), sculpt_face_set_grow(), sculpt_face_set_shrink(), sculpt_gesture_apply_trim(), sculpt_gesture_init_face_set_properties(), SCULPT_mesh_symmetry_xyz_get(), vertex_color_brightness_contrast_exec(), vertex_color_hsv_exec(), vertex_color_invert_exec(), vertex_color_levels_exec(), vertex_color_set(), vertex_color_smooth(), vertex_paint_from_weight(), vertex_weight_paint_mode_poll(), vgroup_selected_get(), vpaint_mode_toggle_exec(), vpaint_stroke_test_start(), weight_paint_sample_enum_itemf(), weight_sample_invoke(), wpaint_mode_toggle_exec(), and wpaint_stroke_test_start().
void BKE_mesh_from_pointcloud | ( | const struct PointCloud * | pointcloud, |
struct Mesh * | me | ||
) |
High-level custom normals functions.
Definition at line 894 of file mesh.cc.
References BMEditMesh::bm, CD_CUSTOMLOOPNORMAL, CustomData_has_layer(), Mesh::edit_mesh, BMesh::ldata, and Mesh::ldata.
Referenced by mesh_customdata_custom_splitnormals_add_exec(), and mesh_customdata_custom_splitnormals_clear_exec().
Checks if a Mesh is valid without any modification. This is always verbose.
Definition at line 1088 of file mesh_validate.cc.
References BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_validate_all_customdata(), BKE_mesh_validate_arrays(), BLI_assert, Mesh::dvert, Mesh::edata, is_valid, Mesh::ldata, Mesh::medge, Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Referenced by blender::nodes::node_geo_extrude_mesh_cc::node_geo_exec().
void BKE_mesh_loop_manifold_fan_around_vert_next | ( | const struct MLoop * | mloops, |
const struct MPoly * | mpolys, | ||
const int * | loop_to_poly, | ||
const int * | e2lfan_curr, | ||
uint | mv_pivot_index, | ||
const struct MLoop ** | r_mlfan_curr, | ||
int * | r_mlfan_curr_index, | ||
int * | r_mlfan_vert_index, | ||
int * | r_mpfan_curr_index | ||
) |
void BKE_mesh_looptri_get_real_edges | ( | const struct Mesh * | mesh, |
const struct MLoopTri * | looptri, | ||
int | r_edges[3] | ||
) |
Sets each output array element to the edge index if it is a real edge, or -1.
Referenced by GPU_pbvh_mesh_buffers_build(), lineart_identify_mlooptri_feature_edges(), mesh_looptri_target_project(), and shrinkwrap_build_boundary_data().
Definition at line 1441 of file mesh.cc.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by material_data_index_clear_id().
Definition at line 1401 of file mesh.cc.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by material_data_index_remove_id().
Definition at line 1420 of file mesh.cc.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by BKE_object_material_slot_used().
void BKE_mesh_material_remap | ( | struct Mesh * | me, |
const unsigned int * | remap, | ||
unsigned int | remap_len | ||
) |
Definition at line 1456 of file mesh.cc.
References BMEditMesh::bm, BM_FACES_OF_MESH, BM_ITER_MESH, Mesh::edit_mesh, BMFace::mat_nr, MPoly::mat_nr, MAT_NR_REMAP, Mesh::mpoly, and Mesh::totpoly.
Referenced by BKE_object_material_remap().
Flip a single MLoop's MDisps structure, low level function to be called from face-flipping code which re-arranged the mdisps themselves.
Definition at line 635 of file mesh_evaluate.cc.
References MDisps::disps, float(), sqrt(), SWAP, swap_v3_v3(), MDisps::totdisp, UNLIKELY, x, and y.
Referenced by BKE_mesh_polygon_flip_ex(), and bmesh_kernel_loop_reverse().
Account for custom-data such as UV's becoming detached because of of imprecision in custom-data interpolation. Without running this operation subdivision surface can cause UV's to be disconnected, see: T81065.
Definition at line 104 of file mesh_merge_customdata.cc.
References Freestyle::a, blender::Vector< T, InlineBufferCapacity, Allocator >::append_unchecked(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), BKE_mesh_vert_loop_map_create(), CD_MLOOPUV, CustomData_get_layer_n(), CustomData_number_of_layers(), Mesh::ldata, Mesh::mloop, Mesh::mpoly, blender::threading::parallel_for(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by modifier_apply_exec_ex(), and object_convert_exec().
struct Mesh* BKE_mesh_merge_verts | ( | struct Mesh * | mesh, |
const int * | vtargetmap, | ||
int | tot_vtargetmap, | ||
int | merge_mode | ||
) |
Merge Verts
This frees the given mesh and returns a new mesh.
vtargetmap | The table that maps vertices to target vertices. a value of -1 indicates a vertex is a target, and is to be kept. This array is aligned with 'mesh->totvert' |
tot_vtargetmap | The number of non '-1' values in vtargetmap. (not the size) |
merge_mode | enum with two modes.
|
Definition at line 192 of file mesh_merge.c.
References BKE_mesh_vert_poly_map_create(), BLI_assert, BLI_BITMAP_DISABLE, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, BLI_edgehash_ensure_p(), BLI_edgehash_new_ex(), BLI_edgehash_remove(), BLI_gset_flag_set(), BLI_gset_haskey(), BLI_gset_insert(), BLI_gset_new_ex(), Freestyle::c, cddm_poly_compare(), MeshElemMap::count, MLoop::e, ELEM, GHASH_FLAG_ALLOW_DUPES, PolyKey::hash_sum, PolyKey::hash_xor, MeshElemMap::indices, LIKELY, MPoly::loopstart, Mesh::medge, MEM_malloc_arrayN, mesh, MESH_MERGE_VERTS_DUMP_IF_EQUAL, MESH_MERGE_VERTS_DUMP_IF_MAPPED, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, POINTER_AS_INT, POINTER_FROM_INT, poly_gset_compare_fn(), poly_gset_hash_fn(), PolyKey::poly_index, result, STACK_DECLARE, STACK_DISCARD, STACK_INIT, STACK_PUSH, STACK_PUSH_RET_PTR, STACK_SIZE, Mesh::totedge, Mesh::totloop, MPoly::totloop, PolyKey::totloops, Mesh::totpoly, Mesh::totvert, UNLIKELY, MLoop::v, v1, MEdge::v1, v2, and MEdge::v2.
Referenced by arrayModifier_doArray(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), and mesh_remove_doubles_on_axis().
int BKE_mesh_mselect_active_get | ( | struct Mesh * | me, |
int | type | ||
) |
Definition at line 1772 of file mesh.cc.
References BLI_assert, ELEM, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::mselect, Mesh::totselect, type, and MSelect::type.
Referenced by ED_mesh_active_dvert_get_ob().
Definition at line 1784 of file mesh.cc.
References BKE_mesh_mselect_find(), BLI_assert, MSelect::index, MEM_reallocN, Mesh::mselect, SWAP, Mesh::totselect, type, and MSelect::type.
Referenced by ed_wpaint_vertex_select_pick().
Definition at line 1695 of file mesh.cc.
References MEM_SAFE_FREE, Mesh::mselect, and Mesh::totselect.
Referenced by paintvert_deselect_all_visible(), and SCULPT_dynamic_topology_enable_ex().
int BKE_mesh_mselect_find | ( | struct Mesh * | me, |
int | index, | ||
int | type | ||
) |
me->mselect
, or -1 Definition at line 1759 of file mesh.cc.
References BLI_assert, ELEM, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::mselect, Mesh::totselect, type, and MSelect::type.
Referenced by BKE_mesh_mselect_active_set().
Definition at line 1701 of file mesh.cc.
References BLI_assert_unreachable, MVert::flag, MEdge::flag, MPoly::flag, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::medge, MEM_freeN, MEM_malloc_arrayN, MEM_reallocN, Mesh::mpoly, Mesh::mselect, Mesh::mvert, SELECT, Mesh::totselect, and type.
Referenced by do_lasso_select_paintvert(), do_paintvert_box_select(), ed_wpaint_vertex_select_pick(), paint_vertsel_circle_select(), and paintvert_deselect_all_visible().
struct Mesh* BKE_mesh_new_from_object | ( | struct Depsgraph * | depsgraph, |
struct Object * | object, | ||
bool | preserve_all_data_layers, | ||
bool | preserve_origindex | ||
) |
Create new mesh from the given object at its current state. The owner of this mesh is unknown, it is up to the caller to decide.
If preserve_all_data_layers is truth then the modifier stack is re-evaluated to ensure it preserves all possible custom data layers.
Definition at line 1102 of file mesh_convert.cc.
References BLI_assert, depsgraph, Mesh::edit_mesh, Mesh::id, mesh_new_from_curve_type_object(), mesh_new_from_mball_object(), mesh_new_from_mesh_object(), OB_CURVES_LEGACY, OB_FONT, OB_MBALL, OB_MESH, OB_SURF, Object::type, and ID::us.
Referenced by bake(), bake_mesh_new_from_object(), BKE_mesh_new_from_object_to_bmain(), BKE_object_to_mesh(), bpy_bmesh_from_object(), blender::io::alembic::ABCMetaballWriter::get_export_mesh(), blender::io::usd::USDMetaballWriter::get_export_mesh(), lineart_object_load_single_instance(), and blender::io::obj::OBJMesh::OBJMesh().
struct Mesh* BKE_mesh_new_from_object_to_bmain | ( | struct Main * | bmain, |
struct Depsgraph * | depsgraph, | ||
struct Object * | object, | ||
bool | preserve_all_data_layers | ||
) |
This is a version of BKE_mesh_new_from_object() which stores mesh in the given main database. However, that function enforces object type to be a geometry one, and ensures a mesh is always generated, be it empty.
Definition at line 1177 of file mesh_convert.cc.
References BKE_library_foreach_ID_link(), BKE_mesh_add(), BKE_mesh_new_from_object(), BKE_mesh_nomain_to_mesh(), BLI_assert, CD_MASK_MESH, Object::data, depsgraph, ELEM, Mesh::flag, foreach_libblock_make_original_callback(), foreach_libblock_make_usercounts_callback(), Mesh::id, id_us_min(), IDWALK_NOP, Mesh::mat, mesh, blender::bke::mesh_attributes_for_write(), ID::name, OB_CURVES_LEGACY, OB_FONT, OB_MBALL, OB_MESH, OB_SURF, blender::bke::MutableAttributeAccessor::remove_anonymous(), Mesh::smoothresh, Mesh::totcol, Object::type, and ID::us.
Referenced by object_data_convert_curve_to_mesh().
struct Mesh* BKE_mesh_new_nomain | ( | int | verts_len, |
int | edges_len, | ||
int | tessface_len, | ||
int | loops_len, | ||
int | polys_len | ||
) |
Definition at line 991 of file mesh.cc.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc(), BKE_libblock_init_empty(), BKE_mesh_update_customdata_pointers(), CD_NUMTYPES, copy_vn_i(), Mesh::edata, Mesh::fdata, Mesh::id, ID_ME, Mesh::ldata, LIB_ID_CREATE_LOCALIZE, mesh, mesh_ensure_cdlayers_primary(), Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, CustomData::typemap, and Mesh::vdata.
Referenced by BKE_mesh_new_nomain_from_curve_displist(), blender::nodes::node_geo_curve_fill_cc::cdt_to_mesh(), blender::nodes::node_geo_mesh_primitive_circle_cc::create_circle_mesh(), blender::geometry::create_cuboid_mesh(), blender::nodes::create_cylinder_or_cone_mesh(), create_empty_mesh(), blender::nodes::create_grid_mesh(), blender::nodes::create_line_mesh(), blender::io::obj::MeshFromGeometry::create_mesh(), blender::nodes::node_geo_mesh_primitive_uv_sphere_cc::create_uv_sphere_mesh(), blender::nodes::create_vertex_mesh(), curve_calc_modifiers_post(), blender::bke::curve_to_mesh_sweep(), do_multires_bake(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_mesh(), evaluate_surface_object(), blender::geometry::execute_realize_mesh_tasks(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), get_quick_mesh(), hair_create_input_mesh(), modifier_modify_mesh_and_geometry_set(), modifyMesh(), multires_unsubdivide_to_basemesh(), blender::io::alembic::AbcPointsReader::read_mesh(), and sculpt_gesture_trim_geometry_generate().
These functions construct a new Mesh, contrary to BKE_mesh_to_curve_nurblist which modifies ob itself.
Referenced by blender::io::alembic::ABCCurveMeshWriter::get_export_mesh(), knifeproject_poly_from_object(), MOD_deform_mesh_eval_get(), blender::io::alembic::AbcCurveReader::read_mesh(), blender::io::usd::USDCurvesReader::read_mesh(), and blender::io::usd::USDNurbsReader::read_mesh().
struct Mesh* BKE_mesh_new_nomain_from_curve_displist | ( | const struct Object * | ob, |
const struct ListBase * | dispbase | ||
) |
Referenced by curve_calc_modifiers_post().
struct Mesh* BKE_mesh_new_nomain_from_template | ( | const struct Mesh * | me_src, |
int | verts_len, | ||
int | edges_len, | ||
int | tessface_len, | ||
int | loops_len, | ||
int | polys_len | ||
) |
Referenced by arrayModifier_doArray(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_subdiv_to_ccg_mesh(), blender::geometry::create_merged_mesh(), cutEdges(), blender::nodes::node_geo_delete_geometry_cc::do_mesh_separation(), explodeMesh(), MOD_solidify_extrude_modifyMesh(), modifyMesh(), blender::io::alembic::AbcMeshReader::read_mesh(), blender::io::alembic::AbcSubDReader::read_mesh(), blender::io::usd::USDMeshReader::read_mesh(), and subdivide_base().
struct Mesh* BKE_mesh_new_nomain_from_template_ex | ( | const struct Mesh * | me_src, |
int | verts_len, | ||
int | edges_len, | ||
int | tessface_len, | ||
int | loops_len, | ||
int | polys_len, | ||
struct CustomData_MeshMasks | mask | ||
) |
Referenced by subdiv_mesh_topology_info().
void BKE_mesh_nomain_to_mesh | ( | struct Mesh * | mesh_src, |
struct Mesh * | mesh_dst, | ||
struct Object * | ob, | ||
const struct CustomData_MeshMasks * | mask, | ||
bool | take_ownership | ||
) |
Copies a nomain-Mesh into an existing Mesh.
Referenced by blender::io::obj::MeshFromGeometry::create_mesh(), geometry_extract_apply(), modifier_apply_obdata(), multiresModifier_rebuild_subdiv(), object_convert_exec(), paint_mask_slice_exec(), quadriflow_start_job(), blender::io::usd::USDMeshReader::read_object_data(), blender::io::alembic::AbcMeshReader::readObjectData(), blender::io::alembic::AbcSubDReader::readObjectData(), blender::io::alembic::AbcPointsReader::readObjectData(), sculpt_gesture_apply_trim(), and voxel_remesh_exec().
void BKE_mesh_nomain_to_meshkey | ( | struct Mesh * | mesh_src, |
struct Mesh * | mesh_dst, | ||
struct KeyBlock * | kb | ||
) |
Definition at line 1611 of file mesh_convert.cc.
References Freestyle::a, BLI_assert, MVert::co, copy_v3_v3(), KeyBlock::data, Key::elemsize, Mesh::id, Mesh::key, LIB_TAG_NO_MAIN, MEM_freeN, MEM_malloc_arrayN, Mesh::mvert, ID::tag, KeyBlock::totelem, and Mesh::totvert.
Referenced by modifier_apply_shape().
void BKE_mesh_normals_loop_custom_from_vertices_set | ( | const struct MVert * | mverts, |
const float(*) | vert_normals[3], | ||
float(*) | r_custom_vertnors[3], | ||
int | numVerts, | ||
struct MEdge * | medges, | ||
int | numEdges, | ||
struct MLoop * | mloops, | ||
int | numLoops, | ||
struct MPoly * | mpolys, | ||
const float(*) | polynors[3], | ||
int | numPolys, | ||
short(*) | r_clnors_data[2] | ||
) |
Referenced by apply_weights_vertex_normal().
void BKE_mesh_normals_loop_custom_set | ( | const struct MVert * | mverts, |
const float(*) | vert_normals[3], | ||
int | numVerts, | ||
struct MEdge * | medges, | ||
int | numEdges, | ||
struct MLoop * | mloops, | ||
float(*) | r_custom_loopnors[3], | ||
int | numLoops, | ||
struct MPoly * | mpolys, | ||
const float(*) | polynors[3], | ||
int | numPolys, | ||
short(*) | r_clnors_data[2] | ||
) |
void BKE_mesh_normals_loop_split | ( | const struct MVert * | mverts, |
const float(*) | vert_normals[3], | ||
int | numVerts, | ||
struct MEdge * | medges, | ||
int | numEdges, | ||
struct MLoop * | mloops, | ||
float(*) | r_loopnors[3], | ||
int | numLoops, | ||
struct MPoly * | mpolys, | ||
const float(*) | polynors[3], | ||
int | numPolys, | ||
bool | use_split_normals, | ||
float | split_angle, | ||
MLoopNorSpaceArray * | r_lnors_spacearr, | ||
short(*) | clnors_data[2], | ||
int * | r_loop_to_poly | ||
) |
Compute split normals, i.e. vertex normals associated with each poly (hence 'loop normals'). Useful to materialize sharp edges (or non-smooth faces) without actually modifying the geometry (splitting edges).
Referenced by apply_weights_vertex_normal(), BKE_keyblock_mesh_calc_normals(), BKE_mesh_calc_normals_split_ex(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_remap_calc_loops_from_mesh(), data_transfer_dtdata_type_preprocess(), mesh_render_data_update_normals(), and normalEditModifier_do().
void BKE_mesh_normals_loop_to_vertex | ( | int | numVerts, |
const struct MLoop * | mloops, | ||
int | numLoops, | ||
const float(*) | clnors[3], | ||
float(*) | r_vert_clnors[3] | ||
) |
Computes average per-vertex normals from given custom loop normals.
clnors | The computed custom loop normals. |
r_vert_clnors | The (already allocated) array where to store averaged per-vertex normals. |
Referenced by displaceModifier_do().
Tag mesh vertex and face normals to be recalculated when/if they are needed later.
Definition at line 95 of file mesh_normals.cc.
References mesh, Mesh_Runtime::poly_normals_dirty, Mesh::runtime, and Mesh_Runtime::vert_normals_dirty.
Referenced by BKE_mesh_tag_coords_changed(), ED_mesh_join_objects_exec(), ED_mesh_update(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), mesh_blend_read_data(), mesh_copy_data(), mesh_init_data(), MOD_solidify_extrude_modifyMesh(), normalEditModifier_do_directional(), normalEditModifier_do_radial(), blender::io::alembic::process_no_normals(), and sculpt_symmetrize_exec().
Add a CD_ORCO layer to the Mesh if there is none already.
Definition at line 1353 of file mesh.cc.
References BKE_mesh_orco_verts_get(), BKE_mesh_orco_verts_transform(), CD_ASSIGN, CD_ORCO, CustomData_add_layer(), CustomData_has_layer(), float(), mesh, Mesh::totvert, and Mesh::vdata.
Referenced by MOD_deform_mesh_eval_get(), and psys_thread_context_init_distribute().
Definition at line 1314 of file mesh.cc.
References Freestyle::a, MVert::co, copy_v3_v3(), float(), MEM_calloc_arrayN, min_ii(), Mesh::texcomesh, and Mesh::totvert.
Referenced by BKE_mesh_orco_ensure(), and get_orco_coords().
Definition at line 1331 of file mesh.cc.
References Freestyle::a, BKE_mesh_texspace_get(), invert(), madd_v3_v3v3v3(), size(), and Mesh::texcomesh.
Referenced by add_orco_mesh(), BKE_mesh_orco_ensure(), distribute_children_exec(), distribute_from_verts_exec(), blender::draw::extract_tan_init_common(), psys_face_mat(), psys_interpolate_face(), psys_mat_hair_to_orco(), psys_particle_on_dm(), psys_thread_context_init_distribute(), blender::io::alembic::read_generated_coordinates(), and blender::io::alembic::write_generated_coordinates().
void BKE_mesh_poly_edgebitmap_insert | ( | unsigned int * | edge_bitmap, |
const struct MPoly * | mp, | ||
const struct MLoop * | mloop | ||
) |
Referenced by select_linked_tfaces_with_seams().
void BKE_mesh_poly_edgehash_insert | ( | struct EdgeHash * | ehash, |
const struct MPoly * | mp, | ||
const struct MLoop * | mloop | ||
) |
Referenced by make_edges_mdata_extend().
Return true if the mesh polygon normals either are not stored or are dirty. This can be used to help decide whether to transfer them when copying a mesh.
Referenced by BKE_mesh_tag_coords_changed_uniformly(), BKE_subdiv_to_mesh(), C_BVHTree_FromObject(), and mesh_calc_tri_tessface().
Mark the mesh's poly normals non-dirty, for when they are calculated or assigned manually.
Definition at line 131 of file mesh_normals.cc.
References BKE_mesh_assert_normals_dirty_or_calculated(), mesh, Mesh_Runtime::poly_normals_dirty, and Mesh::runtime.
Referenced by BKE_mesh_poly_normals_ensure(), BKE_mesh_tag_coords_changed_uniformly(), and BKE_mesh_vertex_normals_ensure().
Return the normal direction of every polygon, which is defined by the winding direction of its corners.
Referenced by BKE_mesh_calc_loop_tangents(), BKE_mesh_calc_normals_split_ex(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remap_calc_polys_from_mesh(), BKE_shrinkwrap_init_tree(), C_BVHTree_FromObject(), data_transfer_dtdata_type_postprocess(), data_transfer_dtdata_type_preprocess(), do_multires_bake(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), harmonic_coordinates_bind(), mesh_calc_tri_tessface(), mesh_customdata_custom_splitnormals_add_exec(), blender::bke::mesh_normals_varray(), mesh_render_data_update_normals(), MOD_solidify_extrude_modifyMesh(), MOD_solidify_nonmanifold_modifyMesh(), modifyMesh(), normalEditModifier_do(), and blender::bke::NormalAttributeProvider::try_get_for_read().
Retrieve write access to the poly normal layer, ensuring that it exists and that it is not shared. The provided poly normals should be the same as if they were calculated automatically.
Definition at line 113 of file mesh_normals.cc.
References BLI_assert, float(), MEM_allocN_len, MEM_malloc_arrayN, mesh, Mesh_Runtime::poly_normals, Mesh::runtime, and Mesh::totpoly.
Referenced by BKE_mesh_poly_normals_ensure(), BKE_mesh_vertex_normals_ensure(), normalEditModifier_do_directional(), and normalEditModifier_do_radial().
void BKE_mesh_polygon_flip | ( | struct MPoly * | mpoly, |
struct MLoop * | mloop, | ||
struct CustomData * | ldata | ||
) |
Definition at line 714 of file mesh_evaluate.cc.
References BKE_mesh_polygon_flip_ex(), CD_MDISPS, and CustomData_get_layer().
void BKE_mesh_polygon_flip_ex | ( | struct MPoly * | mpoly, |
struct MLoop * | mloop, | ||
struct CustomData * | ldata, | ||
float(*) | lnors[3], | ||
struct MDisps * | mdisp, | ||
bool | use_loop_mdisp_flip | ||
) |
Flip (invert winding of) the given mpoly, i.e. reverse order of its loops (keeping the same vertex as 'start point').
mpoly | the polygon to flip. |
mloop | the full loops array. |
ldata | the loops custom data. |
Definition at line 671 of file mesh_evaluate.cc.
References BKE_mesh_mdisp_flip(), CD_MLOOP, CustomData_get_layer(), CustomData_swap(), e, MLoop::e, MPoly::loopstart, SWAP, swap_v3_v3(), and MPoly::totloop.
Referenced by BKE_mesh_polygon_flip(), BKE_mesh_polygons_flip(), and polygons_check_flip().
void BKE_mesh_polygons_flip | ( | struct MPoly * | mpoly, |
struct MLoop * | mloop, | ||
struct CustomData * | ldata, | ||
int | totpoly | ||
) |
Flip (invert winding of) all polygons (used to inverse their normals).
Definition at line 720 of file mesh_evaluate.cc.
References BKE_mesh_polygon_flip_ex(), CD_MDISPS, and CustomData_get_layer().
void BKE_mesh_recalc_looptri | ( | const struct MLoop * | mloop, |
const struct MPoly * | mpoly, | ||
const struct MVert * | mvert, | ||
int | totloop, | ||
int | totpoly, | ||
struct MLoopTri * | mlooptri | ||
) |
Calculate tessellation into MLoopTri which exist only for this purpose.
Referenced by bake_targets_populate_pixels_color_attributes(), BKE_mesh_runtime_looptri_recalc(), build_pbvh_from_regular_mesh(), cdDM_recalc_looptri(), blender::render::texturemargin::generate_margin(), heat_bone_weighting(), Freestyle::BlenderFileLoader::insertShapeNode(), mesh_calc_tri_tessface(), mesh_faces_to_scratch(), mesh_render_data_update_looptris(), and RE_bake_pixels_populate().
void BKE_mesh_recalc_looptri_with_normals | ( | const struct MLoop * | mloop, |
const struct MPoly * | mpoly, | ||
const struct MVert * | mvert, | ||
int | totloop, | ||
int | totpoly, | ||
struct MLoopTri * | mlooptri, | ||
const float(*) | poly_normals[3] | ||
) |
A version of BKE_mesh_recalc_looptri which takes pre-calculated polygon normals (used to avoid having to calculate the face normal for NGON tessellation).
Referenced by mesh_calc_tri_tessface(), and mesh_render_data_update_looptris().
Higher level functions hiding most of the code needed around call to BKE_mesh_normals_loop_custom_set().
r_custom_loopnors | is not const, since code will replace zero_v3 normals there with automatically computed vectors. |
Definition at line 2075 of file mesh_normals.cc.
References mesh, and mesh_set_custom_normals().
Referenced by mesh_wrapper_ensure_subdivision(), modifyMesh(), blender::io::alembic::process_loop_normals(), and triangulate_mesh().
void BKE_mesh_set_custom_normals_from_vertices | ( | struct Mesh * | mesh, |
float(*) | r_custom_vertnors[3] | ||
) |
Higher level functions hiding most of the code needed around call to BKE_mesh_normals_loop_custom_from_vertices_set().
r_custom_vertnors | is not const, since code will replace zero_v3 normals there with automatically computed vectors. |
Definition at line 2080 of file mesh_normals.cc.
References mesh, and mesh_set_custom_normals().
Referenced by blender::io::alembic::process_vertex_normals().
Definition at line 1486 of file mesh.cc.
References MPoly::flag, ME_SMOOTH, Mesh::mpoly, and Mesh::totpoly.
Referenced by BLO_update_defaults_startup_blend(), modifyMesh(), quadriflow_start_job(), shade_smooth_exec(), and voxel_remesh_exec().
Split faces based on the edge angle and loop normals. Matches behavior of face splitting in render engines.
Definition at line 2121 of file mesh.cc.
References BKE_lnor_spacearr_free(), BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_calc_normals_split_ex(), BKE_mesh_tessface_clear(), BKE_mesh_update_customdata_pointers(), BKE_mesh_validate(), CD_NORMAL, CustomData_duplicate_referenced_layers(), CustomData_free_layers(), CustomData_realloc(), Mesh::edata, ensure_corner_normal_layer(), float(), Mesh::ldata, MLoopNorSpaceArray::mem, MEM_reallocN, mesh, Mesh::runtime, split_faces_prepare_new_edges(), split_faces_prepare_new_verts(), split_faces_split_new_edges(), split_faces_split_new_verts(), Mesh::totedge, Mesh::totloop, Mesh::totpoly, Mesh::totvert, Mesh::vdata, and Mesh_Runtime::vert_normals.
Referenced by bake_mesh_new_from_object().
Definition at line 1255 of file mesh_validate.cc.
References Freestyle::a, usdtokens::b(), CustomData_copy_data(), CustomData_free_elem(), BMLoop::e, e, Mesh::edata, INVALID_LOOP_EDGE_MARKER, l, Mesh::medge, MEM_freeN, MEM_mallocN, Mesh::mloop, and Mesh::totedge.
Referenced by BKE_mesh_validate_arrays().
Definition at line 1163 of file mesh_validate.cc.
References Freestyle::a, usdtokens::b(), CustomData_copy_data(), CustomData_free_elem(), Mesh::fdata, Mesh::mface, Mesh::totface, and MFace::v3.
Referenced by BKE_mesh_calc_edges_legacy(), BKE_mesh_validate_arrays(), and blo_do_versions_pre250().
Works on both loops and polys!
Definition at line 1184 of file mesh_validate.cc.
References Freestyle::a, usdtokens::b(), CustomData_copy_data(), CustomData_free_elem(), BMLoop::e, INVALID_LOOP_EDGE_MARKER, l, Mesh::ldata, MPoly::loopstart, MEM_freeN, MEM_mallocN, Mesh::mloop, Mesh::mpoly, Mesh::pdata, Mesh::totloop, MPoly::totloop, and Mesh::totpoly.
Referenced by BKE_mesh_validate_arrays().
Call after changing vertex positions to tag lazily calculated caches for recomputation.
Definition at line 259 of file mesh_runtime.cc.
References MLoopTri_Store::array, BKE_mesh_normals_tag_dirty(), Mesh_Runtime::bvh_cache, bvhcache_free(), Mesh_Runtime::looptris, MEM_SAFE_FREE, mesh, and Mesh::runtime.
Referenced by BKE_mesh_runtime_clear_geometry(), BKE_mesh_tag_coords_changed_uniformly(), BKE_mesh_transform(), BKE_mesh_vert_coords_apply(), BKE_mesh_vert_coords_apply_with_mat4(), cloth_make_rest_mesh(), dynamicPaint_Modifier_apply(), get_quick_mesh(), multires_reshape_apply_base_refit_base_mesh(), sculpt_undo_restore_list(), SCULPT_vertcos_to_key(), and blender::bke::tag_component_positions_changed().
Call after moving every mesh vertex by the same translation.
Definition at line 269 of file mesh_runtime.cc.
References BKE_mesh_poly_normals_are_dirty(), BKE_mesh_poly_normals_clear_dirty(), BKE_mesh_tag_coords_changed(), BKE_mesh_vertex_normals_are_dirty(), BKE_mesh_vertex_normals_clear_dirty(), and mesh.
Referenced by BKE_mesh_translate().
Definition at line 1654 of file mesh.cc.
References mesh, and mesh_tessface_clear_intern().
Referenced by BKE_mesh_split_faces(), BKE_sculpt_ensure_orig_mesh_data(), do_versions_after_linking_280(), ED_mesh_join_objects_exec(), ED_mesh_update(), mesh_ensure_tessellation_customdata(), mesh_init_origspace(), and vertex_color_set().
Definition at line 1231 of file mesh.cc.
References Freestyle::a, BKE_mesh_wrapper_minmax(), copy_v3_v3(), INIT_MINMAX, Mesh::loc, max, ME_AUTOSPACE, ME_AUTOSPACE_EVALUATED, mid_v3_v3v3(), min, size(), Mesh::size, and Mesh::texflag.
Referenced by BKE_mesh_eval_geometry(), BKE_mesh_texspace_ensure(), and mesh_copy_texture_space_from_curve_type().
Definition at line 1302 of file mesh.cc.
References BKE_object_obdata_texspace_get(), copy_v3_v3(), Mesh::loc, Mesh::size, and Mesh::texflag.
Referenced by BKE_mesh_nomain_to_mesh(), and mesh_new_from_mball_object().
Definition at line 1268 of file mesh.cc.
References BKE_mesh_texspace_calc(), ME_AUTOSPACE, ME_AUTOSPACE_EVALUATED, and Mesh::texflag.
Referenced by BKE_mesh_texspace_get(), BKE_mesh_texspace_get_reference(), psys_get_texture(), and psys_thread_context_init_distribute().
Definition at line 1275 of file mesh.cc.
References BKE_mesh_texspace_ensure(), copy_v3_v3(), Mesh::loc, and Mesh::size.
Referenced by BKE_mesh_orco_verts_transform().
void BKE_mesh_texspace_get_reference | ( | struct Mesh * | me, |
char ** | r_texflag, | ||
float ** | r_loc, | ||
float ** | r_size | ||
) |
Definition at line 1287 of file mesh.cc.
References BKE_mesh_texspace_ensure(), Mesh::loc, Mesh::size, and Mesh::texflag.
Referenced by BKE_object_obdata_texspace_get(), drw_call_calc_orco(), and OVERLAY_texture_space().
struct BMesh* BKE_mesh_to_bmesh | ( | struct Mesh * | me, |
struct Object * | ob, | ||
bool | add_key_index, | ||
const struct BMeshCreateParams * | params | ||
) |
Definition at line 1150 of file mesh.cc.
References BKE_mesh_to_bmesh_ex(), BMeshFromMeshParams::calc_face_normal, params, and Object::shapenr.
Referenced by EDBM_mesh_make().
struct BMesh* BKE_mesh_to_bmesh_ex | ( | const struct Mesh * | me, |
const struct BMeshCreateParams * | create_params, | ||
const struct BMeshFromMeshParams * | convert_params | ||
) |
Referenced by BKE_mesh_mirror_apply_mirror_on_axis(), BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(), blender::io::alembic::ABCGenericMeshWriter::do_write(), doEdgeSplit(), modifyMesh(), triangulate_mesh(), blender::nodes::node_geo_triangulate_cc::triangulate_mesh_selection(), and WireframeModifier_do().
void BKE_mesh_to_curve | ( | struct Main * | bmain, |
struct Depsgraph * | depsgraph, | ||
struct Scene * | scene, | ||
struct Object * | ob | ||
) |
Referenced by object_convert_exec().
void BKE_mesh_to_curve_nurblist | ( | const struct Mesh * | me, |
struct ListBase * | nurblist, | ||
int | edge_users_test | ||
) |
Referenced by knifeproject_poly_from_object().
void BKE_mesh_to_pointcloud | ( | struct Main * | bmain, |
struct Depsgraph * | depsgraph, | ||
struct Scene * | scene, | ||
struct Object * | ob | ||
) |
Referenced by object_convert_exec().
Definition at line 1594 of file mesh.cc.
References BKE_mesh_tag_coords_changed(), BKE_mesh_update_customdata_pointers(), Key::block, CD_MVERT, CD_NORMAL, MVert::co, copy_m3_m4(), CustomData_duplicate_referenced_layer(), float(), Mesh::key, Mesh::ldata, LISTBASE_FOREACH, mul_m3_v3(), mul_m4_v3(), normalize_m3(), Mesh::totloop, Mesh::totvert, and Mesh::vdata.
Referenced by apply_objects_internal(), and blender::nodes::transform_mesh().
Definition at line 1632 of file mesh.cc.
References add_v3_v3(), BKE_mesh_tag_coords_changed_uniformly(), BKE_mesh_update_customdata_pointers(), Key::block, CD_MVERT, CustomData_duplicate_referenced_layer(), Mesh::key, LISTBASE_FOREACH, Mesh::mvert, offset, Mesh::totvert, and Mesh::vdata.
Referenced by generate_bounding_box_mesh(), blender::nodes::node_geo_mesh_primitive_cone_cc::node_geo_exec(), object_origin_set_exec(), and blender::nodes::translate_mesh().
Definition at line 874 of file mesh.cc.
References CD_MCOL, CD_MDEFORMVERT, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MLOOPUV, CD_MPOLY, CD_MTFACE, CD_MVERT, CD_PROP_BYTE_COLOR, CustomData_get_layer(), Mesh::dvert, Mesh::edata, Mesh::fdata, Mesh::ldata, Mesh::mcol, Mesh::medge, mesh_update_linked_customdata(), Mesh::mface, Mesh::mloop, Mesh::mloopcol, Mesh::mloopuv, Mesh::mpoly, Mesh::mtface, Mesh::mvert, Mesh::pdata, and Mesh::vdata.
Referenced by add_orco_mesh(), BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_do_versions_convert_mfaces_to_mpolys(), BKE_mesh_from_metaball(), BKE_mesh_new_nomain(), BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_nomain_to_mesh(), BKE_mesh_split_faces(), BKE_mesh_tessface_calc(), BKE_mesh_transform(), BKE_mesh_translate(), BKE_sculpt_color_layer_create_if_needed(), blo_do_versions_280(), BM_mesh_bm_to_me(), BM_mesh_bm_to_me_for_eval(), blender::bke::create_attribute_providers_for_mesh(), customdata_version_242(), delete_customdata_layer(), ED_mesh_color_add(), ED_mesh_color_ensure(), ED_mesh_join_objects_exec(), ED_mesh_sculpt_color_add(), ED_mesh_sculpt_color_ensure(), ED_mesh_uv_add(), blender::nodes::node_geo_extrude_mesh_cc::expand_mesh(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::ed::geometry::geometry_color_attribute_remove_exec(), hair_create_input_mesh(), mesh_add_edges(), mesh_add_loops(), mesh_add_polys(), mesh_add_verts(), mesh_clear_geometry(), mesh_copy_data(), SCULPT_dynamic_topology_disable_ex(), sculpt_undo_geometry_restore_data(), um_arraystore_compact_ex(), and um_arraystore_expand().
Validates and corrects a Mesh.
Definition at line 1043 of file mesh_validate.cc.
References BKE_mesh_validate_all_customdata(), BKE_mesh_validate_arrays(), CLOG_INFO, DEG_id_tag_update(), Mesh::dvert, Mesh::edata, Mesh::id, ID_RECALC_GEOMETRY_ALL_MODES, Mesh::ldata, LOG, Mesh::medge, Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mvert, ID::name, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_split_faces(), blender::io::obj::MeshFromGeometry::create_mesh(), MeshImporter::create_mesh_object(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::io::stl::importer_main(), blender::io::alembic::read_mpolys(), blender::io::alembic::AbcMeshReader::readObjectData(), blender::io::alembic::AbcSubDReader::readObjectData(), and blender::io::alembic::AbcPointsReader::readObjectData().
bool BKE_mesh_validate_all_customdata | ( | struct CustomData * | vdata, |
uint | totvert, | ||
struct CustomData * | edata, | ||
uint | totedge, | ||
struct CustomData * | ldata, | ||
uint | totloop, | ||
struct CustomData * | pdata, | ||
uint | totpoly, | ||
bool | check_meshmask, | ||
bool | do_verbose, | ||
bool | do_fixes, | ||
bool * | r_change | ||
) |
Definition at line 986 of file mesh_validate.cc.
References CD_MASK_MESH, CD_MASK_NORMAL, CD_MLOOPUV, CustomData_get_clone_layer(), CustomData_get_stencil_layer(), CustomData_number_of_layers(), CustomData_set_layer_clone(), CustomData_set_layer_stencil(), is_valid, mask(), MAX_MTFACE, mesh_validate_customdata(), and PRINT_ERR.
Referenced by BKE_mesh_is_valid(), BKE_mesh_runtime_is_valid(), and BKE_mesh_validate().
bool BKE_mesh_validate_arrays | ( | struct Mesh * | me, |
struct MVert * | mverts, | ||
unsigned int | totvert, | ||
struct MEdge * | medges, | ||
unsigned int | totedge, | ||
struct MFace * | mfaces, | ||
unsigned int | totface, | ||
struct MLoop * | mloops, | ||
unsigned int | totloop, | ||
struct MPoly * | mpolys, | ||
unsigned int | totpoly, | ||
struct MDeformVert * | dverts, | ||
bool | do_verbose, | ||
bool | do_fixes, | ||
bool * | r_change | ||
) |
Validate the mesh, do_fixes requires mesh to be non-null.
While zeroed normals are checked, these checks aren't comprehensive. Technically, to detect errors here a normal recalculation and comparison is necessary. However this function is mainly to prevent severe errors in geometry (invalid data that will crash Blender, or cause some features to behave incorrectly), not to detect subtle differences in the resulting normals which could be caused by importers that load normals (for example).
Definition at line 204 of file mesh_validate.cc.
References BKE_defvert_remove_group(), BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_calc_edges(), BKE_mesh_strip_loose_edges(), BKE_mesh_strip_loose_faces(), BKE_mesh_strip_loose_polysloops(), BKE_mesh_vertex_normals_are_dirty(), BKE_mesh_vertex_normals_ensure(), BLI_assert, BLI_BITMAP_DISABLE, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, BLI_edgehash_free(), BLI_edgehash_haskey(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new_ex(), CHECK_FACE_EDGE, CHECK_FACE_VERT_INDEX, CLAMP, MDeformWeight::def_nr, MDeformVert::dw, MLoop::e, edge_store_from_mface_quad(), edge_store_from_mface_tri(), SortFace::es, faces, float(), if(), SortFace::index, SortPoly::index, MSelect::index, int64_cmp(), int_cmp(), SortPoly::invalid, IS_REMOVED_EDGE, is_valid, is_zero_v3(), CCL_NAMESPACE_BEGIN::isfinite(), SortPoly::loopstart, ME_ESEL, ME_FSEL, ME_VSEL, MEM_callocN, MEM_freeN, MEM_mallocN, mesh, Mesh::mselect, normal, SortPoly::numverts, POINTER_AS_INT, POINTER_FROM_INT, PRINT_ERR, PRINT_MSG, blender::bke::attribute_accessor_functions::remove(), REMOVE_EDGE_TAG, REMOVE_FACE_TAG, REMOVE_LOOP_TAG, REMOVE_POLY_TAG, search_face_cmp(), search_poly_cmp(), search_polyloop_cmp(), Mesh::totedge, Mesh::totpoly, Mesh::totselect, Mesh::totvert, MSelect::type, v, MLoop::v, v1, MEdge::v1, MFace::v1, v2, MEdge::v2, MFace::v2, MFace::v3, MFace::v4, SortPoly::verts, verts, MDeformWeight::weight, and zero_v3().
Referenced by BKE_mesh_is_valid(), BKE_mesh_runtime_is_valid(), BKE_mesh_validate(), and blo_do_versions_290().
Check all material indices of polygons are valid, invalid ones are set to 0.
Definition at line 1133 of file mesh_validate.cc.
References DEG_id_tag_update(), Mesh::id, ID_RECALC_GEOMETRY_ALL_MODES, is_valid, MPoly::mat_nr, max_ii(), Mesh::mpoly, Mesh::totcol, and Mesh::totpoly.
Referenced by add_orco_mesh(), BKE_crazyspace_build_sculpt(), BKE_mesh_create_derived_for_modifier(), BKE_mesh_remap_calc_edges_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remap_calc_verts_from_mesh(), BKE_mesh_remap_find_best_match_from_mesh(), BKE_multires_create_deformed_base_mesh_vert_coords(), BKE_shrinkwrap_mesh_nearest_surface_deform(), BKE_shrinkwrap_remesh_target_project(), build_pbvh_from_regular_mesh(), correctivesmooth_modifier_do(), crazyspace_init_verts_and_matrices(), curve_calc_modifiers_post(), do_hair_dynamics(), editbmesh_calc_modifiers(), mesh_calc_modifiers(), modifyMesh(), multiresModifier_reshapeFromDeformModifier(), multiresModifier_reshapeFromObject(), sculpt_update_object(), and uvprojectModifier_do().
Definition at line 1834 of file mesh.cc.
References BKE_mesh_tag_coords_changed(), CD_MVERT, copy_v3_v3(), CustomData_duplicate_referenced_layer(), mesh, Mesh::mvert, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_create_derived_for_modifier(), BKE_shrinkwrap_mesh_nearest_surface_deform(), BKE_shrinkwrap_remesh_target_project(), create_orco_mesh(), curve_calc_modifiers_post(), deformVerts(), do_hair_dynamics(), ED_object_data_xform_restore(), editbmesh_calc_modifiers(), mesh_calc_modifiers(), and MOD_deform_mesh_eval_get().
void BKE_mesh_vert_coords_apply_with_mat4 | ( | struct Mesh * | mesh, |
const float(*) | vert_coords[3], | ||
const float | mat[4][4] | ||
) |
Definition at line 1846 of file mesh.cc.
References BKE_mesh_tag_coords_changed(), CD_MVERT, CustomData_duplicate_referenced_layer(), mesh, mul_v3_m4v3(), Mesh::mvert, Mesh::totvert, and Mesh::vdata.
Referenced by ED_object_data_xform_by_mat4().
Referenced by ED_object_data_xform_create_ex().
Return true if the mesh vertex normals either are not stored or are dirty. This can be used to help decide whether to transfer them when copying a mesh.
Referenced by arrayModifier_doArray(), BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_tag_coords_changed_uniformly(), BKE_mesh_validate_arrays(), BKE_object_data_transfer_ex(), BKE_subdiv_to_mesh(), MOD_solidify_extrude_modifyMesh(), split_faces_split_new_verts(), and undomesh_to_editmesh().
Mark the mesh's vertex normals non-dirty, for when they are calculated or assigned manually.
Definition at line 125 of file mesh_normals.cc.
References BKE_mesh_assert_normals_dirty_or_calculated(), mesh, Mesh::runtime, and Mesh_Runtime::vert_normals_dirty.
Referenced by arrayModifier_doArray(), BKE_mesh_tag_coords_changed_uniformly(), BKE_mesh_vertex_normals_ensure(), blender::nodes::node_geo_mesh_primitive_uv_sphere_cc::create_uv_sphere_mesh(), and blender::io::alembic::read_mverts().
Returns the normals for each vertex, which is defined as the weighted average of the normals from a vertices surrounding faces, or the normalized position of vertices connected to no faces.
Referenced by arrayModifier_doArray(), BKE_bvhtree_from_mesh_get(), BKE_mesh_calc_loop_tangents(), BKE_mesh_calc_normals_split_ex(), BKE_mesh_foreach_mapped_subdiv_face_center(), BKE_mesh_foreach_mapped_vert(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_remap_calc_edges_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remap_calc_verts_from_mesh(), BKE_mesh_validate_arrays(), BKE_pbvh_build_mesh(), BKE_shrinkwrap_remesh_target_project(), BM_mesh_bm_from_me(), cdDM_from_mesh_ex(), contarget_get_mesh_mat(), GeometryExporter::create_normals(), data_transfer_dtdata_type_postprocess(), data_transfer_dtdata_type_preprocess(), displaceModifier_do(), distribute_from_volume_exec(), do_multires_bake(), dynamicPaint_applySurfaceDisplace(), dynamicPaint_generateBakeData(), dynamicPaint_Modifier_apply(), dynamicPaint_paintMesh(), get_effector_data(), gpencil_generate_edgeloops(), make_duplis_verts(), mesh_calc_hq_normal(), mesh_calc_tri_tessface(), blender::bke::mesh_normals_varray(), mesh_render_data_update_normals(), MOD_deform_mesh_eval_get(), MOD_solidify_extrude_modifyMesh(), modifyMesh(), normalEditModifier_do(), normalEditModifier_do_directional(), normalEditModifier_do_radial(), pointdensity_cache_vertex_normal(), proj_paint_state_mesh_eval_init(), psys_particle_on_dm(), recalc_emitter_field(), shrinkwrap_build_boundary_data(), shrinkwrapModifier_deform(), split_faces_prepare_new_verts(), and waveModifier_do().
Retrieve write access to the vertex normal layer, ensuring that it exists and that it is not shared. The provided vertex normals should be the same as if they were calculated automatically.
Definition at line 101 of file mesh_normals.cc.
References BLI_assert, float(), MEM_allocN_len, MEM_malloc_arrayN, mesh, Mesh::runtime, Mesh::totvert, and Mesh_Runtime::vert_normals.
Referenced by arrayModifier_doArray(), BKE_mesh_vertex_normals_ensure(), BKE_pbvh_build_mesh(), blender::nodes::node_geo_mesh_primitive_uv_sphere_cc::create_uv_sphere_mesh(), mesh_merge_transform(), blender::io::alembic::read_mverts(), split_faces_prepare_new_verts(), and split_faces_split_new_verts().
void BKE_mesh_wrapper_deferred_finalize_mdata | ( | struct Mesh * | me_eval, |
const struct CustomData_MeshMasks * | cd_mask_finalize | ||
) |
void BKE_pointcloud_from_mesh | ( | struct Mesh * | me, |
struct PointCloud * | pointcloud | ||
) |
Definition at line 752 of file mesh_convert.cc.
References ATTR_DOMAIN_POINT, BLI_assert, CD_DUPLICATE, CD_MASK_PROP_ALL, CustomData_merge(), CustomData_realloc(), blender::bke::AttributeAccessor::lookup_or_default(), blender::VArrayCommon< T >::materialize(), blender::bke::mesh_attributes(), PointCloud::pdata, point_attributes, blender::bke::pointcloud_attributes_for_write(), PointCloud::totpoint, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_to_pointcloud().
void BKE_pointcloud_to_mesh | ( | struct Main * | bmain, |
struct Depsgraph * | depsgraph, | ||
struct Scene * | scene, | ||
struct Object * | ob | ||
) |
Referenced by object_convert_exec().
int poly_find_loop_from_vert | ( | const struct MPoly * | poly, |
const struct MLoop * | loopstart, | ||
uint | vert | ||
) |
Find the index of the loop in 'poly' which references vertex, returns -1 if not found
Referenced by MeshFairingContext::adjacents_coords_from_loop(), and adjacet_vertices_index_from_adjacent_edge().
int poly_get_adj_loops_from_vert | ( | const struct MPoly * | poly, |
const struct MLoop * | mloop, | ||
unsigned int | vert, | ||
unsigned int | r_adj[2] | ||
) |
Fill r_adj with the loop indices in poly adjacent to the vertex. Returns the index of the loop matching vertex, or -1 if the vertex is not in poly
Referenced by sculpt_vertex_neighbors_get_faces().
|
extern |
Definition at line 291 of file mesh_runtime.cc.
Referenced by BKE_mesh_batch_cache_dirty_tag(), and DRW_engines_register().
Definition at line 292 of file mesh_runtime.cc.
Referenced by BKE_mesh_batch_cache_free(), and DRW_engines_register().