Blender  V3.3
Classes | Macros
editmesh_tools.c File Reference
#include <stddef.h>
#include "MEM_guardedalloc.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_bitmap.h"
#include "BLI_heap_simple.h"
#include "BLI_linklist.h"
#include "BLI_linklist_stack.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_sort_utils.h"
#include "BLI_string.h"
#include "BKE_attribute.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_texture.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "BLT_translation.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_transform.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
#include "RE_texture.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "mesh_intern.h"
#include "bmesh_tools.h"

Go to the source code of this file.

Classes

struct  EdgeRingOpSubdProps
 
struct  BMElemSort
 

Macros

#define USE_FACE_CREATE_SEL_EXTEND
 
#define MAXSLOPE   100000
 
#define WM_MODALKEY(_id)
 

Functions

Edge Ring Subdivide Operator

Bridge code shares props.

static void mesh_operator_edgering_props (wmOperatorType *ot, const int cuts_min, const int cuts_default)
 
static void mesh_operator_edgering_props_get (wmOperator *op, struct EdgeRingOpSubdProps *op_props)
 
static int edbm_subdivide_edge_ring_exec (bContext *C, wmOperator *op)
 
void MESH_OT_subdivide_edgering (wmOperatorType *ot)
 
Un-Subdivide Operator
static int edbm_unsubdivide_exec (bContext *C, wmOperator *op)
 
void MESH_OT_unsubdivide (wmOperatorType *ot)
 
Delete Loose Operator
static bool bm_face_is_loose (BMFace *f)
 
static int edbm_delete_loose_exec (bContext *C, wmOperator *op)
 
void MESH_OT_delete_loose (wmOperatorType *ot)
 
Collapse Edge Operator
static int edbm_collapse_edge_exec (bContext *C, wmOperator *op)
 
void MESH_OT_edge_collapse (wmOperatorType *ot)
 
Create Edge/Face Operator
static bool edbm_add_edge_face__smooth_get (BMesh *bm)
 
static int edbm_add_edge_face_exec__vert_edge_lookup (BMVert *v, BMEdge *e_used, BMEdge **e_arr, const int e_arr_len, bool(*func)(const BMEdge *))
 
static BMElemedbm_add_edge_face_exec__tricky_extend_sel (BMesh *bm)
 
static void edbm_add_edge_face_exec__tricky_finalize_sel (BMesh *bm, BMElem *ele_desel, BMFace *f)
 
static int edbm_add_edge_face_exec (bContext *C, wmOperator *op)
 
void MESH_OT_edge_face_add (wmOperatorType *ot)
 
Mark Edge (Seam) Operator
static int edbm_mark_seam_exec (bContext *C, wmOperator *op)
 
void MESH_OT_mark_seam (wmOperatorType *ot)
 
Mark Edge (Sharp) Operator
static int edbm_mark_sharp_exec (bContext *C, wmOperator *op)
 
void MESH_OT_mark_sharp (wmOperatorType *ot)
 
Connect Vertex Path Operator
static bool edbm_connect_vert_pair (BMEditMesh *em, struct Mesh *me, wmOperator *op)
 
static int edbm_vert_connect_exec (bContext *C, wmOperator *op)
 
void MESH_OT_vert_connect (wmOperatorType *ot)
 
static bool bm_vert_is_select_history_open (BMesh *bm)
 
static bool bm_vert_connect_pair (BMesh *bm, BMVert *v_a, BMVert *v_b)
 
static bool bm_vert_connect_select_history (BMesh *bm)
 
static bool bm_vert_connect_select_history_edge_to_vert_path (BMesh *bm, ListBase *r_selected)
 
static int edbm_vert_connect_path_exec (bContext *C, wmOperator *op)
 
void MESH_OT_vert_connect_path (wmOperatorType *ot)
 
Connect Concave Operator
static int edbm_vert_connect_concave_exec (bContext *C, wmOperator *op)
 
void MESH_OT_vert_connect_concave (wmOperatorType *ot)
 
Split Non-Planar Faces Operator
static int edbm_vert_connect_nonplaner_exec (bContext *C, wmOperator *op)
 
void MESH_OT_vert_connect_nonplanar (wmOperatorType *ot)
 
Make Planar Faces Operator
static int edbm_face_make_planar_exec (bContext *C, wmOperator *op)
 
void MESH_OT_face_make_planar (wmOperatorType *ot)
 
Split Edge Operator
static bool edbm_edge_split_selected_edges (wmOperator *op, Object *obedit, BMEditMesh *em)
 
static bool edbm_edge_split_selected_verts (wmOperator *op, Object *obedit, BMEditMesh *em)
 
static int edbm_edge_split_exec (bContext *C, wmOperator *op)
 
void MESH_OT_edge_split (wmOperatorType *ot)
 
Duplicate Operator
static int edbm_duplicate_exec (bContext *C, wmOperator *op)
 
static int edbm_duplicate_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void MESH_OT_duplicate (wmOperatorType *ot)
 
static BMLoopNorEditDataArrayflip_custom_normals_init_data (BMesh *bm)
 
static bool flip_custom_normals (BMesh *bm, BMLoopNorEditDataArray *lnors_ed_arr)
 
Flip Normals Operator
static void edbm_flip_normals_custom_loop_normals (Object *obedit, BMEditMesh *em)
 
static void edbm_flip_normals_face_winding (wmOperator *op, Object *obedit, BMEditMesh *em)
 
static int edbm_flip_normals_exec (bContext *C, wmOperator *op)
 
void MESH_OT_flip_normals (wmOperatorType *ot)
 
Rotate Edge Operator
static int edbm_edge_rotate_selected_exec (bContext *C, wmOperator *op)
 
void MESH_OT_edge_rotate (wmOperatorType *ot)
 
Hide Operator
static int edbm_hide_exec (bContext *C, wmOperator *op)
 
void MESH_OT_hide (wmOperatorType *ot)
 
Reveal Operator
static int edbm_reveal_exec (bContext *C, wmOperator *op)
 
void MESH_OT_reveal (wmOperatorType *ot)
 
Recalculate Normals Operator
static int edbm_normals_make_consistent_exec (bContext *C, wmOperator *op)
 
void MESH_OT_normals_make_consistent (wmOperatorType *ot)
 
Smooth Vertices Operator
static int edbm_do_smooth_vertex_exec (bContext *C, wmOperator *op)
 
void MESH_OT_vertices_smooth (wmOperatorType *ot)
 
Laplacian Smooth Vertices Operator
static int edbm_do_smooth_laplacian_vertex_exec (bContext *C, wmOperator *op)
 
void MESH_OT_vertices_smooth_laplacian (wmOperatorType *ot)
 
Set Faces Smooth Shading Operator
static void mesh_set_smooth_faces (BMEditMesh *em, short smooth)
 
static int edbm_faces_shade_smooth_exec (bContext *C, wmOperator *UNUSED(op))
 
void MESH_OT_faces_shade_smooth (wmOperatorType *ot)
 
Set Faces Flat Shading Operator
static int edbm_faces_shade_flat_exec (bContext *C, wmOperator *UNUSED(op))
 
void MESH_OT_faces_shade_flat (wmOperatorType *ot)
 
UV/Color Rotate/Reverse Operator
static int edbm_rotate_uvs_exec (bContext *C, wmOperator *op)
 
static int edbm_reverse_uvs_exec (bContext *C, wmOperator *op)
 
static int edbm_rotate_colors_exec (bContext *C, wmOperator *op)
 
static int edbm_reverse_colors_exec (bContext *C, wmOperator *op)
 
void MESH_OT_uvs_rotate (wmOperatorType *ot)
 
void MESH_OT_uvs_reverse (wmOperatorType *ot)
 
void MESH_OT_colors_rotate (wmOperatorType *ot)
 
void MESH_OT_colors_reverse (wmOperatorType *ot)
 
Merge By Distance Operator
static int edbm_remove_doubles_exec (bContext *C, wmOperator *op)
 
void MESH_OT_remove_doubles (wmOperatorType *ot)
 
