Blender  V2.93
Classes
view3d_select.c File Reference
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "DNA_action_types.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_tracking_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_array.h"
#include "BLI_bitmap.h"
#include "BLI_lasso_2d.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_editmesh.h"
#include "BKE_layer.h"
#include "BKE_mball.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_tracking.h"
#include "BKE_workspace.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_gpencil.h"
#include "ED_lattice.h"
#include "ED_mball.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_particle.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_select_utils.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "GPU_matrix.h"
#include "DEG_depsgraph_query.h"
#include "DRW_engine.h"
#include "DRW_select_buffer.h"
#include "view3d_intern.h"

Go to the source code of this file.

Classes

struct  EditSelectBuf_Cache
 
struct  LassoSelectUserData
 
struct  LassoSelectUserData_ForMeshEdge
 
struct  SelMenuItemF
 
struct  BoxSelectUserData
 
struct  BoxSelectUserData_ForMeshEdge
 
struct  CircleSelectUserData
 

Functions

Public Utilities
float ED_view3d_select_dist_px (void)
 
void ED_view3d_viewcontext_init (bContext *C, ViewContext *vc, Depsgraph *depsgraph)
 
void ED_view3d_viewcontext_init_object (ViewContext *vc, Object *obact)
 
Internal Object Utilities
static bool object_deselect_all_visible (ViewLayer *view_layer, View3D *v3d)
 
static bool object_deselect_all_except (ViewLayer *view_layer, Base *b)
 
Internal Edit-Mesh Select Buffer Wrapper

Avoid duplicate code when using edit-mode selection, actual logic is handled outside of this function.

Note
Currently this #EDBMSelectID_Context which is mesh specific however the logic could also be used for non-meshes too.
static void editselect_buf_cache_init (ViewContext *vc, short select_mode)
 
static void editselect_buf_cache_free (struct EditSelectBuf_Cache *esel)
 
static void editselect_buf_cache_free_voidp (void *esel_voidp)
 
static void editselect_buf_cache_init_with_generic_userdata (wmGenericUserData *wm_userdata, ViewContext *vc, short select_mode)
 
Internal Edit-Mesh Utilities
static bool edbm_backbuf_check_and_select_verts (struct EditSelectBuf_Cache *esel, Depsgraph *depsgraph, Object *ob, BMEditMesh *em, const eSelectOp sel_op)
 
static bool edbm_backbuf_check_and_select_edges (struct EditSelectBuf_Cache *esel, Depsgraph *depsgraph, Object *ob, BMEditMesh *em, const eSelectOp sel_op)
 
static bool edbm_backbuf_check_and_select_faces (struct EditSelectBuf_Cache *esel, Depsgraph *depsgraph, Object *ob, BMEditMesh *em, const eSelectOp sel_op)
 
static bool edbm_backbuf_check_and_select_verts_obmode (Mesh *me, struct EditSelectBuf_Cache *esel, const eSelectOp sel_op)
 
static bool edbm_backbuf_check_and_select_faces_obmode (Mesh *me, struct EditSelectBuf_Cache *esel, const eSelectOp sel_op)
 

Cursor Picking

#define SEL_MENU_SIZE   22
 
typedef struct SelMenuItemF SelMenuItemF
 
static SelMenuItemF object_mouse_select_menu_data [SEL_MENU_SIZE]
 
static const EnumPropertyItemobject_select_menu_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
static int object_select_menu_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_select_menu (wmOperatorType *ot)
 
static Baseobject_mouse_select_menu (bContext *C, ViewContext *vc, const uint *buffer, int hits, const int mval[2], bool extend, bool deselect, bool toggle)
 
static int bone_select_menu_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_bone_select_menu (wmOperatorType *ot)
 
static bool bone_mouse_select_menu (bContext *C, const uint *buffer, const int hits, const bool is_editmode, const bool extend, const bool deselect, const bool toggle)
 
static bool selectbuffer_has_bones (const uint *buffer, const uint hits)
 
static int selectbuffer_ret_hits_15 (uint *UNUSED(buffer), const int hits15)
 
static int selectbuffer_ret_hits_9 (uint *buffer, const int hits15, const int hits9)
 
static int selectbuffer_ret_hits_5 (uint *buffer, const int hits15, const int hits9, const int hits5)
 
static int mixed_bones_object_selectbuffer (ViewContext *vc, uint *buffer, const int mval[2], eV3DSelectObjectFilter select_filter, bool do_nearest, bool do_nearest_xray_if_supported)
 
static int mixed_bones_object_selectbuffer_extended (ViewContext *vc, uint *buffer, const int mval[2], eV3DSelectObjectFilter select_filter, bool use_cycle, bool enumerate, bool *r_do_nearest)
 
static Basemouse_select_eval_buffer (ViewContext *vc, const uint *buffer, int hits, Base *startbase, bool has_bones, bool do_nearest)
 
BaseED_view3d_give_base_under_cursor (bContext *C, const int mval[2])
 
ObjectED_view3d_give_object_under_cursor (bContext *C, const int mval[2])
 
bool ED_view3d_is_object_under_cursor (bContext *C, const int mval[2])
 
