Blender  V3.3
Classes | Macros
editmesh_select.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_array.h"
#include "BLI_bitmap.h"
#include "BLI_heap.h"
#include "BLI_linklist.h"
#include "BLI_linklist_stack.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_math_bits.h"
#include "BLI_rand.h"
#include "BLI_string.h"
#include "BLI_utildefines_stack.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_layer.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_transform.h"
#include "ED_view3d.h"
#include "BLT_translation.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "UI_resources.h"
#include "bmesh_tools.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "DRW_select_buffer.h"
#include "mesh_intern.h"

Go to the source code of this file.

Classes

struct  NearestVertUserData_Hit
 
struct  NearestVertUserData
 
struct  NearestEdgeUserData_ZBuf
 
struct  NearestEdgeUserData_Hit
 
struct  NearestEdgeUserData
 
struct  NearestFaceUserData_ZBuf
 
struct  NearestFaceUserData_Hit
 
struct  NearestFaceUserData
 
struct  BMFaceLink
 
struct  DelimitData
 

Macros

#define BMO_ELE_TAG   1
 
#define USE_DELAY_FACE_GROUP_COST_CALC
 

Functions

Select Mirror
void EDBM_select_mirrored (BMEditMesh *em, const Mesh *me, const int axis, const bool extend, int *r_totmirr, int *r_totfail)
 
Back-Buffer OpenGL Selection
static BMElemedbm_select_id_bm_elem_get (Base **bases, const uint sel_id, uint *r_base_index)
 
Alternate Find Nearest Vert/Edge (optional boundary)
Note
This uses ray-cast method instead of back-buffer, currently used for poly-build.
bool EDBM_unified_findnearest_from_raycast (ViewContext *vc, Base **bases, const uint bases_len, bool use_boundary_vertices, bool use_boundary_edges, int *r_base_index_vert, int *r_base_index_edge, int *r_base_index_face, struct BMVert **r_eve, struct BMEdge **r_eed, struct BMFace **r_efa)
 
Select Similar Region Operator
static int edbm_select_similar_region_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_similar_region (wmOperatorType *ot)
 
Select Mode Vert/Edge/Face Operator
static int edbm_select_mode_exec (bContext *C, wmOperator *op)
 
static int edbm_select_mode_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static char * edbm_select_mode_get_description (struct bContext *UNUSED(C), struct wmOperatorType *UNUSED(op), struct PointerRNA *values)
 
void MESH_OT_select_mode (wmOperatorType *ot)
 
Select Loop (Non Modal) Operator
static void walker_select_count (BMEditMesh *em, int walkercode, void *start, int r_count_by_select[2])
 
static void walker_select (BMEditMesh *em, int walkercode, void *start, const bool select)
 
static int edbm_loop_multiselect_exec (bContext *C, wmOperator *op)
 
void MESH_OT_loop_multi_select (wmOperatorType *ot)
 
Select Loop (Cursor Pick) Operator
static void mouse_mesh_loop_face (BMEditMesh *em, BMEdge *eed, bool select, bool select_clear)
 
static void mouse_mesh_loop_edge_ring (BMEditMesh *em, BMEdge *eed, bool select, bool select_clear)
 
static void mouse_mesh_loop_edge (BMEditMesh *em, BMEdge *eed, bool select, bool select_clear, bool select_cycle)
 
static bool mouse_mesh_loop (bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool ring)
 
static int edbm_select_loop_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void MESH_OT_loop_select (wmOperatorType *ot)
 
void MESH_OT_edgering_select (wmOperatorType *ot)
 
(De)Select All Operator
static int edbm_select_all_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_all (wmOperatorType *ot)
 
Select Interior Faces Operator
static int edbm_faces_select_interior_exec (bContext *C, wmOperator *UNUSED(op))
 
void MESH_OT_select_interior_faces (wmOperatorType *ot)
 
Select Picking API

Here actual select happens, Gets called via generic mouse select operator.

bool EDBM_select_pick (bContext *C, const int mval[2], const struct SelectPick_Params *params)
 