Shape Key Propagate Operator
static bool shape_propagate (BMEditMesh *em)
 
static int edbm_shape_propagate_to_all_exec (bContext *C, wmOperator *op)
 
void MESH_OT_shape_propagate_to_all (wmOperatorType *ot)
 
Blend from Shape Operator
static int edbm_blend_from_shape_exec (bContext *C, wmOperator *op)
 
static const EnumPropertyItemshape_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
static void edbm_blend_from_shape_ui (bContext *C, wmOperator *op)
 
void MESH_OT_blend_from_shape (wmOperatorType *ot)
 
Solidify Mesh Operator
static int edbm_solidify_exec (bContext *C, wmOperator *op)
 
void MESH_OT_solidify (wmOperatorType *ot)
 
Triangle Fill Operator
static int edbm_fill_exec (bContext *C, wmOperator *op)
 
void MESH_OT_fill (wmOperatorType *ot)
 
Grid Fill Operator
static bool bm_edge_test_fill_grid_cb (BMEdge *e, void *UNUSED(bm_v))
 
static float edbm_fill_grid_vert_tag_angle (BMVert *v)
 
static bool edbm_fill_grid_prepare (BMesh *bm, int offset, int *span_p, const bool span_calc)
 
static int edbm_fill_grid_exec (bContext *C, wmOperator *op)
 
void MESH_OT_fill_grid (wmOperatorType *ot)
 
Hole Fill Operator
static int edbm_fill_holes_exec (bContext *C, wmOperator *op)
 
void MESH_OT_fill_holes (wmOperatorType *ot)
 
Beauty Fill Operator
static int edbm_beautify_fill_exec (bContext *C, wmOperator *op)
 
void MESH_OT_beautify_fill (wmOperatorType *ot)
 
Poke Face Operator
static int edbm_poke_face_exec (bContext *C, wmOperator *op)
 
void MESH_OT_poke (wmOperatorType *ot)
 
Triangulate Face Operator
static int edbm_quads_convert_to_tris_exec (bContext *C, wmOperator *op)
 
void MESH_OT_quads_convert_to_tris (wmOperatorType *ot)
 
Convert to Quads Operator
static int edbm_tris_convert_to_quads_exec (bContext *C, wmOperator *op)
 
static void join_triangle_props (wmOperatorType *ot)
 
void MESH_OT_tris_convert_to_quads (wmOperatorType *ot)
 
Decimate Operator
Note
The function to decimate is intended for use as a modifier, while its handy allow access as a tool - this does cause access to be a little awkward (passing selection as weights for eg).
static int edbm_decimate_exec (bContext *C, wmOperator *op)
 
static bool edbm_decimate_check (bContext *UNUSED(C), wmOperator *UNUSED(op))
 
static void edbm_decimate_ui (bContext *UNUSED(C), wmOperator *op)
 
void MESH_OT_decimate (wmOperatorType *ot)
 
Dissolve Vertices Operator
static void edbm_dissolve_prop__use_verts (wmOperatorType *ot, bool value, int flag)
 
static void edbm_dissolve_prop__use_face_split (wmOperatorType *ot)
 
static void edbm_dissolve_prop__use_boundary_tear (wmOperatorType *ot)
 
static int edbm_dissolve_verts_exec (bContext *C, wmOperator *op)
 
void MESH_OT_dissolve_verts (wmOperatorType *ot)
 
Dissolve Edges Operator
static int edbm_dissolve_edges_exec (bContext *C, wmOperator *op)
 
void MESH_OT_dissolve_edges (wmOperatorType *ot)
 
Dissolve Faces Operator
static int edbm_dissolve_faces_exec (bContext *C, wmOperator *op)
 
void MESH_OT_dissolve_faces (wmOperatorType *ot)
 
Dissolve (Context Sensitive) Operator
static int edbm_dissolve_mode_exec (bContext *C, wmOperator *op)
 
void MESH_OT_dissolve_mode (wmOperatorType *ot)
 
Limited Dissolve Operator
static int edbm_dissolve_limited_exec (bContext *C, wmOperator *op)
 
void MESH_OT_dissolve_limited (wmOperatorType *ot)
 
Degenerate Dissolve Operator
static int edbm_dissolve_degenerate_exec (bContext *C, wmOperator *op)
 
void MESH_OT_dissolve_degenerate (wmOperatorType *ot)
 
Delete Edge-Loop Operator
static int edbm_delete_edgeloop_exec (bContext *C, wmOperator *op)
 
void MESH_OT_delete_edgeloop (wmOperatorType *ot)
 
Split Geometry Operator
static int edbm_split_exec (bContext *C, wmOperator *op)
 
void MESH_OT_split (wmOperatorType *ot)
 
Wire-Frame Operator
static int edbm_wireframe_exec (bContext *C, wmOperator *op)
 
void MESH_OT_wireframe (wmOperatorType *ot)
 
Offset Edge-Loop Operator
static int edbm_offset_edgeloop_exec (bContext *C, wmOperator *op)
 
void MESH_OT_offset_edge_loops (wmOperatorType *ot)
 
Symmetrize Operator
static int mesh_symmetrize_exec (bContext *C, wmOperator *op)
 
void MESH_OT_symmetrize (struct wmOperatorType *ot)
 
Snap to Symmetry Operator
static int mesh_symmetry_snap_exec (bContext *C, wmOperator *op)
 
void MESH_OT_symmetry_snap (struct wmOperatorType *ot)
 
Split/Merge Loop Normals Operator
static void normals_merge (BMesh *bm, BMLoopNorEditDataArray *lnors_ed_arr)
 
static void normals_split (BMesh *bm)
 
static int normals_split_merge (bContext *C, const bool do_merge)
 
static int edbm_merge_normals_exec (bContext *C, wmOperator *UNUSED(op))
 
void MESH_OT_merge_normals (struct wmOperatorType *ot)
 
static int edbm_split_normals_exec (bContext *C, wmOperator *UNUSED(op))
 
void MESH_OT_split_normals (struct wmOperatorType *ot)
 
Set Normals from Faces Operator
static int edbm_set_normals_from_faces_exec (bContext *C, wmOperator *op)
 
void MESH_OT_set_normals_from_faces (struct wmOperatorType *ot)
 
Smooth Normal Vectors Operator
static int edbm_smooth_normals_exec (bContext *C, wmOperator *op)
 
void MESH_OT_smooth_normals (struct wmOperatorType *ot)
 

Knife Subdivide Operator

#define KNIFE_EXACT   1
 
#define KNIFE_MIDPOINT   2
 
#define KNIFE_MULTICUT   3
 
#define ELE_EDGE_CUT   1
 
static const EnumPropertyItem knife_items []
 
static float bm_edge_seg_isect (const float sco_a[2], const float sco_b[2], float(*mouse_path)[2], int len, char mode, int *isected)
 
static int edbm_knife_cut_exec (bContext *C, wmOperator *op)
 
void MESH_OT_knife_cut (wmOperatorType *ot)
 

Loop Normals Editing Tools Modal Map

#define CLNORS_VALID_VEC_LEN   (1e-4f)
 
enum  {
  EDBM_CLNOR_MODAL_CANCEL = 1 , EDBM_CLNOR_MODAL_CONFIRM = 2 , EDBM_CLNOR_MODAL_POINTTO_RESET = 101 , EDBM_CLNOR_MODAL_POINTTO_INVERT = 102 ,
  EDBM_CLNOR_MODAL_POINTTO_SPHERIZE = 103 , EDBM_CLNOR_MODAL_POINTTO_ALIGN = 104 , EDBM_CLNOR_MODAL_POINTTO_USE_MOUSE = 110 , EDBM_CLNOR_MODAL_POINTTO_USE_PIVOT = 111 ,
  EDBM_CLNOR_MODAL_POINTTO_USE_OBJECT = 112 , EDBM_CLNOR_MODAL_POINTTO_SET_USE_3DCURSOR = 113 , EDBM_CLNOR_MODAL_POINTTO_SET_USE_SELECTED = 114
}
 