static void deselect_all_tracks (MovieTracking *tracking)
 
static bool ed_object_select_pick (bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool obcenter, bool enumerate, bool object)
 
static bool ed_wpaint_vertex_select_pick (bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, Object *obact)
 
static int view3d_select_exec (bContext *C, wmOperator *op)
 
static int view3d_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void VIEW3D_OT_select (wmOperatorType *ot)
 

Lasso Select

typedef struct LassoSelectUserData LassoSelectUserData
 
static void view3d_userdata_lassoselect_init (LassoSelectUserData *r_data, ViewContext *vc, const rcti *rect, const int(*mcoords)[2], const int mcoords_len, const eSelectOp sel_op)
 
static bool view3d_selectable_data (bContext *C)
 
static bool edge_fully_inside_rect (const rctf *rect, const float v1[2], const float v2[2])
 
static bool edge_inside_rect (const rctf *rect, const float v1[2], const float v2[2])
 
static void do_lasso_select_pose__do_tag (void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
 
static void do_lasso_tag_pose (ViewContext *vc, Object *ob, const int mcoords[][2], const int mcoords_len)
 
static bool do_lasso_select_objects (ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static Base ** do_pose_tag_select_op_prepare (ViewContext *vc, uint *r_bases_len)
 
static bool do_pose_tag_select_op_exec (Base **bases, const uint bases_len, const eSelectOp sel_op)
 
static bool do_lasso_select_pose (ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static void do_lasso_select_mesh__doSelectVert (void *userData, BMVert *eve, const float screen_co[2], int UNUSED(index))
 
static void do_lasso_select_mesh__doSelectEdge_pass0 (void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
 
static void do_lasso_select_mesh__doSelectEdge_pass1 (void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
 
static void do_lasso_select_mesh__doSelectFace (void *userData, BMFace *efa, const float screen_co[2], int UNUSED(index))
 
static bool do_lasso_select_mesh (ViewContext *vc, wmGenericUserData *wm_userdata, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static void do_lasso_select_curve__doSelect (void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, bool handles_visible, const float screen_co[2])
 
static bool do_lasso_select_curve (ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static void do_lasso_select_lattice__doSelect (void *userData, BPoint *bp, const float screen_co[2])
 
static bool do_lasso_select_lattice (ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static void do_lasso_select_armature__doSelectBone (void *userData, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
 
static bool do_lasso_select_armature (ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static void do_lasso_select_mball__doSelectElem (void *userData, struct MetaElem *ml, const float screen_co[2])
 
static bool do_lasso_select_meta (ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static void do_lasso_select_meshobject__doSelectVert (void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
 
static bool do_lasso_select_paintvert (ViewContext *vc, wmGenericUserData *wm_userdata, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static bool do_lasso_select_paintface (ViewContext *vc, wmGenericUserData *wm_userdata, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static bool view3d_lasso_select (bContext *C, ViewContext *vc, const int mcoords[][2], const int mcoords_len, const eSelectOp sel_op)
 
static int view3d_lasso_select_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_select_lasso (wmOperatorType *ot)
 

Box Select

typedef struct BoxSelectUserData BoxSelectUserData
 
static void view3d_userdata_boxselect_init (BoxSelectUserData *r_data, ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
 
bool edge_inside_circle (const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
 
static void do_paintvert_box_select__doSelectVert (void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
 
static bool do_paintvert_box_select (ViewContext *vc, wmGenericUserData *wm_userdata, const rcti *rect, const eSelectOp sel_op)
 
static bool do_paintface_box_select (ViewContext *vc, wmGenericUserData *wm_userdata, const rcti *rect, int sel_op)
 
static void do_nurbs_box_select__doSelect (void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, bool handles_visible, const float screen_co[2])
 
static bool do_nurbs_box_select (ViewContext *vc, rcti *rect, const eSelectOp sel_op)
 
static void do_lattice_box_select__doSelect (void *userData, BPoint *bp, const float screen_co[2])
 
static bool do_lattice_box_select (ViewContext *vc, rcti *rect, const eSelectOp sel_op)
 
static void do_mesh_box_select__doSelectVert (void *userData, BMVert *eve, const float screen_co[2], int UNUSED(index))
 
static void do_mesh_box_select__doSelectEdge_pass0 (void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
 
static void do_mesh_box_select__doSelectEdge_pass1 (void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
 
static void do_mesh_box_select__doSelectFace (void *userData, BMFace *efa, const float screen_co[2], int UNUSED(index))
 
static bool do_mesh_box_select (ViewContext *vc, wmGenericUserData *wm_userdata, const rcti *rect, const eSelectOp sel_op)
 
static bool do_meta_box_select (ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
 
static bool do_armature_box_select (ViewContext *vc, const rcti *rect, const eSelectOp sel_op)
 
static int opengl_bone_select_buffer_cmp (const void *sel_a_p, const void *sel_b_p)
 
static bool do_object_box_select (bContext *C, ViewContext *vc, rcti *rect, const eSelectOp sel_op)
 
static bool do_pose_box_select (bContext *C, ViewContext *vc, rcti *rect, const eSelectOp sel_op)
 
static int view3d_box_select_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_select_box (wmOperatorType *ot)
 

Circle Select

typedef struct CircleSelectUserData CircleSelectUserData
 
static void view3d_userdata_circleselect_init (CircleSelectUserData *r_data, ViewContext *vc, const bool select, const int mval[2], const float rad)
 
static void mesh_circle_doSelectVert (void *userData, BMVert *eve, const float screen_co[2], int UNUSED(index))
 
static void mesh_circle_doSelectEdge (void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int UNUSED(index))
 
static void mesh_circle_doSelectFace (void *userData, BMFace *efa, const float screen_co[2], int UNUSED(index))
 
static bool mesh_circle_select (ViewContext *vc, wmGenericUserData *wm_userdata, eSelectOp sel_op, const int mval[2], float rad)
 
static bool paint_facesel_circle_select (ViewContext *vc, wmGenericUserData *wm_userdata, const eSelectOp sel_op, const int mval[2], float rad)
 
static void paint_vertsel_circle_select_doSelectVert (void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
 
static bool paint_vertsel_circle_select (ViewContext *vc, wmGenericUserData *wm_userdata, const eSelectOp sel_op, const int mval[2], float rad)
 
static void nurbscurve_circle_doSelect (void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, bool UNUSED(handles_visible), const float screen_co[2])
 
static bool nurbscurve_circle_select (ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
 
static void latticecurve_circle_doSelect (void *userData, BPoint *bp, const float screen_co[2])
 
static bool lattice_circle_select (ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
 
static bool pchan_circle_doSelectJoint (void *userData, bPoseChannel *pchan, const float screen_co[2])
 
static void do_circle_select_pose__doSelectBone (void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
 
static bool pose_circle_select (ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
 
static bool armature_circle_doSelectJoint (void *userData, EditBone *ebone, const float screen_co[2], bool head)
 
static void do_circle_select_armature__doSelectBone (void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
 
static bool armature_circle_select (ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
 
static void do_circle_select_mball__doSelectElem (void *userData, struct MetaElem *ml, const float screen_co[2])
 
static bool mball_circle_select (ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
 
static bool obedit_circle_select (bContext *C, ViewContext *vc, wmGenericUserData *wm_userdata, const eSelectOp sel_op, const int mval[2], float rad)
 
static bool object_circle_select (ViewContext *vc, const eSelectOp sel_op, const int mval[2], float rad)
 
static int view3d_circle_select_exec (bContext *C, wmOperator *op)
 
void VIEW3D_OT_select_circle (wmOperatorType *ot)
 

Macro Definition Documentation

◆ SEL_MENU_SIZE

#define SEL_MENU_SIZE   22

Definition at line 1440 of file view3d_select.c.

Typedef Documentation

◆ BoxSelectUserData

◆ CircleSelectUserData

◆ LassoSelectUserData

◆ SelMenuItemF

typedef struct SelMenuItemF SelMenuItemF

Function Documentation

◆ armature_circle_doSelectJoint()

static bool armature_circle_doSelectJoint ( void *  userData,
EditBone ebone,
const float  screen_co[2],
bool  head 
)
static

◆ armature_circle_select()

static bool armature_circle_select ( ViewContext vc,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ bone_mouse_select_menu()

static bool bone_mouse_select_menu ( bContext C,
const uint buffer,
const int  hits,
const bool  is_editmode,
const bool  extend,
const bool  deselect,
const bool  toggle 
)
static

◆ bone_select_menu_exec()

static int bone_select_menu_exec ( bContext C,
wmOperator op 
)
static

◆ deselect_all_tracks()

static void deselect_all_tracks ( MovieTracking tracking)
static

◆ do_armature_box_select()

static bool do_armature_box_select ( ViewContext vc,
const rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_circle_select_armature__doSelectBone()

static void do_circle_select_armature__doSelectBone ( void *  userData,
struct EditBone ebone,
const float  screen_co_a[2],
const float  screen_co_b[2] 
)
static

◆ do_circle_select_mball__doSelectElem()

static void do_circle_select_mball__doSelectElem ( void *  userData,
struct MetaElem ml,
const float  screen_co[2] 
)
static

Definition at line 4193 of file view3d_select.c.

References data, MetaElem::flag, len_squared_v2v2(), and SELECT.

Referenced by mball_circle_select().

◆ do_circle_select_pose__doSelectBone()

static void do_circle_select_pose__doSelectBone ( void *  userData,
struct bPoseChannel pchan,
const float  screen_co_a[2],
const float  screen_co_b[2] 
)
static

◆ do_lasso_select_armature()

static bool do_lasso_select_armature ( ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_armature__doSelectBone()

static void do_lasso_select_armature__doSelectBone ( void *  userData,
EditBone ebone,
const float  screen_co_a[2],
const float  screen_co_b[2] 
)
static

◆ do_lasso_select_curve()

static bool do_lasso_select_curve ( ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_curve__doSelect()

static void do_lasso_select_curve__doSelect ( void *  userData,
Nurb UNUSEDnu,
BPoint bp,
BezTriple bezt,
int  beztindex,
bool  handles_visible,
const float  screen_co[2] 
)
static

◆ do_lasso_select_lattice()

static bool do_lasso_select_lattice ( ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_lattice__doSelect()

static void do_lasso_select_lattice__doSelect ( void *  userData,
BPoint bp,
const float  screen_co[2] 
)
static

◆ do_lasso_select_mball__doSelectElem()

static void do_lasso_select_mball__doSelectElem ( void *  userData,
struct MetaElem ml,
const float  screen_co[2] 
)
static

◆ do_lasso_select_mesh()

static bool do_lasso_select_mesh ( ViewContext vc,
wmGenericUserData wm_userdata,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_mesh__doSelectEdge_pass0()

static void do_lasso_select_mesh__doSelectEdge_pass0 ( void *  user_data,
BMEdge eed,
const float  screen_co_a[2],
const float  screen_co_b[2],
int  index 
)
static

◆ do_lasso_select_mesh__doSelectEdge_pass1()

static void do_lasso_select_mesh__doSelectEdge_pass1 ( void *  user_data,
BMEdge eed,
const float  screen_co_a[2],
const float  screen_co_b[2],
int  index 
)
static

◆ do_lasso_select_mesh__doSelectFace()

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

◆ do_lasso_select_mesh__doSelectVert()

static void do_lasso_select_mesh__doSelectVert ( void *  userData,
BMVert eve,
const float  screen_co[2],
int   UNUSEDindex 
)
static

◆ do_lasso_select_meshobject__doSelectVert()

static void do_lasso_select_meshobject__doSelectVert ( void *  userData,
MVert mv,
const float  screen_co[2],
int   UNUSEDindex 
)
static

◆ do_lasso_select_meta()

static bool do_lasso_select_meta ( ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_objects()

static bool do_lasso_select_objects ( ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_paintface()

static bool do_lasso_select_paintface ( ViewContext vc,
wmGenericUserData wm_userdata,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_paintvert()

static bool do_lasso_select_paintvert ( ViewContext vc,
wmGenericUserData wm_userdata,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_pose()

static bool do_lasso_select_pose ( ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ do_lasso_select_pose__do_tag()

static void do_lasso_select_pose__do_tag ( void *  userData,
struct bPoseChannel pchan,
const float  screen_co_a[2],
const float  screen_co_b[2] 
)
static

◆ do_lasso_tag_pose()

static void do_lasso_tag_pose ( ViewContext vc,
Object ob,
const int  mcoords[][2],
const int  mcoords_len 
)
static

◆ do_lattice_box_select()

static bool do_lattice_box_select ( ViewContext vc,
rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_lattice_box_select__doSelect()

static void do_lattice_box_select__doSelect ( void *  userData,
BPoint bp,
const float  screen_co[2] 
)
static

◆ do_mesh_box_select()

static bool do_mesh_box_select ( ViewContext vc,
wmGenericUserData wm_userdata,
const rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_mesh_box_select__doSelectEdge_pass0()

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

◆ do_mesh_box_select__doSelectEdge_pass1()

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

◆ do_mesh_box_select__doSelectFace()

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

◆ do_mesh_box_select__doSelectVert()

static void do_mesh_box_select__doSelectVert ( void *  userData,
BMVert eve,
const float  screen_co[2],
int   UNUSEDindex 
)
static

◆ do_meta_box_select()

static bool do_meta_box_select ( ViewContext vc,
const rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_nurbs_box_select()

static bool do_nurbs_box_select ( ViewContext vc,
rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_nurbs_box_select__doSelect()

static void do_nurbs_box_select__doSelect ( void *  userData,
Nurb UNUSEDnu,
BPoint bp,
BezTriple bezt,
int  beztindex,
bool  handles_visible,
const float  screen_co[2] 
)
static

◆ do_object_box_select()

static bool do_object_box_select ( bContext C,
ViewContext vc,
rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_paintface_box_select()

static bool do_paintface_box_select ( ViewContext vc,
wmGenericUserData wm_userdata,
const rcti rect,
int  sel_op 
)
static

◆ do_paintvert_box_select()

static bool do_paintvert_box_select ( ViewContext vc,
wmGenericUserData wm_userdata,
const rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_paintvert_box_select__doSelectVert()

static void do_paintvert_box_select__doSelectVert ( void *  userData,
MVert mv,
const float  screen_co[2],
int   UNUSEDindex 
)
static

◆ do_pose_box_select()

static bool do_pose_box_select ( bContext C,
ViewContext vc,
rcti rect,
const eSelectOp  sel_op 
)
static

◆ do_pose_tag_select_op_exec()

static bool do_pose_tag_select_op_exec ( Base **  bases,
const uint  bases_len,
const eSelectOp  sel_op 
)
static

◆ do_pose_tag_select_op_prepare()

static Base** do_pose_tag_select_op_prepare ( ViewContext vc,
uint r_bases_len 
)
static

◆ ed_object_select_pick()

static bool ed_object_select_pick ( bContext C,
const int  mval[2],
bool  extend,
bool  deselect,
bool  toggle,
bool  obcenter,
bool  enumerate,
bool  object 
)
static

Definition at line 2223 of file view3d_select.c.

References BA_DESELECT, BA_SELECT, BASACT, BASE_SELECTABLE, BASE_SELECTED, BKE_object_is_mode_compat(), BKE_object_movieclip_get(), BKE_tracking_track_deselect(), BKE_tracking_track_get_indexed(), BKE_tracking_track_select(), BLI_assert, bone_mouse_select_menu(), buffer, C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_view3d(), DEG_id_tag_update(), depsgraph, ViewContext::depsgraph, deselect_all_tracks(), ED_armature_pose_select_in_wpaint_mode(), ED_armature_pose_select_pick_with_buffer(), ED_gpencil_toggle_brush_cursor(), ED_object_base_activate(), ED_object_base_select(), ED_object_mode_generic_exit(), ED_view3d_project_float_global(), ED_view3d_select_dist_px(), ED_view3d_select_filter_from_mode(), ED_view3d_viewcontext_init(), ELEM, FIRSTBASE, float(), MovieClip::id, Scene::id, ID_RECALC_BASE_FLAGS, ID_RECALC_SELECT, len_manhattan_v2v2(), MAXPICKBUF, mixed_bones_object_selectbuffer_extended(), Object::mode, mouse_select_eval_buffer(), NC_MOVIECLIP, NC_OBJECT, NC_SCENE, ND_BONE_ACTIVE, ND_BONE_SELECT, ND_OB_SELECT, ND_SELECT, Base::next, NULL, OB_CAMERA, OB_GPENCIL, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_OBJECT, OB_MODE_PAINT_GPENCIL, OB_MODE_POSE, OB_MODE_SCULPT_GPENCIL, OB_MODE_VERTEX_GPENCIL, OB_MODE_WEIGHT_GPENCIL, ViewContext::obact, ViewContext::obedit, Base::object, object_deselect_all_except(), ToolSettings::object_flag, object_mouse_select_menu(), Object::obmat, SCE_OBJECT_MODE_LOCK, scene, selectbuffer_has_bones(), Scene::toolsettings, TRACK_AREA_ALL, TRACK_SELECTED, MovieClip::tracking, Object::type, V3D_PROJ_RET_OK, V3D_PROJ_TEST_CLIP_DEFAULT, VIEW3D_SELECT_FILTER_NOP, WM_event_add_notifier(), and WM_toolsystem_update_from_context_view3d().

Referenced by view3d_select_exec().

◆ ED_view3d_give_base_under_cursor()

Base* ED_view3d_give_base_under_cursor ( bContext C,
const int  mval[2] 
)

◆ ED_view3d_give_object_under_cursor()

Object* ED_view3d_give_object_under_cursor ( bContext C,
const int  mval[2] 
)

◆ ED_view3d_is_object_under_cursor()

bool ED_view3d_is_object_under_cursor ( bContext C,
const int  mval[2] 
)

Definition at line 2198 of file view3d_select.c.

References C, ED_view3d_give_object_under_cursor(), and NULL.

Referenced by view3d_ima_bg_drop_poll().

◆ ED_view3d_select_dist_px()

float ED_view3d_select_dist_px ( void  )

◆ ED_view3d_viewcontext_init()

void ED_view3d_viewcontext_init ( bContext C,
ViewContext vc,
Depsgraph depsgraph 
)

Definition at line 123 of file view3d_select.c.

References ViewContext::bmain, ViewContext::C, C, CTX_data_active_object(), CTX_data_edit_object(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), CTX_wm_window(), depsgraph, ViewContext::depsgraph, ViewContext::obact, ViewContext::obedit, ViewContext::region, ViewContext::rv3d, ViewContext::scene, ViewContext::v3d, ViewContext::view_layer, and ViewContext::win.

Referenced by add_vertex_invoke(), clip_planes_from_rect(), curve_draw_init(), ED_armature_edit_deselect_all_visible_multi(), ED_armature_edit_select_pick(), ed_armature_pick_bone_impl(), ED_curve_deselect_all_multi(), ED_curve_editfont_select_pick(), ED_curve_editnurb_select_pick(), ED_lattice_deselect_all_multi(), ED_lattice_select_pick(), ED_mball_deselect_all_multi(), ED_mball_select_pick(), ED_mesh_pick_face(), ED_mesh_pick_vert(), ed_object_select_pick(), ED_pose_deselect_all_multi(), ED_view3d_give_base_under_cursor(), EDBM_mesh_deselect_all_multi(), EDBM_selectmode_disable_multi(), edcu_shortest_path_pick_invoke(), em_setup_viewcontext(), object_transform_axis_target_invoke(), paint_cursor_context_init(), paint_sample_color(), paint_stroke_new(), PE_set_view3d_data(), sample_detail(), SCULPT_cursor_geometry_info_update(), SCULPT_filter_cache_init(), sculpt_gesture_context_init_common(), SCULPT_stroke_get_location(), select_linked_pick_invoke(), texture_paint_init(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select_exec(), view3d_select_exec(), vpaint_stroke_test_start(), weight_paint_sample_enum_itemf(), weight_sample_group_exec(), weight_sample_invoke(), and wpaint_stroke_test_start().

◆ ED_view3d_viewcontext_init_object()

void ED_view3d_viewcontext_init_object ( ViewContext vc,
Object obact 
)

◆ ed_wpaint_vertex_select_pick()

static bool ed_wpaint_vertex_select_pick ( bContext C,
const int  mval[2],
bool  extend,
bool  deselect,
bool  toggle,
Object obact 
)
static

◆ edbm_backbuf_check_and_select_edges()

static bool edbm_backbuf_check_and_select_edges ( struct EditSelectBuf_Cache esel,
Depsgraph depsgraph,
Object ob,
BMEditMesh em,
const eSelectOp  sel_op 
)
static

◆ edbm_backbuf_check_and_select_faces()

static bool edbm_backbuf_check_and_select_faces ( struct EditSelectBuf_Cache esel,
Depsgraph depsgraph,
Object ob,
BMEditMesh em,
const eSelectOp  sel_op 
)
static

◆ edbm_backbuf_check_and_select_faces_obmode()

static bool edbm_backbuf_check_and_select_faces_obmode ( Mesh me,
struct EditSelectBuf_Cache esel,
const eSelectOp  sel_op 
)
static

◆ edbm_backbuf_check_and_select_verts()

static bool edbm_backbuf_check_and_select_verts ( struct EditSelectBuf_Cache esel,
Depsgraph depsgraph,
Object ob,
BMEditMesh em,
const eSelectOp  sel_op 
)
static

◆ edbm_backbuf_check_and_select_verts_obmode()

static bool edbm_backbuf_check_and_select_verts_obmode ( Mesh me,
struct EditSelectBuf_Cache esel,
const eSelectOp  sel_op 
)
static

◆ edge_fully_inside_rect()

static bool edge_fully_inside_rect ( const rctf rect,
const float  v1[2],
const float  v2[2] 
)
static

◆ edge_inside_circle()

bool edge_inside_circle ( const float  cent[2],
float  radius,
const float  screen_co_a[2],
const float  screen_co_b[2] 
)

◆ edge_inside_rect()

static bool edge_inside_rect ( const rctf rect,
const float  v1[2],
const float  v2[2] 
)
static

◆ editselect_buf_cache_free()

static void editselect_buf_cache_free ( struct EditSelectBuf_Cache esel)
static

Definition at line 222 of file view3d_select.c.

References MEM_SAFE_FREE, and EditSelectBuf_Cache::select_bitmap.

Referenced by editselect_buf_cache_free_voidp().

◆ editselect_buf_cache_free_voidp()

static void editselect_buf_cache_free_voidp ( void *  esel_voidp)
static

◆ editselect_buf_cache_init()

static void editselect_buf_cache_init ( ViewContext vc,
short  select_mode 
)
static

◆ editselect_buf_cache_init_with_generic_userdata()

static void editselect_buf_cache_init_with_generic_userdata ( wmGenericUserData wm_userdata,
ViewContext vc,
short  select_mode 
)
static

◆ lattice_circle_select()

static bool lattice_circle_select ( ViewContext vc,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ latticecurve_circle_doSelect()

static void latticecurve_circle_doSelect ( void *  userData,
BPoint bp,
const float  screen_co[2] 
)
static

Definition at line 3965 of file view3d_select.c.

References data, BPoint::f1, len_squared_v2v2(), and SELECT.

Referenced by lattice_circle_select().

◆ mball_circle_select()

static bool mball_circle_select ( ViewContext vc,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ mesh_circle_doSelectEdge()

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

Definition at line 3688 of file view3d_select.c.

References BM_edge_select_set(), data, and edge_inside_circle().

Referenced by mesh_circle_select().

◆ mesh_circle_doSelectFace()

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

Definition at line 3701 of file view3d_select.c.

References BM_face_select_set(), data, and len_squared_v2v2().

Referenced by mesh_circle_select().

◆ mesh_circle_doSelectVert()

static void mesh_circle_doSelectVert ( void *  userData,
BMVert eve,
const float  screen_co[2],
int   UNUSEDindex 
)
static

Definition at line 3676 of file view3d_select.c.

References BM_vert_select_set(), data, and len_squared_v2v2().

Referenced by mesh_circle_select().

◆ mesh_circle_select()

static bool mesh_circle_select ( ViewContext vc,
wmGenericUserData wm_userdata,
eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ mixed_bones_object_selectbuffer()

static int mixed_bones_object_selectbuffer ( ViewContext vc,
uint buffer,
const int  mval[2],
eV3DSelectObjectFilter  select_filter,
bool  do_nearest,
bool  do_nearest_xray_if_supported 
)
static

Populate a select buffer with objects and bones, if there are any. Checks three selection levels and compare.

Parameters
do_nearest_xray_if_supportedWhen set, read in hits that don't stop at the nearest surface. The hits must still be ordered by depth. Needed so we can step to the next, non-active object when it's already selected, see: T76445.

Definition at line 1923 of file view3d_select.c.

References BLI_rcti_init_pt_radius(), buffer, MAXPICKBUF, selectbuffer_has_bones(), selectbuffer_ret_hits_15(), selectbuffer_ret_hits_5(), selectbuffer_ret_hits_9(), USER_GPU_FLAG_NO_DEPT_PICK, view3d_opengl_select(), view3d_opengl_select_cache_begin(), view3d_opengl_select_cache_end(), VIEW3D_SELECT_PICK_ALL, and VIEW3D_SELECT_PICK_NEAREST.

Referenced by ED_view3d_give_base_under_cursor(), mixed_bones_object_selectbuffer_extended(), and view3d_select_exec().

◆ mixed_bones_object_selectbuffer_extended()

static int mixed_bones_object_selectbuffer_extended ( ViewContext vc,
uint buffer,
const int  mval[2],
eV3DSelectObjectFilter  select_filter,
bool  use_cycle,
bool  enumerate,
bool *  r_do_nearest 
)
static

◆ mouse_select_eval_buffer()

static Base* mouse_select_eval_buffer ( ViewContext vc,
const uint buffer,
int  hits,
Base startbase,
bool  has_bones,
bool  do_nearest 
)
static
Parameters
has_bonesWhen true, skip non-bone hits, also allow bases to be used that are visible but not select-able, since you may be in pose mode with an unselect-able object.
Returns
the active base or NULL.

Definition at line 2058 of file view3d_select.c.

References Freestyle::a, BASACT, BASE_SELECTABLE, BASE_SELECTED, BASE_VISIBLE, BASE_VISIBLE_VIEWLAYER, buffer, FIRSTBASE, Base::flag, min, Base::next, NULL, Base::object, Object::runtime, Object_Runtime::select_id, ViewContext::v3d, and ViewContext::view_layer.

Referenced by ed_object_select_pick(), and ED_view3d_give_base_under_cursor().

◆ nurbscurve_circle_doSelect()

static void nurbscurve_circle_doSelect ( void *  userData,
Nurb UNUSEDnu,
BPoint bp,
BezTriple bezt,
int  beztindex,
bool   UNUSEDhandles_visible,
const float  screen_co[2] 
)
static

◆ nurbscurve_circle_select()

static bool nurbscurve_circle_select ( ViewContext vc,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ obedit_circle_select()

static bool obedit_circle_select ( bContext C,
ViewContext vc,
wmGenericUserData wm_userdata,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ object_circle_select()

static bool object_circle_select ( ViewContext vc,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ object_deselect_all_except()

static bool object_deselect_all_except ( ViewLayer view_layer,
Base b 
)
static

◆ object_deselect_all_visible()

static bool object_deselect_all_visible ( ViewLayer view_layer,
View3D v3d 
)
static

◆ object_mouse_select_menu()

static Base* object_mouse_select_menu ( bContext C,
ViewContext vc,
const uint buffer,
int  hits,
const int  mval[2],
bool  extend,
bool  deselect,
bool  toggle 
)
static

◆ object_select_menu_enum_itemf()

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

◆ object_select_menu_exec()

static int object_select_menu_exec ( bContext C,
wmOperator op 
)
static

◆ opengl_bone_select_buffer_cmp()

static int opengl_bone_select_buffer_cmp ( const void *  sel_a_p,
const void *  sel_b_p 
)
static

Compare result of 'GPU_select': 'uint[4]', needed for when we need to align with object draw-order.

Definition at line 3339 of file view3d_select.c.

References BLI_endian_switch_uint32().

Referenced by do_object_box_select(), and do_pose_box_select().

◆ paint_facesel_circle_select()

static bool paint_facesel_circle_select ( ViewContext vc,
wmGenericUserData wm_userdata,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ paint_vertsel_circle_select()

static bool paint_vertsel_circle_select ( ViewContext vc,
wmGenericUserData wm_userdata,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ paint_vertsel_circle_select_doSelectVert()

static void paint_vertsel_circle_select_doSelectVert ( void *  userData,
MVert mv,
const float  screen_co[2],
int   UNUSEDindex 
)
static

Definition at line 3835 of file view3d_select.c.

References data, len_squared_v2v2(), SELECT, and SET_FLAG_FROM_TEST.

Referenced by paint_vertsel_circle_select().

◆ pchan_circle_doSelectJoint()

static bool pchan_circle_doSelectJoint ( void *  userData,
bPoseChannel pchan,
const float  screen_co[2] 
)
static

◆ pose_circle_select()

static bool pose_circle_select ( ViewContext vc,
const eSelectOp  sel_op,
const int  mval[2],
float  rad 
)
static

◆ selectbuffer_has_bones()

static bool selectbuffer_has_bones ( const uint buffer,
const uint  hits 
)
static

◆ selectbuffer_ret_hits_15()

static int selectbuffer_ret_hits_15 ( uint UNUSEDbuffer,
const int  hits15 
)
static

Definition at line 1893 of file view3d_select.c.

Referenced by mixed_bones_object_selectbuffer().

◆ selectbuffer_ret_hits_5()

static int selectbuffer_ret_hits_5 ( uint buffer,
const int  hits15,
const int  hits9,
const int  hits5 
)
static

Definition at line 1905 of file view3d_select.c.

References buffer.

Referenced by mixed_bones_object_selectbuffer().

◆ selectbuffer_ret_hits_9()

static int selectbuffer_ret_hits_9 ( uint buffer,
const int  hits15,
const int  hits9 
)
static

Definition at line 1898 of file view3d_select.c.

References buffer.

Referenced by mixed_bones_object_selectbuffer().

◆ view3d_box_select_exec()

static int view3d_box_select_exec ( bContext C,
wmOperator op 
)
static

◆ view3d_circle_select_exec()

static int view3d_circle_select_exec ( bContext C,
wmOperator op 
)
static

◆ view3d_lasso_select()

static bool view3d_lasso_select ( bContext C,
ViewContext vc,
const int  mcoords[][2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

◆ view3d_lasso_select_exec()

static int view3d_lasso_select_exec ( bContext C,
wmOperator op 
)
static

◆ VIEW3D_OT_bone_select_menu()

void VIEW3D_OT_bone_select_menu ( wmOperatorType ot)

◆ VIEW3D_OT_select()

void VIEW3D_OT_select ( wmOperatorType ot)

◆ VIEW3D_OT_select_box()

void VIEW3D_OT_select_box ( wmOperatorType ot)

◆ VIEW3D_OT_select_circle()

void VIEW3D_OT_select_circle ( wmOperatorType ot)

◆ VIEW3D_OT_select_lasso()

void VIEW3D_OT_select_lasso ( wmOperatorType ot)

◆ VIEW3D_OT_select_menu()

void VIEW3D_OT_select_menu ( wmOperatorType ot)

◆ view3d_select_exec()

static int view3d_select_exec ( bContext C,
wmOperator op 
)
static

Definition at line 2598 of file view3d_select.c.

References BKE_object_pose_armature_get(), BKE_object_update_select_id(), BKE_paint_select_elem_test(), BKE_paint_select_face_test(), BKE_paint_select_vert_test(), bone_mouse_select_menu(), buffer, C, center, CTX_data_active_object(), CTX_data_edit_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_id_tag_update(), depsgraph, ED_armature_edit_deselect_all_visible_multi(), ED_armature_edit_select_pick(), ED_curve_deselect_all_multi(), ED_curve_editfont_select_pick(), ED_curve_editnurb_select_pick(), ED_lattice_deselect_all_multi(), ED_lattice_select_pick(), ED_mball_deselect_all_multi(), ED_mball_select_pick(), ED_object_base_deselect_all(), ed_object_select_pick(), ED_outliner_select_sync_from_edit_bone_tag(), ED_outliner_select_sync_from_object_tag(), ED_outliner_select_sync_from_pose_bone_tag(), ED_pose_deselect_all_multi(), ED_pose_object_from_context(), ED_view3d_viewcontext_init(), ed_wpaint_vertex_select_pick(), EDBM_mesh_deselect_all_multi(), EDBM_select_pick(), ELEM, Scene::id, ID_RECALC_SELECT, MAXPICKBUF, mixed_bones_object_selectbuffer(), Object::mode, NC_GEOM, NC_SCENE, ND_OB_SELECT, ND_SELECT, NULL, OB_ARMATURE, OB_CURVE, OB_FONT, OB_LATTICE, OB_MBALL, OB_MESH, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_PARTICLE_EDIT, OB_MODE_POSE, OB_SURF, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, paintface_deselect_all_visible(), paintface_mouse_select(), paintvert_deselect_all_visible(), paintvert_tag_select_update(), PE_deselect_all_visible(), PE_mouse_particles(), wmOperator::ptr, RNA_boolean_get(), RNA_int_get_array(), scene, SEL_DESELECT, Object::type, view3d_operator_needs_opengl(), VIEW3D_SELECT_FILTER_NOP, and WM_event_add_notifier().

Referenced by VIEW3D_OT_select(), and view3d_select_invoke().

◆ view3d_select_invoke()

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

Definition at line 2746 of file view3d_select.c.

References C, wmEvent::mval, wmOperator::ptr, RNA_int_set_array(), and view3d_select_exec().

Referenced by VIEW3D_OT_select().

◆ view3d_selectable_data()

static bool view3d_selectable_data ( bContext C)
static

◆ view3d_userdata_boxselect_init()

static void view3d_userdata_boxselect_init ( BoxSelectUserData r_data,
ViewContext vc,
const rcti rect,
const eSelectOp  sel_op 
)
static

◆ view3d_userdata_circleselect_init()

static void view3d_userdata_circleselect_init ( CircleSelectUserData r_data,
ViewContext vc,
const bool  select,
const int  mval[2],
const float  rad 
)
static

◆ view3d_userdata_lassoselect_init()

static void view3d_userdata_lassoselect_init ( LassoSelectUserData r_data,
ViewContext vc,
const rcti rect,
const int(*)  mcoords[2],
const int  mcoords_len,
const eSelectOp  sel_op 
)
static

Variable Documentation

◆ object_mouse_select_menu_data

SelMenuItemF object_mouse_select_menu_data[SEL_MENU_SIZE]
static