Select Mode Utilities
static void edbm_strip_selections (BMEditMesh *em)
 
void EDBM_selectmode_set (BMEditMesh *em)
 
void EDBM_selectmode_convert (BMEditMesh *em, const short selectmode_old, const short selectmode_new)
 
bool EDBM_selectmode_toggle_multi (bContext *C, const short selectmode_new, const int action, const bool use_extend, const bool use_expand)
 
bool EDBM_selectmode_set_multi (bContext *C, const short selectmode)
 
bool EDBM_selectmode_disable (Scene *scene, BMEditMesh *em, const short selectmode_disable, const short selectmode_fallback)
 
Select Toggle
bool EDBM_deselect_by_material (BMEditMesh *em, const short index, const bool select)
 
void EDBM_select_toggle_all (BMEditMesh *em)
 
void EDBM_select_swap (BMEditMesh *em)
 
bool EDBM_mesh_deselect_all_multi_ex (struct Base **bases, const uint bases_len)
 
bool EDBM_mesh_deselect_all_multi (struct bContext *C)
 
bool EDBM_selectmode_disable_multi_ex (Scene *scene, struct Base **bases, const uint bases_len, const short selectmode_disable, const short selectmode_fallback)
 
bool EDBM_selectmode_disable_multi (struct bContext *C, const short selectmode_disable, const short selectmode_fallback)
 
Select Interior Faces

Overview of the algorithm:

  • Groups faces surrounded by edges with 3+ faces using them.
  • Calculates a cost of each face group comparing its angle with the faces connected to its non-manifold edges.
  • Mark the face group as interior, and mark connected face groups for recalculation.
  • Continue to remove the face groups with the highest 'cost'.
static bool bm_interior_loop_filter_fn (const BMLoop *l, void *UNUSED(user_data))
 
static bool bm_interior_edge_is_manifold_except_face_index (BMEdge *e, int face_index, BMLoop *r_l_pair[2])
 
static float bm_interior_face_group_calc_cost (ListBase *ls, const float *edge_lengths)
 
bool EDBM_select_interior_faces (BMEditMesh *em)
 
Select Linked (Cursor Pick) Operator
static int edbm_select_linked_pick_exec (bContext *C, wmOperator *op)
 
static void edbm_select_linked_pick_ex (BMEditMesh *em, BMElem *ele, bool sel, int delimit)
 
static int edbm_select_linked_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void MESH_OT_select_linked_pick (wmOperatorType *ot)
 
Select Face by Sides Operator
static int edbm_select_face_by_sides_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_face_by_sides (wmOperatorType *ot)
 
Select Loose Operator
static int edbm_select_loose_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_loose (wmOperatorType *ot)
 
Select Mirror Operator
static int edbm_select_mirror_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_mirror (wmOperatorType *ot)
 
Select More Operator
static int edbm_select_more_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_more (wmOperatorType *ot)
 
static int edbm_select_less_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_less (wmOperatorType *ot)
 
Select N'th Operator
static bool bm_edge_is_select_isolated (BMEdge *e)
 
static void walker_deselect_nth (BMEditMesh *em, const struct CheckerIntervalParams *op_params, BMHeader *h_act)
 