wmKeyMappoint_normals_modal_keymap (wmKeyConfig *keyconf)
 

Delete Operator

enum  {
  MESH_DELETE_VERT = 0 , MESH_DELETE_EDGE = 1 , MESH_DELETE_FACE = 2 , MESH_DELETE_EDGE_FACE = 3 ,
  MESH_DELETE_ONLY_FACE = 4
}
 
static void edbm_report_delete_info (ReportList *reports, const int totelem_old[3], const int totelem_new[3])
 
static int edbm_delete_exec (bContext *C, wmOperator *op)
 
void MESH_OT_delete (wmOperatorType *ot)
 

Merge Vertices Operator

enum  {
  MESH_MERGE_LAST = 1 , MESH_MERGE_CENTER = 3 , MESH_MERGE_CURSOR = 4 , MESH_MERGE_COLLAPSE = 5 ,
  MESH_MERGE_FIRST = 6
}
 
static const EnumPropertyItem merge_type_items []
 
static bool merge_firstlast (BMEditMesh *em, const bool use_first, const bool use_uvmerge, wmOperator *wmop)
 
static bool merge_target (BMEditMesh *em, Scene *scene, Object *ob, const bool use_cursor, const bool use_uvmerge, wmOperator *wmop)
 
static int edbm_merge_exec (bContext *C, wmOperator *op)
 
static const EnumPropertyItemmerge_type_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
void MESH_OT_merge (wmOperatorType *ot)
 

Separate Parts Operator

enum  { MESH_SEPARATE_SELECTED = 0 , MESH_SEPARATE_MATERIAL = 1 , MESH_SEPARATE_LOOSE = 2 }
 
static Basemesh_separate_tagged (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old)
 
static Basemesh_separate_arrays (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old, BMVert **verts, uint verts_len, BMEdge **edges, uint edges_len, BMFace **faces, uint faces_len)
 
static bool mesh_separate_selected (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old)
 
static void mesh_separate_material_assign_mat_nr (Main *bmain, Object *ob, const short mat_nr)
 
static bool mesh_separate_material (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old)
 
static bool mesh_separate_loose (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base_old, BMesh *bm_old)
 
static int edbm_separate_exec (bContext *C, wmOperator *op)
 
void MESH_OT_separate (wmOperatorType *ot)
 

Sort Geometry Elements Operator

Unified for vertices/edges/faces.

enum  {
  SRT_VIEW_ZAXIS = 1 , SRT_VIEW_XAXIS , SRT_CURSOR_DISTANCE , SRT_MATERIAL ,
  SRT_SELECTED , SRT_RANDOMIZE , SRT_REVERSE
}
 
typedef struct BMElemSort BMElemSort
 
static int bmelemsort_comp (const void *v1, const void *v2)
 
static void sort_bmelem_flag (bContext *C, Scene *scene, Object *ob, RegionView3D *rv3d, const int types, const int flag, const int action, const int reverse, const uint seed)
 
static int edbm_sort_elements_exec (bContext *C, wmOperator *op)
 
static bool edbm_sort_elements_poll_property (const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
 
void MESH_OT_sort_elements (wmOperatorType *ot)
 

Bridge Operator

enum  { MESH_BRIDGELOOP_SINGLE = 0 , MESH_BRIDGELOOP_CLOSED = 1 , MESH_BRIDGELOOP_PAIRS = 2 }
 
static int edbm_bridge_tag_boundary_edges (BMesh *bm)
 
static int edbm_bridge_edge_loops_for_single_editmesh (wmOperator *op, BMEditMesh *em, struct Mesh *me, const bool use_pairs, const bool use_cyclic, const bool use_merge, const float merge_factor, const int twist_offset)
 
static int edbm_bridge_edge_loops_exec (bContext *C, wmOperator *op)
 
void MESH_OT_bridge_edge_loops (wmOperatorType *ot)
 

Loop Normals 'Point To' Operator

enum  { EDBM_CLNOR_POINTTO_MODE_COORDINATES = 1 , EDBM_CLNOR_POINTTO_MODE_MOUSE = 2 }
 
static EnumPropertyItem clnors_pointto_mode_items []
 
static bool point_normals_init (bContext *C, wmOperator *op)
 
static bool point_normals_ensure (bContext *C, wmOperator *op)
 
static void point_normals_free (wmOperator *op)
 
static void point_normals_cancel (bContext *C, wmOperator *op)
 
static void point_normals_update_header (bContext *C, wmOperator *op)
 
static void bmesh_selected_verts_center_calc (BMesh *bm, float *r_center)
 
static void point_normals_apply (bContext *C, wmOperator *op, float target[3], const bool do_reset)
 
static int edbm_point_normals_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int edbm_point_normals_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static int edbm_point_normals_exec (bContext *C, wmOperator *op)
 
static bool point_normals_draw_check_prop (PointerRNA *ptr, PropertyRNA *prop, void *UNUSED(user_data))
 
static void edbm_point_normals_ui (bContext *C, wmOperator *op)
 
void MESH_OT_point_normals (struct wmOperatorType *ot)
 

Average Loop Normals Operator

enum  { EDBM_CLNOR_AVERAGE_LOOP = 1 , EDBM_CLNOR_AVERAGE_FACE_AREA = 2 , EDBM_CLNOR_AVERAGE_ANGLE = 3 }
 
static EnumPropertyItem average_method_items []
 
static int edbm_average_normals_exec (bContext *C, wmOperator *op)
 
static bool average_normals_draw_check_prop (PointerRNA *ptr, PropertyRNA *prop, void *UNUSED(user_data))
 
static void edbm_average_normals_ui (bContext *C, wmOperator *op)
 
void MESH_OT_average_normals (struct wmOperatorType *ot)
 

Custom Normal Interface Tools Operator

enum  {
  EDBM_CLNOR_TOOLS_COPY = 1 , EDBM_CLNOR_TOOLS_PASTE = 2 , EDBM_CLNOR_TOOLS_MULTIPLY = 3 , EDBM_CLNOR_TOOLS_ADD = 4 ,
  EDBM_CLNOR_TOOLS_RESET = 5
}
 
static EnumPropertyItem normal_vector_tool_items []
 
static int edbm_normals_tools_exec (bContext *C, wmOperator *op)
 
static bool normals_tools_draw_check_prop (PointerRNA *ptr, PropertyRNA *prop, void *UNUSED(user_data))
 
static void edbm_normals_tools_ui (bContext *C, wmOperator *op)
 
void MESH_OT_normals_tools (struct wmOperatorType *ot)
 

Subdivide Operator

static const EnumPropertyItem prop_mesh_cornervert_types []
 
static int edbm_subdivide_exec (bContext *C, wmOperator *op)
 
void MESH_OT_subdivide (wmOperatorType *ot)
 

Weighted Normal Modifier Face Strength

static const EnumPropertyItem prop_mesh_face_strength_types []
 
static int edbm_mod_weighted_strength_exec (bContext *C, wmOperator *op)
 
void MESH_OT_mod_weighted_strength (struct wmOperatorType *ot)
 

Macro Definition Documentation

◆ CLNORS_VALID_VEC_LEN

#define CLNORS_VALID_VEC_LEN   (1e-4f)

Definition at line 8315 of file editmesh_tools.c.

◆ ELE_EDGE_CUT

#define ELE_EDGE_CUT   1

Definition at line 4194 of file editmesh_tools.c.

◆ KNIFE_EXACT

#define KNIFE_EXACT   1

Definition at line 4014 of file editmesh_tools.c.

◆ KNIFE_MIDPOINT

#define KNIFE_MIDPOINT   2

Definition at line 4015 of file editmesh_tools.c.

◆ KNIFE_MULTICUT

#define KNIFE_MULTICUT   3

Definition at line 4016 of file editmesh_tools.c.

◆ MAXSLOPE

#define MAXSLOPE   100000

◆ USE_FACE_CREATE_SEL_EXTEND

#define USE_FACE_CREATE_SEL_EXTEND

Definition at line 76 of file editmesh_tools.c.

◆ WM_MODALKEY

#define WM_MODALKEY (   _id)
Value:
op->type, (_id), true, UI_MAX_SHORTCUT_STR, &available_len, &p)
#define UI_MAX_SHORTCUT_STR
Definition: UI_interface.h:93
char * WM_modalkeymap_operator_items_to_string_buf(wmOperatorType *ot, const int propvalue, const bool compact, const int max_len, int *r_available_len, char **r_result)
Definition: wm_keymap.c:1270

Typedef Documentation

◆ BMElemSort

typedef struct BMElemSort BMElemSort

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MESH_DELETE_VERT 
MESH_DELETE_EDGE 
MESH_DELETE_FACE 
MESH_DELETE_EDGE_FACE 
MESH_DELETE_ONLY_FACE 

Definition at line 425 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
MESH_MERGE_LAST 
MESH_MERGE_CENTER 
MESH_MERGE_CURSOR 
MESH_MERGE_COLLAPSE 
MESH_MERGE_FIRST 

Definition at line 3259 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
MESH_SEPARATE_SELECTED 
MESH_SEPARATE_MATERIAL 
MESH_SEPARATE_LOOSE 

Definition at line 4358 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
SRT_VIEW_ZAXIS 

Use view Z (deep) axis.

SRT_VIEW_XAXIS 

Use view X (left to right) axis.

SRT_CURSOR_DISTANCE 

Use distance from element to 3D cursor.

SRT_MATERIAL 

Face only: use mat number.

SRT_SELECTED 

Move selected elements in first, without modifying relative order of selected and unselected elements.

SRT_RANDOMIZE 

Randomize selected elements.

SRT_REVERSE 

Reverse current order of selected elements.

Definition at line 6562 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
MESH_BRIDGELOOP_SINGLE 
MESH_BRIDGELOOP_CLOSED 
MESH_BRIDGELOOP_PAIRS 

Definition at line 7227 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
EDBM_CLNOR_MODAL_CANCEL 
EDBM_CLNOR_MODAL_CONFIRM 
EDBM_CLNOR_MODAL_POINTTO_RESET 
EDBM_CLNOR_MODAL_POINTTO_INVERT 
EDBM_CLNOR_MODAL_POINTTO_SPHERIZE 
EDBM_CLNOR_MODAL_POINTTO_ALIGN 
EDBM_CLNOR_MODAL_POINTTO_USE_MOUSE 
EDBM_CLNOR_MODAL_POINTTO_USE_PIVOT 
EDBM_CLNOR_MODAL_POINTTO_USE_OBJECT 
EDBM_CLNOR_MODAL_POINTTO_SET_USE_3DCURSOR 
EDBM_CLNOR_MODAL_POINTTO_SET_USE_SELECTED 

Definition at line 8234 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
EDBM_CLNOR_POINTTO_MODE_COORDINATES 
EDBM_CLNOR_POINTTO_MODE_MOUSE 

Definition at line 8323 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
EDBM_CLNOR_AVERAGE_LOOP 
EDBM_CLNOR_AVERAGE_FACE_AREA 
EDBM_CLNOR_AVERAGE_ANGLE 

Definition at line 9057 of file editmesh_tools.c.

◆ anonymous enum

anonymous enum
Enumerator
EDBM_CLNOR_TOOLS_COPY 
EDBM_CLNOR_TOOLS_PASTE 
EDBM_CLNOR_TOOLS_MULTIPLY 
EDBM_CLNOR_TOOLS_ADD 
EDBM_CLNOR_TOOLS_RESET 

Definition at line 9305 of file editmesh_tools.c.

Function Documentation

◆ average_normals_draw_check_prop()

static bool average_normals_draw_check_prop ( PointerRNA ptr,
PropertyRNA prop,
void UNUSEDuser_data 
)
static

◆ bm_edge_seg_isect()

static float bm_edge_seg_isect ( const float  sco_a[2],
const float  sco_b[2],
float(*)  mouse_path[2],
int  len,
char  mode,
int *  isected 
)
static

Definition at line 4027 of file editmesh_tools.c.

References KNIFE_MULTICUT, len, max_ff(), MAXSLOPE, min_ff(), and threshold.

Referenced by edbm_knife_cut_exec().

◆ bm_edge_test_fill_grid_cb()

static bool bm_edge_test_fill_grid_cb ( BMEdge e,
void UNUSEDbm_v 
)
static

Definition at line 4921 of file editmesh_tools.c.

References BM_elem_flag_test_bool, BM_ELEM_SELECT, and e.

Referenced by edbm_fill_grid_prepare().

◆ bm_face_is_loose()

static bool bm_face_is_loose ( BMFace f)
static

Definition at line 574 of file editmesh_tools.c.

References BM_edge_is_boundary(), BM_FACE_FIRST_LOOP, BMLoop::e, and BMLoop::next.

Referenced by edbm_delete_loose_exec().

◆ bm_vert_connect_pair()

static bool bm_vert_connect_pair ( BMesh bm,
BMVert v_a,
BMVert v_b 
)
static

◆ bm_vert_connect_select_history()

static bool bm_vert_connect_select_history ( BMesh bm)
static

◆ bm_vert_connect_select_history_edge_to_vert_path()

static bool bm_vert_connect_select_history_edge_to_vert_path ( BMesh bm,
ListBase r_selected 
)
static

◆ bm_vert_is_select_history_open()

static bool bm_vert_is_select_history_open ( BMesh bm)
static

check that endpoints are verts and only have a single selected edge connected.

Definition at line 1357 of file editmesh_tools.c.

References bm, BM_EDGES_OF_VERT, BM_ELEM_SELECT, BM_iter_elem_count_flag(), BM_VERT, BMEditSelection::ele, ListBase::first, BMEditSelection::htype, ListBase::last, and BMesh::selected.

Referenced by bm_vert_connect_select_history().

◆ bmelemsort_comp()

static int bmelemsort_comp ( const void v1,
const void v2 
)
static

Definition at line 6587 of file editmesh_tools.c.

References BMElemSort::srt, v1, v2, and x2.

Referenced by sort_bmelem_flag().

◆ bmesh_selected_verts_center_calc()

static void bmesh_selected_verts_center_calc ( BMesh bm,
float r_center 
)
static

◆ edbm_add_edge_face__smooth_get()

static bool edbm_add_edge_face__smooth_get ( BMesh bm)
static

◆ edbm_add_edge_face_exec()

static int edbm_add_edge_face_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_add_edge_face_exec__tricky_extend_sel()

static BMElem* edbm_add_edge_face_exec__tricky_extend_sel ( BMesh bm)
static

◆ edbm_add_edge_face_exec__tricky_finalize_sel()

static void edbm_add_edge_face_exec__tricky_finalize_sel ( BMesh bm,
BMElem ele_desel,
BMFace f 
)
static

◆ edbm_add_edge_face_exec__vert_edge_lookup()

static int edbm_add_edge_face_exec__vert_edge_lookup ( BMVert v,
BMEdge e_used,
BMEdge **  e_arr,
const int  e_arr_len,
bool(*)(const BMEdge *)  func 
)
static

Function used to get a fixed number of edges linked to a vertex that passes a test function. This is used so we can request all boundary edges connected to a vertex for eg.

Definition at line 770 of file editmesh_tools.c.

References BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ITER_ELEM, NULL, and v.

Referenced by edbm_add_edge_face_exec__tricky_extend_sel().

◆ edbm_average_normals_exec()

static int edbm_average_normals_exec ( bContext C,
wmOperator op 
)
static

Definition at line 9082 of file editmesh_tools.c.