static void deselect_nth_active (BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
 
static bool edbm_deselect_nth (BMEditMesh *em, const struct CheckerIntervalParams *op_params)
 
static int edbm_select_nth_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_nth (wmOperatorType *ot)
 
void em_setup_viewcontext (bContext *C, ViewContext *vc)
 
Select Sharp Edges Operator
static int edbm_select_sharp_edges_exec (bContext *C, wmOperator *op)
 
void MESH_OT_edges_select_sharp (wmOperatorType *ot)
 
Select Linked Flat Faces Operator
static int edbm_select_linked_flat_faces_exec (bContext *C, wmOperator *op)
 
void MESH_OT_faces_select_linked_flat (wmOperatorType *ot)
 
Select Non-Manifold Operator
static int edbm_select_non_manifold_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_non_manifold (wmOperatorType *ot)
 
Select Random Operator
static int edbm_select_random_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_random (wmOperatorType *ot)
 
Select Ungrouped Operator
static bool edbm_select_ungrouped_poll (bContext *C)
 
static int edbm_select_ungrouped_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_ungrouped (wmOperatorType *ot)
 
Select Region to Loop Operator
static int edbm_region_to_loop_exec (bContext *C, wmOperator *UNUSED(op))
 
void MESH_OT_region_to_loop (wmOperatorType *ot)
 
Select Loop to Region Operator
static int loop_find_region (BMLoop *l, int flag, GSet *visit_face_set, BMFace ***region_out)
 
static int verg_radial (const void *va, const void *vb)
 
static int loop_find_regions (BMEditMesh *em, const bool selbigger)
 
static int edbm_loop_to_region_exec (bContext *C, wmOperator *op)
 
void MESH_OT_loop_to_region (wmOperatorType *ot)
 

Find Nearest Vert/Edge/Face

Note
Screen-space manhattan distances are used here, since its faster and good enough for the purpose of selection.
dist_bias is used so we can bias against selected items. when choosing between elements of a single type, but return the real distance to avoid the bias interfering with distance comparisons when mixing types.
#define FIND_NEAR_SELECT_BIAS   5
 
#define FIND_NEAR_CYCLE_THRESHOLD_MIN   3
 
static void findnearestvert__doClosest (void *userData, BMVert *eve, const float screen_co[2], int index)
 
BMVertEDBM_vert_find_nearest_ex (ViewContext *vc, float *dist_px_manhattan_p, const bool use_select_bias, bool use_cycle, Base **bases, uint bases_len, uint *r_base_index)
 
BMVertEDBM_vert_find_nearest (ViewContext *vc, float *dist_px_manhattan_p)
 
static void find_nearest_edge_center__doZBuf (void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int UNUSED(index))
 
static void find_nearest_edge__doClosest (void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
 
BMEdgeEDBM_edge_find_nearest_ex (ViewContext *vc, float *dist_px_manhattan_p, float *r_dist_center_px_manhattan, const bool use_select_bias, bool use_cycle, BMEdge **r_eed_zbuf, Base **bases, uint bases_len, uint *r_base_index)
 
BMEdgeEDBM_edge_find_nearest (ViewContext *vc, float *dist_px_manhattan_p)
 
static void find_nearest_face_center__doZBuf (void *userData, BMFace *efa, const float screen_co[2], int UNUSED(index))
 
static void findnearestface__doClosest (void *userData, BMFace *efa, const float screen_co[2], int index)
 
BMFaceEDBM_face_find_nearest_ex (ViewContext *vc, float *dist_px_manhattan_p, float *r_dist_center, const bool use_zbuf_single_px, const bool use_select_bias, bool use_cycle, BMFace **r_efa_zbuf, Base **bases, uint bases_len, uint *r_base_index)
 
BMFaceEDBM_face_find_nearest (ViewContext *vc, float *dist_px_manhattan_p)
 
static bool unified_findnearest (ViewContext *vc, Base **bases, const uint bases_len, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
 
bool EDBM_unified_findnearest (ViewContext *vc, Base **bases, const uint bases_len, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
 

Select Linked Operator

Support delimiting on different edge properties.

#define USE_LINKED_SELECT_DEFAULT_HACK
 
static bool select_linked_delimit_test (BMEdge *e, int delimit, const struct DelimitData *delimit_data)
 
static int select_linked_delimit_default_from_op (wmOperator *op, const int select_mode)
 
static void select_linked_delimit_validate (BMesh *bm, int *delimit)
 
static void select_linked_delimit_begin (BMesh *bm, int delimit)
 
static void select_linked_delimit_end (BMEditMesh *em)
 
static int edbm_select_linked_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_linked (wmOperatorType *ot)
 

Select Axis Operator

enum  { SELECT_AXIS_POS = 0 , SELECT_AXIS_NEG = 1 , SELECT_AXIS_ALIGN = 2 }
 
static int edbm_select_axis_exec (bContext *C, wmOperator *op)
 
void MESH_OT_select_axis (wmOperatorType *ot)
 

Macro Definition Documentation

◆ BMO_ELE_TAG

#define BMO_ELE_TAG   1

Definition at line 61 of file editmesh_select.c.

◆ FIND_NEAR_CYCLE_THRESHOLD_MIN

#define FIND_NEAR_CYCLE_THRESHOLD_MIN   3

Definition at line 206 of file editmesh_select.c.

◆ FIND_NEAR_SELECT_BIAS

#define FIND_NEAR_SELECT_BIAS   5

Definition at line 205 of file editmesh_select.c.

◆ USE_DELAY_FACE_GROUP_COST_CALC

#define USE_DELAY_FACE_GROUP_COST_CALC

◆ USE_LINKED_SELECT_DEFAULT_HACK

#define USE_LINKED_SELECT_DEFAULT_HACK

Definition at line 3113 of file editmesh_select.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SELECT_AXIS_POS 
SELECT_AXIS_NEG 
SELECT_AXIS_ALIGN 

Definition at line 4872 of file editmesh_select.c.

Function Documentation

◆ bm_edge_is_select_isolated()

static bool bm_edge_is_select_isolated ( BMEdge e)
static

Check if we're connected to another selected edge.

Definition at line 4112 of file editmesh_select.c.

References BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_SELECT, BM_ITER_ELEM, BM_VERTS_OF_EDGE, e, and v.

Referenced by walker_deselect_nth().

◆ bm_interior_edge_is_manifold_except_face_index()

static bool bm_interior_edge_is_manifold_except_face_index ( BMEdge e,
int  face_index,
BMLoop r_l_pair[2] 
)
static

Definition at line 2795 of file editmesh_select.c.

References BM_elem_index_get, e, ELEM, BMLoop::f, and BMLoop::radial_next.

Referenced by EDBM_select_interior_faces().

◆ bm_interior_face_group_calc_cost()

static float bm_interior_face_group_calc_cost ( ListBase ls,
const float edge_lengths 
)
static

◆ bm_interior_loop_filter_fn()

static bool bm_interior_loop_filter_fn ( const BMLoop l,
void UNUSEDuser_data 
)
static

Definition at line 2788 of file editmesh_select.c.

References BM_elem_flag_test, BM_ELEM_TAG, BMLoop::e, and l.

Referenced by EDBM_select_interior_faces().

◆ deselect_nth_active()

static void deselect_nth_active ( BMEditMesh em,
BMVert **  r_eve,
BMEdge **  r_eed,
BMFace **  r_efa 
)
static

◆ EDBM_deselect_by_material()

bool EDBM_deselect_by_material ( BMEditMesh em,
const short  index,
const bool  select 
)

◆ edbm_deselect_nth()

static bool edbm_deselect_nth ( BMEditMesh em,
const struct CheckerIntervalParams op_params 
)
static

Definition at line 4273 of file editmesh_select.c.

References deselect_nth_active(), e, BMVert::head, BMFace::head, v, and walker_deselect_nth().

Referenced by edbm_select_nth_exec().

◆ EDBM_edge_find_nearest()

BMEdge* EDBM_edge_find_nearest ( ViewContext vc,
float dist_px_manhattan_p 
)

◆ EDBM_edge_find_nearest_ex()

BMEdge* EDBM_edge_find_nearest_ex ( ViewContext vc,
float dist_px_manhattan_p,
float r_dist_center_px_manhattan,
const bool  use_select_bias,
bool  use_cycle,
BMEdge **  r_eed_zbuf,
Base **  bases,
uint  bases_len,
uint r_base_index 
)

◆ EDBM_face_find_nearest()

BMFace* EDBM_face_find_nearest ( ViewContext vc,
float dist_px_manhattan_p 
)

◆ EDBM_face_find_nearest_ex()

BMFace* EDBM_face_find_nearest_ex ( struct ViewContext vc,
float dist_px_manhattan,
float r_dist_center,
bool  use_zbuf_single_px,
bool  use_select_bias,
bool  use_cycle,
struct BMFace **  r_efa_zbuf,
struct Base **  bases,
uint  bases_len,
uint r_base_index 
)
Parameters
use_zbuf_single_pxSpecial case, when using the back-buffer selection, only use the pixel at vc->mval instead of using dist_px_manhattan_p to search over a larger region. This is needed because historically selection worked this way for a long time, however it's reasonable that some callers might want to expand the region too. So add an argument to do this,

Definition at line 692 of file editmesh_select.c.

References BMEditMesh::bm, bm, BM_face_at_index_find_or_table(), data, ViewContext::depsgraph, NearestFaceUserData_Hit::dist, DRW_select_buffer_context_create(), DRW_select_buffer_find_nearest_to_point(), DRW_select_buffer_sample_point(), ED_view3d_backbuf_sample_size_clamp(), ED_view3d_init_mats_rv3d(), ED_view3d_viewcontext_init_object(), edbm_select_id_bm_elem_get(), ViewContext::em, NearestFaceUserData_Hit::face, find_nearest_face_center__doZBuf(), findnearestface__doClosest(), if(), NearestFaceUserData_Hit::index, mesh_foreachScreenFace(), ViewContext::mval, NULL, ViewContext::obedit, Base::object, ViewContext::region, ViewContext::rv3d, SCE_SELECT_FACE, UINT_MAX, ViewContext::v3d, V3D_PROJ_TEST_CLIP_DEFAULT, and XRAY_FLAG_ENABLED.

Referenced by EDBM_face_find_nearest(), and unified_findnearest().

◆ edbm_faces_select_interior_exec()

static int edbm_faces_select_interior_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ edbm_loop_multiselect_exec()

static int edbm_loop_multiselect_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_loop_to_region_exec()

static int edbm_loop_to_region_exec ( bContext C,
wmOperator op 
)
static

◆ EDBM_mesh_deselect_all_multi()

bool EDBM_mesh_deselect_all_multi ( struct bContext C)

◆ EDBM_mesh_deselect_all_multi_ex()

bool EDBM_mesh_deselect_all_multi_ex ( struct Base **  bases,
const uint  bases_len 
)

◆ edbm_region_to_loop_exec()

static int edbm_region_to_loop_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ edbm_select_all_exec()

static int edbm_select_all_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_axis_exec()

static int edbm_select_axis_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_face_by_sides_exec()

static int edbm_select_face_by_sides_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_id_bm_elem_get()

static BMElem* edbm_select_id_bm_elem_get ( Base **  bases,
const uint  sel_id,
uint r_base_index 
)
static

◆ EDBM_select_interior_faces()

bool EDBM_select_interior_faces ( BMEditMesh em)

◆ edbm_select_less_exec()

static int edbm_select_less_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_linked_exec()

static int edbm_select_linked_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_linked_flat_faces_exec()

static int edbm_select_linked_flat_faces_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_linked_pick_ex()

static void edbm_select_linked_pick_ex ( BMEditMesh em,
BMElem ele,
bool  sel,
int  delimit 
)
static

◆ edbm_select_linked_pick_exec()

static int edbm_select_linked_pick_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_linked_pick_invoke()

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

◆ edbm_select_loop_invoke()

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

◆ edbm_select_loose_exec()

static int edbm_select_loose_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_mirror_exec()

static int edbm_select_mirror_exec ( bContext C,
wmOperator op 
)
static

◆ EDBM_select_mirrored()

void EDBM_select_mirrored ( BMEditMesh em,
const Mesh me,
const int  axis,
const bool  extend,
int *  r_totmirr,
int *  r_totfail 
)

◆ edbm_select_mode_exec()

static int edbm_select_mode_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_mode_get_description()

static char* edbm_select_mode_get_description ( struct bContext UNUSEDC,
struct wmOperatorType UNUSEDop,
struct PointerRNA values 
)
static

◆ edbm_select_mode_invoke()

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

◆ edbm_select_more_exec()

static int edbm_select_more_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_non_manifold_exec()

static int edbm_select_non_manifold_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_nth_exec()

static int edbm_select_nth_exec ( bContext C,
wmOperator op 
)
static

◆ EDBM_select_pick()

bool EDBM_select_pick ( bContext C,
const int  mval[2],
const struct SelectPick_Params params 
)

◆ edbm_select_random_exec()

static int edbm_select_random_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_sharp_edges_exec()

static int edbm_select_sharp_edges_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_similar_region_exec()

static int edbm_select_similar_region_exec ( bContext C,
wmOperator op 
)
static

◆ EDBM_select_swap()

void EDBM_select_swap ( BMEditMesh em)

◆ EDBM_select_toggle_all()

void EDBM_select_toggle_all ( BMEditMesh em)

◆ edbm_select_ungrouped_exec()

static int edbm_select_ungrouped_exec ( bContext C,
wmOperator op 
)
static

◆ edbm_select_ungrouped_poll()

static bool edbm_select_ungrouped_poll ( bContext C)
static

◆ EDBM_selectmode_convert()

void EDBM_selectmode_convert ( struct BMEditMesh em,
short  selectmode_old,
short  selectmode_new 
)

◆ EDBM_selectmode_disable()

bool EDBM_selectmode_disable ( struct Scene scene,
struct BMEditMesh em,
short  selectmode_disable,
short  selectmode_fallback 
)

Use to disable a select-mode if its enabled, Using another mode as a fallback if the disabled mode is the only mode set.

Returns
true if the mode is changed.

Definition at line 2609 of file editmesh_select.c.

References EDBM_selectmode_set(), NC_SCENE, ND_TOOLSETTINGS, scene, BMEditMesh::selectmode, ToolSettings::selectmode, Scene::toolsettings, and WM_main_add_notifier().

Referenced by EDBM_selectmode_disable_multi_ex(), and knifeproject_exec().

◆ EDBM_selectmode_disable_multi()

bool EDBM_selectmode_disable_multi ( struct bContext C,
const short  selectmode_disable,
const short  selectmode_fallback 
)

◆ EDBM_selectmode_disable_multi_ex()

bool EDBM_selectmode_disable_multi_ex ( Scene scene,
struct Base **  bases,
const uint  bases_len,
const short  selectmode_disable,
const short  selectmode_fallback 
)

◆ EDBM_selectmode_set()

void EDBM_selectmode_set ( struct BMEditMesh em)

◆ EDBM_selectmode_set_multi()

bool EDBM_selectmode_set_multi ( struct bContext C,
short  selectmode 
)

◆ EDBM_selectmode_toggle_multi()

bool EDBM_selectmode_toggle_multi ( struct bContext C,
short  selectmode_new,
int  action,
bool  use_extend,
bool  use_expand 
)

◆ edbm_strip_selections()

static void edbm_strip_selections ( BMEditMesh em)
static

◆ EDBM_unified_findnearest()

bool EDBM_unified_findnearest ( ViewContext vc,
Base **  bases,
const uint  bases_len,
int *  r_base_index,
BMVert **  r_eve,
BMEdge **  r_eed,
BMFace **  r_efa 
)

Definition at line 982 of file editmesh_select.c.

References unified_findnearest().

Referenced by edbm_shortest_path_pick_invoke(), and mouse_mesh_loop().

◆ EDBM_unified_findnearest_from_raycast()

bool EDBM_unified_findnearest_from_raycast ( ViewContext vc,
Base **  bases,
const uint  bases_len,
bool  use_boundary_vertices,
bool  use_boundary_edges,
int *  r_base_index_vert,
int *  r_base_index_edge,
int *  r_base_index_face,
struct BMVert **  r_eve,
struct BMEdge **  r_eed,
struct BMFace **  r_efa 
)

◆ EDBM_vert_find_nearest()

BMVert* EDBM_vert_find_nearest ( ViewContext vc,
float dist_px_manhattan_p 
)

◆ EDBM_vert_find_nearest_ex()

BMVert* EDBM_vert_find_nearest_ex ( struct ViewContext vc,
float dist_px_manhattan_p,
bool  use_select_bias,
bool  use_cycle,
struct Base **  bases,
uint  bases_len,
uint r_base_index 
)

◆ em_setup_viewcontext()

void em_setup_viewcontext ( bContext C,
ViewContext vc 
)

◆ find_nearest_edge__doClosest()

static void find_nearest_edge__doClosest ( void userData,
BMEdge eed,
const float  screen_co_a[2],
const float  screen_co_b[2],
int  index 
)
static

◆ find_nearest_edge_center__doZBuf()

static void find_nearest_edge_center__doZBuf ( void userData,
BMEdge eed,
const float  screen_co_a[2],
const float  screen_co_b[2],
int   UNUSEDindex 
)
static

◆ find_nearest_face_center__doZBuf()

static void find_nearest_face_center__doZBuf ( void userData,
BMFace efa,
const float  screen_co[2],
int   UNUSEDindex 
)
static

◆ findnearestface__doClosest()

static void findnearestface__doClosest ( void userData,
BMFace efa,
const float  screen_co[2],
int  index 
)
static

◆ findnearestvert__doClosest()

static void findnearestvert__doClosest ( void userData,
BMVert eve,
const float  screen_co[2],
int  index 
)
static

◆ loop_find_region()

static int loop_find_region ( BMLoop l,
int  flag,
GSet visit_face_set,
BMFace ***  region_out 
)
static

◆ loop_find_regions()

static int loop_find_regions ( BMEditMesh em,
const bool  selbigger 
)
static

This function leaves faces tagged which are a part of the new region.

Note
faces already tagged are ignored, to avoid finding the same regions twice: important when we have regions with equal face counts, see: T40309

Definition at line 5172 of file editmesh_select.c.

References BLI_gset_free(), BLI_gset_haskey(), BLI_gset_ptr_new_ex(), BMEditMesh::bm, BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_SELECT, BM_ELEM_TAG, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_EDGE, BM_LOOPS_OF_FACE, Freestyle::c, count, BMLoop::e, e, BMLoop::f, l, loop_find_region(), MEM_freeN, MEM_mallocN, NULL, BMesh::totedgesel, and verg_radial().

Referenced by edbm_loop_to_region_exec().

◆ MESH_OT_edgering_select()

void MESH_OT_edgering_select ( wmOperatorType ot)

◆ MESH_OT_edges_select_sharp()

void MESH_OT_edges_select_sharp ( wmOperatorType ot)

◆ MESH_OT_faces_select_linked_flat()

void MESH_OT_faces_select_linked_flat ( wmOperatorType ot)

◆ MESH_OT_loop_multi_select()

void MESH_OT_loop_multi_select ( wmOperatorType ot)

◆ MESH_OT_loop_select()

void MESH_OT_loop_select ( wmOperatorType ot)

◆ MESH_OT_loop_to_region()

void MESH_OT_loop_to_region ( wmOperatorType ot)

◆ MESH_OT_region_to_loop()

void MESH_OT_region_to_loop ( wmOperatorType ot)

◆ MESH_OT_select_all()

void MESH_OT_select_all ( wmOperatorType ot)

◆ MESH_OT_select_axis()

void MESH_OT_select_axis ( wmOperatorType ot)

◆ MESH_OT_select_face_by_sides()

void MESH_OT_select_face_by_sides ( wmOperatorType ot)

◆ MESH_OT_select_interior_faces()

void MESH_OT_select_interior_faces ( wmOperatorType ot)

◆ MESH_OT_select_less()

void MESH_OT_select_less ( wmOperatorType ot)

◆ MESH_OT_select_linked()

void MESH_OT_select_linked ( wmOperatorType ot)

◆ MESH_OT_select_linked_pick()

void MESH_OT_select_linked_pick ( wmOperatorType ot)

◆ MESH_OT_select_loose()

void MESH_OT_select_loose ( wmOperatorType ot)

◆ MESH_OT_select_mirror()

void MESH_OT_select_mirror ( wmOperatorType ot)

◆ MESH_OT_select_mode()

void MESH_OT_select_mode ( wmOperatorType ot)

◆ MESH_OT_select_more()

void MESH_OT_select_more ( wmOperatorType ot)

◆ MESH_OT_select_non_manifold()

void MESH_OT_select_non_manifold ( wmOperatorType ot)

◆ MESH_OT_select_nth()

void MESH_OT_select_nth ( wmOperatorType ot)

◆ MESH_OT_select_random()

void MESH_OT_select_random ( wmOperatorType ot)

◆ MESH_OT_select_similar_region()

void MESH_OT_select_similar_region ( wmOperatorType ot)

◆ MESH_OT_select_ungrouped()

void MESH_OT_select_ungrouped ( wmOperatorType ot)

◆ mouse_mesh_loop()

static bool mouse_mesh_loop ( bContext C,
const int  mval[2],
bool  extend,
bool  deselect,
bool  toggle,
bool  ring 
)
static

◆ mouse_mesh_loop_edge()

static void mouse_mesh_loop_edge ( BMEditMesh em,
BMEdge eed,
bool  select,
bool  select_clear,
bool  select_cycle 
)
static

◆ mouse_mesh_loop_edge_ring()

static void mouse_mesh_loop_edge_ring ( BMEditMesh em,
BMEdge eed,
bool  select,
bool  select_clear 
)
static

◆ mouse_mesh_loop_face()

static void mouse_mesh_loop_face ( BMEditMesh em,
BMEdge eed,
bool  select,
bool  select_clear 
)
static

◆ select_linked_delimit_begin()

static void select_linked_delimit_begin ( BMesh bm,
int  delimit 
)
static

◆ select_linked_delimit_default_from_op()

static int select_linked_delimit_default_from_op ( wmOperator op,
const int  select_mode 
)
static

Gets the default from the operator fallback to own last-used value (selected based on mode)

Definition at line 3171 of file editmesh_select.c.

References BMO_DELIM_SEAM, wmOperator::ptr, RNA_property_enum_get(), RNA_property_enum_set(), RNA_property_is_set(), RNA_struct_find_property(), SCE_SELECT_EDGE, and SCE_SELECT_VERTEX.

Referenced by edbm_select_linked_exec(), edbm_select_linked_pick_exec(), and edbm_select_linked_pick_invoke().

◆ select_linked_delimit_end()

static void select_linked_delimit_end ( BMEditMesh em)
static

◆ select_linked_delimit_test()

static bool select_linked_delimit_test ( BMEdge e,
int  delimit,
const struct DelimitData delimit_data 
)
static

◆ select_linked_delimit_validate()

static void select_linked_delimit_validate ( BMesh bm,
int *  delimit 
)
static

◆ unified_findnearest()

static bool unified_findnearest ( ViewContext vc,
Base **  bases,
const uint  bases_len,
int *  r_base_index,
BMVert **  r_eve,
BMEdge **  r_eed,
BMFace **  r_efa 
)
static

◆ verg_radial()

static int verg_radial ( const void va,
const void vb 
)
static

Definition at line 5149 of file editmesh_select.c.

References Freestyle::a, usdtokens::b(), and BM_edge_face_count().

Referenced by loop_find_regions().

◆ walker_deselect_nth()

static void walker_deselect_nth ( BMEditMesh em,
const struct CheckerIntervalParams op_params,
BMHeader h_act 
)
static

◆ walker_select()

static void walker_select ( BMEditMesh em,
int  walkercode,
void start,
const bool  select 
)
static

◆ walker_select_count()

static void walker_select_count ( BMEditMesh em,
int  walkercode,
void start,
int  r_count_by_select[2] 
)
static