References add_v3_v3(), BKE_editmesh_ensure_autosmooth(), BKE_editmesh_from_object(), BKE_editmesh_lnorspace_update(), BKE_lnor_space_custom_data_to_normal(), BKE_lnor_space_custom_normal_to_data(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BLI_assert, BLI_heapsimple_free(), BLI_heapsimple_insert(), BLI_heapsimple_is_empty(), BLI_heapsimple_new(), BLI_heapsimple_pop_min(), BLI_heapsimple_top_value(), BLI_SMALLSTACK_DECLARE, BLI_SMALLSTACK_IS_EMPTY, BLI_SMALLSTACK_POP, BLI_SMALLSTACK_PUSH, BMEditMesh::bm, bm, BM_ELEM_CD_GET_VOID_P, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_SELECT, BM_ELEM_TAG, BM_face_calc_area(), BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_calc_face_angle(), BM_loop_check_cyclic_smooth_fan(), BM_normals_loops_edges_tag(), BM_SPACEARR_DIRTY_ALL, BM_vert_step_fan_loop(), C, CD_CUSTOMLOOPNORMAL, CLNORS_VALID_VEC_LEN, compare_ff(), copy_v3_v3(), count, CTX_data_view_layer(), CTX_wm_view3d(), CustomData_get_offset(), Object::data, BMLoop::e, EDBM_CLNOR_AVERAGE_ANGLE, EDBM_CLNOR_AVERAGE_FACE_AREA, EDBM_CLNOR_AVERAGE_LOOP, EDBM_update(), BMLoop::f, float(), l, BMesh::ldata, BMesh::lnor_spacearr, MLoopNorSpaceArray::lspacearr, MEM_freeN, mul_v3_fl(), BMLoop::next, BMFace::no, normalize_v3(), NULL, OPERATOR_FINISHED, pow(), BMLoop::prev, wmOperator::ptr, RNA_enum_get(), RNA_float_get(), RNA_int_get(), BMesh::spacearr_dirty, threshold, UNUSED_VARS_NDEBUG, BMLoop::v, and zero_v3().

Referenced by MESH_OT_average_normals().

◆ edbm_average_normals_ui()

static void edbm_average_normals_ui ( bContext C,
wmOperator op 
)
static

◆ edbm_beautify_fill_exec()

static int edbm_beautify_fill_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_blend_from_shape_exec()

static int edbm_blend_from_shape_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_blend_from_shape_ui()

static void edbm_blend_from_shape_ui ( bContext C,
wmOperator op 
)
static

◆ edbm_bridge_edge_loops_exec()

static int edbm_bridge_edge_loops_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_bridge_edge_loops_for_single_editmesh()

static int edbm_bridge_edge_loops_for_single_editmesh ( wmOperator op,
BMEditMesh em,
struct Mesh me,
const bool  use_pairs,
const bool  use_cyclic,
const bool  use_merge,
const float  merge_factor,
const int  twist_offset 
)
static

◆ edbm_bridge_tag_boundary_edges()

static int edbm_bridge_tag_boundary_edges ( BMesh bm)
static

◆ edbm_collapse_edge_exec()

static int edbm_collapse_edge_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_connect_vert_pair()

static bool edbm_connect_vert_pair ( BMEditMesh em,
struct Mesh me,
wmOperator op 
)
static

◆ edbm_decimate_check()

static bool edbm_decimate_check ( bContext UNUSEDC,
wmOperator UNUSEDop 
)
static

Definition at line 5857 of file editmesh_tools.c.

Referenced by MESH_OT_decimate().

◆ edbm_decimate_exec()

static int edbm_decimate_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_decimate_ui()

static void edbm_decimate_ui ( bContext UNUSEDC,
wmOperator op 
)
static

◆ edbm_delete_edgeloop_exec()

static int edbm_delete_edgeloop_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_delete_exec()

static int edbm_delete_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_delete_loose_exec()

static int edbm_delete_loose_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_dissolve_degenerate_exec()

static int edbm_dissolve_degenerate_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_dissolve_edges_exec()

static int edbm_dissolve_edges_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_dissolve_faces_exec()

static int edbm_dissolve_faces_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_dissolve_limited_exec()

static int edbm_dissolve_limited_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_dissolve_mode_exec()

static int edbm_dissolve_mode_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_dissolve_prop__use_boundary_tear()

static void edbm_dissolve_prop__use_boundary_tear ( wmOperatorType ot)
static

Definition at line 5949 of file editmesh_tools.c.

References ot, RNA_def_boolean(), and wmOperatorType::srna.

Referenced by MESH_OT_dissolve_mode(), and MESH_OT_dissolve_verts().

◆ edbm_dissolve_prop__use_face_split()

static void edbm_dissolve_prop__use_face_split ( wmOperatorType ot)
static

◆ edbm_dissolve_prop__use_verts()

static void edbm_dissolve_prop__use_verts ( wmOperatorType ot,
bool  value,
int  flag 
)
static

◆ edbm_dissolve_verts_exec()

static int edbm_dissolve_verts_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_do_smooth_laplacian_vertex_exec()

static int edbm_do_smooth_laplacian_vertex_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_do_smooth_vertex_exec()

static int edbm_do_smooth_vertex_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_duplicate_exec()

static int edbm_duplicate_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_duplicate_invoke()

static int edbm_duplicate_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

Definition at line 2068 of file editmesh_tools.c.

References C, edbm_duplicate_exec(), and WM_cursor_wait().

Referenced by MESH_OT_duplicate().

◆ edbm_edge_rotate_selected_exec()

static int edbm_edge_rotate_selected_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_edge_split_exec()

static int edbm_edge_split_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_edge_split_selected_edges()

static bool edbm_edge_split_selected_edges ( wmOperator op,
Object obedit,
BMEditMesh em 
)
static

◆ edbm_edge_split_selected_verts()

static bool edbm_edge_split_selected_verts ( wmOperator op,
Object obedit,
BMEditMesh em 
)
static

◆ edbm_face_make_planar_exec()

static int edbm_face_make_planar_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_faces_shade_flat_exec()

static int edbm_faces_shade_flat_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ edbm_faces_shade_smooth_exec()

static int edbm_faces_shade_smooth_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ edbm_fill_exec()

static int edbm_fill_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_fill_grid_exec()

static int edbm_fill_grid_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_fill_grid_prepare()

static bool edbm_fill_grid_prepare ( BMesh bm,
int  offset,
int *  span_p,
const bool  span_calc 
)
static

◆ edbm_fill_grid_vert_tag_angle()

static float edbm_fill_grid_vert_tag_angle ( BMVert v)
static

◆ edbm_fill_holes_exec()

static int edbm_fill_holes_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_flip_normals_custom_loop_normals()

static void edbm_flip_normals_custom_loop_normals ( Object obedit,
BMEditMesh em 
)
static

◆ edbm_flip_normals_exec()

static int edbm_flip_normals_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_flip_normals_face_winding()

static void edbm_flip_normals_face_winding ( wmOperator op,
Object obedit,
BMEditMesh em 
)
static

◆ edbm_hide_exec()

static int edbm_hide_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_knife_cut_exec()

static int edbm_knife_cut_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_mark_seam_exec()

static int edbm_mark_seam_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_mark_sharp_exec()

static int edbm_mark_sharp_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_merge_exec()

static int edbm_merge_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_merge_normals_exec()

static int edbm_merge_normals_exec ( bContext C,
wmOperator UNUSEDop 
)
static

Definition at line 9011 of file editmesh_tools.c.

References C, and normals_split_merge().

Referenced by MESH_OT_merge_normals().

◆ edbm_mod_weighted_strength_exec()

static int edbm_mod_weighted_strength_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_normals_make_consistent_exec()

static int edbm_normals_make_consistent_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_normals_tools_exec()

static int edbm_normals_tools_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_normals_tools_ui()

static void edbm_normals_tools_ui ( bContext C,
wmOperator op 
)
static

◆ edbm_offset_edgeloop_exec()

static int edbm_offset_edgeloop_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_point_normals_exec()

static int edbm_point_normals_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_point_normals_invoke()

static int edbm_point_normals_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ edbm_point_normals_modal()

static int edbm_point_normals_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

Definition at line 8488 of file editmesh_tools.c.

References add_v3_v3(), BKE_editmesh_from_object(), BKE_report(), BMEditMesh::bm, bm, BM_elem_flag_test, BM_ELEM_SELECT, BM_ITER_MESH, BM_VERTS_OF_MESH, bmesh_selected_verts_center_calc(), C, center, BMVert::co, copy_v3_v3(), CTX_data_edit_object(), CTX_data_scene(), CTX_wm_region(), CTX_wm_view3d(), Scene::cursor, Object::data, ED_object_calc_active_center_for_editmode(), ED_view3d_cursor3d_update(), ED_view3d_win_to_3d_int(), EDBM_CLNOR_MODAL_CANCEL, EDBM_CLNOR_MODAL_CONFIRM, EDBM_CLNOR_MODAL_POINTTO_ALIGN, EDBM_CLNOR_MODAL_POINTTO_INVERT, EDBM_CLNOR_MODAL_POINTTO_RESET, EDBM_CLNOR_MODAL_POINTTO_SET_USE_3DCURSOR, EDBM_CLNOR_MODAL_POINTTO_SET_USE_SELECTED, EDBM_CLNOR_MODAL_POINTTO_SPHERIZE, EDBM_CLNOR_MODAL_POINTTO_USE_MOUSE, EDBM_CLNOR_MODAL_POINTTO_USE_OBJECT, EDBM_CLNOR_MODAL_POINTTO_USE_PIVOT, EDBM_CLNOR_POINTTO_MODE_COORDINATES, EDBM_CLNOR_POINTTO_MODE_MOUSE, EDBM_select_pick(), EDBM_update(), ELEM, EVT_MODAL_MAP, ISMOUSE_MOTION, Object::loc, View3DCursor::location, max, mid_v3_v3v3(), min, minmax_v3v3_v3(), MOUSEMOVE, wmEvent::mval, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, params, point_normals_apply(), point_normals_cancel(), point_normals_ensure(), point_normals_free(), point_normals_update_header(), wmOperator::ptr, wmOperator::reports, ret, RNA_enum_get(), RNA_enum_set(), RNA_property_boolean_get(), RNA_property_boolean_set(), RNA_property_float_get_array(), RNA_property_float_set_array(), RNA_struct_find_property(), RPT_WARNING, scene, SEL_OP_SET, Scene::toolsettings, ToolSettings::transform_pivot_point, wmOperator::type, wmEvent::type, v, V3D_AROUND_ACTIVE, V3D_AROUND_CENTER_BOUNDS, V3D_AROUND_CENTER_MEDIAN, V3D_AROUND_CURSOR, V3D_CURSOR_ORIENT_NONE, wmEvent::val, view3d_operator_needs_opengl(), WM_operator_poll(), and zero_v3().

Referenced by MESH_OT_point_normals().

◆ edbm_point_normals_ui()

static void edbm_point_normals_ui ( bContext C,
wmOperator op 
)
static

◆ edbm_poke_face_exec()

static int edbm_poke_face_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_quads_convert_to_tris_exec()

static int edbm_quads_convert_to_tris_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_remove_doubles_exec()

static int edbm_remove_doubles_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_report_delete_info()

static void edbm_report_delete_info ( ReportList reports,
const int  totelem_old[3],
const int  totelem_new[3] 
)
static

Definition at line 433 of file editmesh_tools.c.

References BKE_reportf(), and RPT_INFO.

Referenced by edbm_delete_loose_exec(), and edbm_dissolve_degenerate_exec().

◆ edbm_reveal_exec()

static int edbm_reveal_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_reverse_colors_exec()

static int edbm_reverse_colors_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_reverse_uvs_exec()

static int edbm_reverse_uvs_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_rotate_colors_exec()

static int edbm_rotate_colors_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_rotate_uvs_exec()

static int edbm_rotate_uvs_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_separate_exec()

static int edbm_separate_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_set_normals_from_faces_exec()

static int edbm_set_normals_from_faces_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_shape_propagate_to_all_exec()

static int edbm_shape_propagate_to_all_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_smooth_normals_exec()

static int edbm_smooth_normals_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_solidify_exec()

static int edbm_solidify_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_sort_elements_exec()

static int edbm_sort_elements_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_sort_elements_poll_property()

static bool edbm_sort_elements_poll_property ( const bContext UNUSEDC,
wmOperator op,
const PropertyRNA prop 
)
static

◆ edbm_split_exec()

static int edbm_split_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_split_normals_exec()

static int edbm_split_normals_exec ( bContext C,
wmOperator UNUSEDop 
)
static

Definition at line 9031 of file editmesh_tools.c.

References C, and normals_split_merge().

Referenced by MESH_OT_split_normals().

◆ edbm_subdivide_edge_ring_exec()

static int edbm_subdivide_edge_ring_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_subdivide_exec()

static int edbm_subdivide_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_tris_convert_to_quads_exec()

static int edbm_tris_convert_to_quads_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_unsubdivide_exec()

static int edbm_unsubdivide_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_vert_connect_concave_exec()

static int edbm_vert_connect_concave_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_vert_connect_exec()

static int edbm_vert_connect_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_vert_connect_nonplaner_exec()

static int edbm_vert_connect_nonplaner_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_vert_connect_path_exec()

static int edbm_vert_connect_path_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_wireframe_exec()

static int edbm_wireframe_exec ( bContext C,
wmOperator op 
)
static

◆ flip_custom_normals()

static bool flip_custom_normals ( BMesh bm,
BMLoopNorEditDataArray lnors_ed_arr 
)
static

◆ flip_custom_normals_init_data()

static BMLoopNorEditDataArray* flip_custom_normals_init_data ( BMesh bm)
static

◆ join_triangle_props()

static void join_triangle_props ( wmOperatorType ot)
static

◆ merge_firstlast()

static bool merge_firstlast ( BMEditMesh em,
const bool  use_first,
const bool  use_uvmerge,
wmOperator wmop 
)
static

◆ merge_target()

static bool merge_target ( BMEditMesh em,
Scene scene,
Object ob,
const bool  use_cursor,
const bool  use_uvmerge,
wmOperator wmop 
)
static

◆ merge_type_itemf()

static const EnumPropertyItem* merge_type_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
bool r_free 
)
static

◆ mesh_operator_edgering_props()

static void mesh_operator_edgering_props ( wmOperatorType ot,
const int  cuts_min,
const int  cuts_default 
)
static

◆ mesh_operator_edgering_props_get()

static void mesh_operator_edgering_props_get ( wmOperator op,
struct EdgeRingOpSubdProps op_props 
)
static

◆ MESH_OT_average_normals()

void MESH_OT_average_normals ( struct wmOperatorType ot)

◆ MESH_OT_beautify_fill()

void MESH_OT_beautify_fill ( wmOperatorType ot)

◆ MESH_OT_blend_from_shape()

void MESH_OT_blend_from_shape ( wmOperatorType ot)

◆ MESH_OT_bridge_edge_loops()

void MESH_OT_bridge_edge_loops ( wmOperatorType ot)

◆ MESH_OT_colors_reverse()

void MESH_OT_colors_reverse ( wmOperatorType ot)

◆ MESH_OT_colors_rotate()

void MESH_OT_colors_rotate ( wmOperatorType ot)

◆ MESH_OT_decimate()

void MESH_OT_decimate ( wmOperatorType ot)

◆ MESH_OT_delete()

void MESH_OT_delete ( wmOperatorType ot)

◆ MESH_OT_delete_edgeloop()

void MESH_OT_delete_edgeloop ( wmOperatorType ot)

◆ MESH_OT_delete_loose()

void MESH_OT_delete_loose ( wmOperatorType ot)

◆ MESH_OT_dissolve_degenerate()

void MESH_OT_dissolve_degenerate ( wmOperatorType ot)

◆ MESH_OT_dissolve_edges()

void MESH_OT_dissolve_edges ( wmOperatorType ot)

◆ MESH_OT_dissolve_faces()

void MESH_OT_dissolve_faces ( wmOperatorType ot)

◆ MESH_OT_dissolve_limited()

void MESH_OT_dissolve_limited ( wmOperatorType ot)

◆ MESH_OT_dissolve_mode()

void MESH_OT_dissolve_mode ( wmOperatorType ot)

◆ MESH_OT_dissolve_verts()

void MESH_OT_dissolve_verts ( wmOperatorType ot)

◆ MESH_OT_duplicate()

void MESH_OT_duplicate ( wmOperatorType ot)

◆ MESH_OT_edge_collapse()

void MESH_OT_edge_collapse ( wmOperatorType ot)

◆ MESH_OT_edge_face_add()

void MESH_OT_edge_face_add ( wmOperatorType ot)

◆ MESH_OT_edge_rotate()

void MESH_OT_edge_rotate ( wmOperatorType ot)

◆ MESH_OT_edge_split()

void MESH_OT_edge_split ( wmOperatorType ot)

◆ MESH_OT_face_make_planar()

void MESH_OT_face_make_planar ( wmOperatorType ot)

◆ MESH_OT_faces_shade_flat()

void MESH_OT_faces_shade_flat ( wmOperatorType ot)

◆ MESH_OT_faces_shade_smooth()

void MESH_OT_faces_shade_smooth ( wmOperatorType ot)

◆ MESH_OT_fill()

void MESH_OT_fill ( wmOperatorType ot)

◆ MESH_OT_fill_grid()

void MESH_OT_fill_grid ( wmOperatorType ot)

◆ MESH_OT_fill_holes()

void MESH_OT_fill_holes ( wmOperatorType ot)

◆ MESH_OT_flip_normals()

void MESH_OT_flip_normals ( wmOperatorType ot)

◆ MESH_OT_hide()

void MESH_OT_hide ( wmOperatorType ot)

◆ MESH_OT_knife_cut()

void MESH_OT_knife_cut ( wmOperatorType ot)

◆ MESH_OT_mark_seam()

void MESH_OT_mark_seam ( wmOperatorType ot)

◆ MESH_OT_mark_sharp()

void MESH_OT_mark_sharp ( wmOperatorType ot)

◆ MESH_OT_merge()

void MESH_OT_merge ( wmOperatorType ot)

◆ MESH_OT_merge_normals()

void MESH_OT_merge_normals ( struct wmOperatorType ot)

◆ MESH_OT_mod_weighted_strength()

void MESH_OT_mod_weighted_strength ( struct wmOperatorType ot)

◆ MESH_OT_normals_make_consistent()

void MESH_OT_normals_make_consistent ( wmOperatorType ot)

◆ MESH_OT_normals_tools()

void MESH_OT_normals_tools ( struct wmOperatorType ot)

◆ MESH_OT_offset_edge_loops()

void MESH_OT_offset_edge_loops ( wmOperatorType ot)

◆ MESH_OT_point_normals()

void MESH_OT_point_normals ( struct wmOperatorType ot)

◆ MESH_OT_poke()

void MESH_OT_poke ( wmOperatorType ot)

◆ MESH_OT_quads_convert_to_tris()

void MESH_OT_quads_convert_to_tris ( wmOperatorType ot)

◆ MESH_OT_remove_doubles()

void MESH_OT_remove_doubles ( wmOperatorType ot)

◆ MESH_OT_reveal()

void MESH_OT_reveal ( wmOperatorType ot)

◆ MESH_OT_separate()

void MESH_OT_separate ( wmOperatorType ot)

◆ MESH_OT_set_normals_from_faces()

void MESH_OT_set_normals_from_faces ( struct wmOperatorType ot)

◆ MESH_OT_shape_propagate_to_all()

void MESH_OT_shape_propagate_to_all ( wmOperatorType ot)

◆ MESH_OT_smooth_normals()

void MESH_OT_smooth_normals ( struct wmOperatorType ot)

◆ MESH_OT_solidify()

void MESH_OT_solidify ( wmOperatorType ot)

◆ MESH_OT_sort_elements()

void MESH_OT_sort_elements ( wmOperatorType ot)

◆ MESH_OT_split()

void MESH_OT_split ( wmOperatorType ot)

◆ MESH_OT_split_normals()

void MESH_OT_split_normals ( struct wmOperatorType ot)

◆ MESH_OT_subdivide()

void MESH_OT_subdivide ( wmOperatorType ot)

◆ MESH_OT_subdivide_edgering()

void MESH_OT_subdivide_edgering ( wmOperatorType ot)

◆ MESH_OT_symmetrize()

void MESH_OT_symmetrize ( struct wmOperatorType ot)

◆ MESH_OT_symmetry_snap()

void MESH_OT_symmetry_snap ( struct wmOperatorType ot)

◆ MESH_OT_tris_convert_to_quads()

void MESH_OT_tris_convert_to_quads ( wmOperatorType ot)

◆ MESH_OT_unsubdivide()

void MESH_OT_unsubdivide ( wmOperatorType ot)

◆ MESH_OT_uvs_reverse()

void MESH_OT_uvs_reverse ( wmOperatorType ot)

◆ MESH_OT_uvs_rotate()

void MESH_OT_uvs_rotate ( wmOperatorType ot)

◆ MESH_OT_vert_connect()

void MESH_OT_vert_connect ( wmOperatorType ot)

◆ MESH_OT_vert_connect_concave()

void MESH_OT_vert_connect_concave ( wmOperatorType ot)

◆ MESH_OT_vert_connect_nonplanar()

void MESH_OT_vert_connect_nonplanar ( wmOperatorType ot)

◆ MESH_OT_vert_connect_path()

void MESH_OT_vert_connect_path ( wmOperatorType ot)

◆ MESH_OT_vertices_smooth()

void MESH_OT_vertices_smooth ( wmOperatorType ot)

◆ MESH_OT_vertices_smooth_laplacian()

void MESH_OT_vertices_smooth_laplacian ( wmOperatorType ot)

◆ MESH_OT_wireframe()

void MESH_OT_wireframe ( wmOperatorType ot)

◆ mesh_separate_arrays()

static Base* mesh_separate_arrays ( Main bmain,
Scene scene,
ViewLayer view_layer,
Base base_old,
BMesh bm_old,
BMVert **  verts,
uint  verts_len,
BMEdge **  edges,
uint  edges_len,
BMFace **  faces,
uint  faces_len 
)
static

◆ mesh_separate_loose()

static bool mesh_separate_loose ( Main bmain,
Scene scene,
ViewLayer view_layer,
Base base_old,
BMesh bm_old 
)
static

◆ mesh_separate_material()

static bool mesh_separate_material ( Main bmain,
Scene scene,
ViewLayer view_layer,
Base base_old,
BMesh bm_old 
)
static

◆ mesh_separate_material_assign_mat_nr()

static void mesh_separate_material_assign_mat_nr ( Main bmain,
Object ob,
const short  mat_nr 
)
static

Sets an object to a single material. from one of its slots.

Note
This could be used for split-by-material for non mesh types.
This could take material data from another object or args.

Definition at line 4504 of file editmesh_tools.c.

References BKE_id_material_array_p(), BKE_id_material_clear(), BKE_id_material_len_p(), BKE_id_material_resize(), BKE_object_material_resize(), BLI_assert, Object::data, id_us_plus(), Object::mat, Object::matbits, and NULL.

Referenced by mesh_separate_material().

◆ mesh_separate_selected()

static bool mesh_separate_selected ( Main bmain,
Scene scene,
ViewLayer view_layer,
Base base_old,
BMesh bm_old 
)
static

◆ mesh_separate_tagged()

static Base* mesh_separate_tagged ( Main bmain,
Scene scene,
ViewLayer view_layer,
Base base_old,
BMesh bm_old 
)
static

◆ mesh_set_smooth_faces()

static void mesh_set_smooth_faces ( BMEditMesh em,
short  smooth 
)
static

◆ mesh_symmetrize_exec()

static int mesh_symmetrize_exec ( bContext C,
wmOperator op 
)
static

◆ mesh_symmetry_snap_exec()

static int mesh_symmetry_snap_exec ( bContext C,
wmOperator op 
)
static

◆ normals_merge()

static void normals_merge ( BMesh bm,
BMLoopNorEditDataArray lnors_ed_arr 
)
static

◆ normals_split()

static void normals_split ( BMesh bm)
static

◆ normals_split_merge()

static int normals_split_merge ( bContext C,
const bool  do_merge 
)
static

◆ normals_tools_draw_check_prop()

static bool normals_tools_draw_check_prop ( PointerRNA ptr,
PropertyRNA prop,
void UNUSEDuser_data 
)
static

◆ point_normals_apply()

static void point_normals_apply ( bContext C,
wmOperator op,
float  target[3],
const bool  do_reset 
)
static

◆ point_normals_cancel()

static void point_normals_cancel ( bContext C,
wmOperator op 
)
static

◆ point_normals_draw_check_prop()

static bool point_normals_draw_check_prop ( PointerRNA ptr,
PropertyRNA prop,
void UNUSEDuser_data 
)
static

Definition at line 8746 of file editmesh_tools.c.

References ptr, RNA_boolean_get(), RNA_property_identifier(), and STREQ.

Referenced by edbm_point_normals_ui().

◆ point_normals_ensure()

static bool point_normals_ensure ( bContext C,
wmOperator op 
)
static

Definition at line 8354 of file editmesh_tools.c.

References C, wmOperator::customdata, NULL, and point_normals_init().

Referenced by edbm_point_normals_modal().

◆ point_normals_free()

static void point_normals_free ( wmOperator op)
static

◆ point_normals_init()

static bool point_normals_init ( bContext C,
wmOperator op 
)
static

◆ point_normals_modal_keymap()

wmKeyMap* point_normals_modal_keymap ( wmKeyConfig keyconf)

◆ point_normals_update_header()

static void point_normals_update_header ( bContext C,
wmOperator op 
)
static

◆ shape_itemf()

static const EnumPropertyItem* shape_itemf ( bContext C,
PointerRNA UNUSEDptr,
PropertyRNA UNUSEDprop,
bool r_free 
)
static

◆ shape_propagate()

static bool shape_propagate ( BMEditMesh em)
static

◆ sort_bmelem_flag()

static void sort_bmelem_flag ( bContext C,
Scene scene,
Object ob,
RegionView3D rv3d,
const int  types,
const int  flag,
const int  action,
const int  reverse,
const uint  seed 
)
static

Variable Documentation

◆ average_method_items

EnumPropertyItem average_method_items[]
static
Initial value:
= {
"CUSTOM_NORMAL",
0,
"Custom Normal",
"Take average of vertex normals"},
"FACE_AREA",
0,
"Face Area",
"Set all vertex normals by face area"},
"CORNER_ANGLE",
0,
"Corner Angle",
"Set all vertex normals by corner angle"},
{0, NULL, 0, NULL, NULL},
}
@ EDBM_CLNOR_AVERAGE_LOOP
@ EDBM_CLNOR_AVERAGE_FACE_AREA
@ EDBM_CLNOR_AVERAGE_ANGLE

Definition at line 9063 of file editmesh_tools.c.

Referenced by MESH_OT_average_normals().

◆ clnors_pointto_mode_items

EnumPropertyItem clnors_pointto_mode_items[]
static
Initial value:
= {
"COORDINATES",
0,
"Coordinates",
"Use static coordinates (defined by various means)"},
{EDBM_CLNOR_POINTTO_MODE_MOUSE, "MOUSE", 0, "Mouse", "Follow mouse cursor"},
{0, NULL, 0, NULL, NULL},
}
@ EDBM_CLNOR_POINTTO_MODE_MOUSE
@ EDBM_CLNOR_POINTTO_MODE_COORDINATES

Definition at line 8328 of file editmesh_tools.c.

Referenced by MESH_OT_point_normals().

◆ knife_items

const EnumPropertyItem knife_items[]
static
Initial value:
= {
{KNIFE_EXACT, "EXACT", 0, "Exact", ""},
{KNIFE_MIDPOINT, "MIDPOINTS", 0, "Midpoints", ""},
{KNIFE_MULTICUT, "MULTICUT", 0, "Multicut", ""},
{0, NULL, 0, NULL, NULL},
}
#define KNIFE_EXACT
#define KNIFE_MULTICUT
#define KNIFE_MIDPOINT

Definition at line 4018 of file editmesh_tools.c.

Referenced by MESH_OT_knife_cut().

◆ merge_type_items

const EnumPropertyItem merge_type_items[]
static
Initial value:
= {
{MESH_MERGE_CENTER, "CENTER", 0, "At Center", ""},
{MESH_MERGE_CURSOR, "CURSOR", 0, "At Cursor", ""},
{MESH_MERGE_COLLAPSE, "COLLAPSE", 0, "Collapse", ""},
{MESH_MERGE_FIRST, "FIRST", 0, "At First", ""},
{MESH_MERGE_LAST, "LAST", 0, "At Last", ""},
{0, NULL, 0, NULL, NULL},
}
@ MESH_MERGE_LAST
@ MESH_MERGE_CENTER
@ MESH_MERGE_CURSOR
@ MESH_MERGE_FIRST
@ MESH_MERGE_COLLAPSE

Definition at line 3443 of file editmesh_tools.c.

Referenced by merge_type_itemf(), MESH_OT_edge_split(), and MESH_OT_merge().

◆ normal_vector_tool_items

EnumPropertyItem normal_vector_tool_items[]
static
Initial value:
= {
{EDBM_CLNOR_TOOLS_COPY, "COPY", 0, "Copy Normal", "Copy normal to buffer"},
{EDBM_CLNOR_TOOLS_PASTE, "PASTE", 0, "Paste Normal", "Paste normal from buffer"},
{EDBM_CLNOR_TOOLS_ADD, "ADD", 0, "Add Normal", "Add normal vector with selection"},
"MULTIPLY",
0,
"Multiply Normal",
"Multiply normal vector with selection"},
"RESET",
0,
"Reset Normal",
"Reset buffer and/or normal of selected element"},
{0, NULL, 0, NULL, NULL},
}
@ EDBM_CLNOR_TOOLS_RESET
@ EDBM_CLNOR_TOOLS_COPY
@ EDBM_CLNOR_TOOLS_ADD
@ EDBM_CLNOR_TOOLS_MULTIPLY
@ EDBM_CLNOR_TOOLS_PASTE

Definition at line 9313 of file editmesh_tools.c.

Referenced by MESH_OT_normals_tools().

◆ prop_mesh_cornervert_types

const EnumPropertyItem prop_mesh_cornervert_types[]
static
Initial value:
= {
{SUBD_CORNER_INNERVERT, "INNERVERT", 0, "Inner Vert", ""},
{SUBD_CORNER_PATH, "PATH", 0, "Path", ""},
{SUBD_CORNER_STRAIGHT_CUT, "STRAIGHT_CUT", 0, "Straight Cut", ""},
{SUBD_CORNER_FAN, "FAN", 0, "Fan", ""},
{0, NULL, 0, NULL, NULL},
}
@ SUBD_CORNER_FAN
@ SUBD_CORNER_STRAIGHT_CUT
@ SUBD_CORNER_PATH
@ SUBD_CORNER_INNERVERT

Definition at line 138 of file editmesh_tools.c.

Referenced by MESH_OT_subdivide().

◆ prop_mesh_face_strength_types

const EnumPropertyItem prop_mesh_face_strength_types[]
static
Initial value:
= {
{FACE_STRENGTH_WEAK, "WEAK", 0, "Weak", ""},
{FACE_STRENGTH_MEDIUM, "MEDIUM", 0, "Medium", ""},
{FACE_STRENGTH_STRONG, "STRONG", 0, "Strong", ""},
{0, NULL, 0, NULL, NULL},
}
@ FACE_STRENGTH_STRONG
@ FACE_STRENGTH_WEAK
@ FACE_STRENGTH_MEDIUM

Definition at line 9848 of file editmesh_tools.c.

Referenced by MESH_OT_mod_weighted_strength().