Blender V4.3
uvedit_select.cc File Reference
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "BLI_alloca.h"
#include "BLI_blenlib.h"
#include "BLI_hash.h"
#include "BLI_heap.h"
#include "BLI_kdopbvh.h"
#include "BLI_kdtree.h"
#include "BLI_lasso_2d.hh"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_memarena.h"
#include "BLI_polyfill_2d.h"
#include "BLI_polyfill_2d_beautify.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_editmesh.hh"
#include "BKE_layer.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_mesh_mapping.hh"
#include "BKE_report.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_image.hh"
#include "ED_mesh.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ED_uvedit.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "UI_view2d.hh"
#include "uvedit_intern.hh"

Go to the source code of this file.

Classes

struct  UVOverlapData
 

Macros

#define SET_SELECTION(value)
 
#define NEIGHBORING_FACE_IS_SEL   1
 
#define CURR_FACE_IS_UNSEL   2
 

Enumerations

enum  eUVSelectSimilar {
  UV_SSIM_AREA_UV = 1000 , UV_SSIM_AREA_3D , UV_SSIM_FACE , UV_SSIM_LENGTH_UV ,
  UV_SSIM_LENGTH_3D , UV_SSIM_MATERIAL , UV_SSIM_OBJECT , UV_SSIM_PIN ,
  UV_SSIM_SIDES , UV_SSIM_WINDING
}
 

Functions

static void uv_select_all_perform_multi_ex (const Scene *scene, Span< Object * > objects, int action, const Object *ob_exclude)
 
(De)Select All Operator
static void uv_select_all_perform (const Scene *scene, Object *obedit, int action)
 
static void uv_select_all_perform_multi (const Scene *scene, Span< Object * > objects, int action)
 
bool uvedit_select_is_any_selected (const Scene *scene, Object *obedit)
 
bool uvedit_select_is_any_selected_multi (const Scene *scene, const Span< Object * > objects)
 
static void uv_select_all (const Scene *scene, BMEditMesh *em, bool select_all)
 
static void uv_select_invert (const Scene *scene, BMEditMesh *em)
 
static void uv_select_all_perform_multi_ex (const Scene *scene, const Span< Object * > objects, int action, const Object *ob_exclude)
 
static int uv_select_all_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_all (wmOperatorType *ot)
 
Select/Tag Flushing Utils

Utility functions to flush the uv-selection from tags.

static void uv_select_flush_from_tag_face (const Scene *scene, Object *obedit, const bool select)
 
static void uv_select_flush_from_tag_loop (const Scene *scene, Object *obedit, const bool select)
 
static void uv_select_flush_from_loop_edge_flag (const Scene *scene, BMEditMesh *em)
 
static void uv_select_flush_from_tag_sticky_loc_internal (const Scene *scene, BMEditMesh *em, UvVertMap *vmap, const uint efa_index, BMLoop *l, const bool select, const BMUVOffsets offsets)
 
Select Split Operator
static void uv_select_tag_update_for_object (Depsgraph *depsgraph, const ToolSettings *ts, Object *obedit)
 
static int uv_select_split_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_split (wmOperatorType *ot)
 
Active Selection Tracking

Currently we don't store loops in the selection history, store face/edge/vert combinations (needed for UV path selection).

void ED_uvedit_active_vert_loop_set (BMesh *bm, BMLoop *l)
 
BMLoopED_uvedit_active_vert_loop_get (BMesh *bm)
 
void ED_uvedit_active_edge_loop_set (BMesh *bm, BMLoop *l)
 
BMLoopED_uvedit_active_edge_loop_get (BMesh *bm)
 
Visibility and Selection Utilities
char ED_uvedit_select_mode_get (const Scene *scene)
 
void ED_uvedit_select_sync_flush (const ToolSettings *ts, BMEditMesh *em, const bool select)
 
static void uvedit_vertex_select_tagged (BMEditMesh *em, Scene *scene, bool select, const BMUVOffsets offsets)
 
bool uvedit_face_visible_test_ex (const ToolSettings *ts, BMFace *efa)
 
bool uvedit_face_visible_test (const Scene *scene, BMFace *efa)
 
bool uvedit_face_select_test_ex (const ToolSettings *ts, BMFace *efa, const BMUVOffsets offsets)
 
bool uvedit_face_select_test (const Scene *scene, BMFace *efa, const BMUVOffsets offsets)
 
void uvedit_face_select_set_with_sticky (const Scene *scene, BMEditMesh *em, BMFace *efa, const bool select, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_face_select_shared_vert (const Scene *scene, BMEditMesh *em, BMFace *efa, const bool select, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_face_select_set (const Scene *scene, BMesh *bm, BMFace *efa, const bool select, const bool do_history, const BMUVOffsets offsets)
 Select UV Face.
 
void uvedit_face_select_enable (const Scene *scene, BMesh *bm, BMFace *efa, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_face_select_disable (const Scene *scene, BMesh *bm, BMFace *efa, const BMUVOffsets offsets)
 
bool uvedit_edge_select_test_ex (const ToolSettings *ts, const BMLoop *l, const BMUVOffsets offsets)
 
bool uvedit_edge_select_test (const Scene *scene, BMLoop *l, const BMUVOffsets offsets)
 
void uvedit_edge_select_set_with_sticky (const Scene *scene, BMEditMesh *em, BMLoop *l, const bool select, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_edge_select_shared_vert (const Scene *scene, BMEditMesh *em, BMLoop *l, const bool select, const int sticky_flag, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_edge_select_set_noflush (const Scene *scene, BMLoop *l, const bool select, const int sticky_flag, const BMUVOffsets offsets)
 
void uvedit_edge_select_set (const Scene *scene, BMesh *bm, BMLoop *l, const bool select, const bool do_history, const BMUVOffsets offsets)
 Select UV Edge.
 
void uvedit_edge_select_enable (const Scene *scene, BMesh *bm, BMLoop *l, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_edge_select_disable (const Scene *scene, BMesh *bm, BMLoop *l, const BMUVOffsets offsets)
 
bool uvedit_uv_select_test_ex (const ToolSettings *ts, const BMLoop *l, const BMUVOffsets offsets)
 
bool uvedit_uv_select_test (const Scene *scene, BMLoop *l, const BMUVOffsets offsets)
 
void uvedit_uv_select_set_with_sticky (const Scene *scene, BMEditMesh *em, BMLoop *l, const bool select, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_uv_select_shared_vert (const Scene *scene, BMEditMesh *em, BMLoop *l, const bool select, const int sticky_flag, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_uv_select_set (const Scene *scene, BMesh *bm, BMLoop *l, const bool select, const bool do_history, const BMUVOffsets offsets)
 Select UV Vertex.
 
void uvedit_uv_select_enable (const Scene *scene, BMesh *bm, BMLoop *l, const bool do_history, const BMUVOffsets offsets)
 
void uvedit_uv_select_disable (const Scene *scene, BMesh *bm, BMLoop *l, const BMUVOffsets offsets)
 
static BMLoopuvedit_loop_find_other_radial_loop_with_visible_face (const Scene *scene, BMLoop *l_src, const BMUVOffsets offsets)
 
static BMLoopuvedit_loop_find_other_boundary_loop_with_visible_face (const Scene *scene, BMLoop *l_edge, BMVert *v_pivot, const BMUVOffsets offsets)
 
Find Nearest Elements
UvNearestHit uv_nearest_hit_init_dist_px (const View2D *v2d, const float dist_px)
 
UvNearestHit uv_nearest_hit_init_max (const View2D *v2d)
 
UvNearestHit uv_nearest_hit_init_max_default ()
 
bool uv_find_nearest_edge (Scene *scene, Object *obedit, const float co[2], const float penalty, UvNearestHit *hit)
 
bool uv_find_nearest_edge_multi (Scene *scene, const Span< Object * > objects, const float co[2], const float penalty, UvNearestHit *hit)
 
bool uv_find_nearest_face_ex (Scene *scene, Object *obedit, const float co[2], UvNearestHit *hit, const bool only_in_face)
 
bool uv_find_nearest_face (Scene *scene, Object *obedit, const float co[2], UvNearestHit *hit)
 
bool uv_find_nearest_face_multi_ex (Scene *scene, const Span< Object * > objects, const float co[2], UvNearestHit *hit, const bool only_in_face)
 
bool uv_find_nearest_face_multi (Scene *scene, const Span< Object * > objects, const float co[2], UvNearestHit *hit)
 
static bool uv_nearest_between (const BMLoop *l, const float co[2], const int cd_loop_uv_offset)
 
bool uv_find_nearest_vert (Scene *scene, Object *obedit, float const co[2], const float penalty_dist, UvNearestHit *hit)
 
bool uv_find_nearest_vert_multi (Scene *scene, const Span< Object * > objects, float const co[2], const float penalty_dist, UvNearestHit *hit)
 
static bool uvedit_nearest_uv (const Scene *scene, Object *obedit, const float co[2], const float scale[2], const bool ignore_selected, float *dist_sq, float r_uv[2])
 
bool ED_uvedit_nearest_uv_multi (const View2D *v2d, const Scene *scene, const Span< Object * > objects, const float mval_fl[2], const bool ignore_selected, float *dist_sq, float r_uv[2])
 
Find Nearest to Element

These functions are quite specialized, useful when sync select is enabled and we want to pick an active UV vertex/edge from the active element which may have multiple UVs split out.

BMLoopuv_find_nearest_loop_from_vert (Scene *scene, Object *obedit, BMVert *v, const float co[2])
 
BMLoopuv_find_nearest_loop_from_edge (Scene *scene, Object *obedit, BMEdge *e, const float co[2])
 
Helper functions for UV selection.
bool uvedit_vert_is_edge_select_any_other (const Scene *scene, BMLoop *l, const BMUVOffsets offsets)
 
bool uvedit_vert_is_face_select_any_other (const Scene *scene, BMLoop *l, const BMUVOffsets offsets)
 
bool uvedit_vert_is_all_other_faces_selected (const Scene *scene, BMLoop *l, const BMUVOffsets offsets)
 
static void bm_clear_uv_vert_selection (const Scene *scene, BMesh *bm, const BMUVOffsets offsets)
 
UV Select-Mode Flushing
void ED_uvedit_selectmode_flush (const Scene *scene, BMEditMesh *em)
 UV Select Mode Flush.
 
UV Flush selection (up/down)
void uvedit_select_flush (const Scene *scene, BMEditMesh *em)
 
void uvedit_deselect_flush (const Scene *scene, BMEditMesh *em)
 
Face Loop Select
static int uv_select_faceloop (Scene *scene, Object *obedit, UvNearestHit *hit, const bool extend)
 
Edge Ring Select
static int uv_select_edgering (Scene *scene, Object *obedit, UvNearestHit *hit, const bool extend)
 
Select Linked
static void uv_select_linked_multi (Scene *scene, const Span< Object * > objects, UvNearestHit *hit, const bool extend, bool deselect, const bool toggle, const bool select_faces)
 
const floatuvedit_first_selected_uv_from_vertex (Scene *scene, BMVert *eve, const BMUVOffsets offsets)
 
Select More/Less Operator
static int uv_select_more_less (bContext *C, const bool select)
 
static int uv_select_more_exec (bContext *C, wmOperator *)
 
void UV_OT_select_more (wmOperatorType *ot)
 
static int uv_select_less_exec (bContext *C, wmOperator *)
 
void UV_OT_select_less (wmOperatorType *ot)
 
Mouse Select Operator
static bool uv_mouse_select_multi (bContext *C, const Span< Object * > objects, const float co[2], const SelectPick_Params *params)
 
static bool uv_mouse_select (bContext *C, const float co[2], const SelectPick_Params *params)
 
static int uv_select_exec (bContext *C, wmOperator *op)
 
static int uv_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void UV_OT_select (wmOperatorType *ot)
 
Edge Loop Select Operator
static int uv_select_loop_exec (bContext *C, wmOperator *op)
 
static int uv_select_loop_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void UV_OT_select_loop (wmOperatorType *ot)
 
Edge Ring Select Operator
static int uv_select_edge_ring_exec (bContext *C, wmOperator *op)
 
static int uv_select_edge_ring_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void UV_OT_select_edge_ring (wmOperatorType *ot)
 
Select Linked Operator
static int uv_select_linked_internal (bContext *C, wmOperator *op, const wmEvent *event, bool pick)
 
static int uv_select_linked_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_linked (wmOperatorType *ot)
 
Select Linked (Cursor Pick) Operator
static int uv_select_linked_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int uv_select_linked_pick_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_linked_pick (wmOperatorType *ot)
 
Box Select Operator
static int uv_box_select_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_box (wmOperatorType *ot)
 
Circle Select Operator
static bool uv_circle_select_is_point_inside (const float uv[2], const float offset[2], const float ellipse[2])
 
static bool uv_circle_select_is_edge_inside (const float uv_a[2], const float uv_b[2], const float offset[2], const float ellipse[2])
 
static int uv_circle_select_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_circle (wmOperatorType *ot)
 
Lasso Select Operator
static bool do_lasso_select_mesh_uv_is_point_inside (const ARegion *region, const rcti *clip_rect, const Span< int2 > mcoords, const float co_test[2])
 
static bool do_lasso_select_mesh_uv_is_edge_inside (const ARegion *region, const rcti *clip_rect, const Span< int2 > mcoords, const float co_test_a[2], const float co_test_b[2])
 
static bool do_lasso_select_mesh_uv (bContext *C, const Span< int2 > mcoords, const eSelectOp sel_op)
 
static int uv_lasso_select_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_lasso (wmOperatorType *ot)
 
Select Pinned UVs Operator
static int uv_select_pinned_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_pinned (wmOperatorType *ot)
 
Select Overlap Operator
BLI_INLINE uint overlap_hash (const void *overlap_v)
 
BLI_INLINE bool overlap_cmp (const void *a_v, const void *b_v)
 
static bool overlap_tri_tri_uv_test (const float t1[3][2], const float t2[3][2], const float endpoint_bias)
 
static int uv_select_overlap (bContext *C, const bool extend)
 
static int uv_select_overlap_exec (bContext *C, wmOperator *op)
 
void UV_OT_select_overlap (wmOperatorType *ot)
 
Selected Elements as Arrays (Vertex, Edge & Faces)

These functions return single elements per connected vertex/edge. So an edge that has two connected edge loops only assigns one loop in the array.

BMFace ** ED_uvedit_selected_faces (const Scene *scene, BMesh *bm, int len_max, int *r_faces_len)
 
BMLoop ** ED_uvedit_selected_edges (const Scene *scene, BMesh *bm, int len_max, int *r_edges_len)
 
BMLoop ** ED_uvedit_selected_verts (const Scene *scene, BMesh *bm, int len_max, int *r_verts_len)
 
Select Mode UV Vert/Edge/Face/Island Operator
static void uv_isolate_selected_islands (const Scene *scene, BMEditMesh *em, const BMUVOffsets offsets)
 
void ED_uvedit_selectmode_clean (const Scene *scene, Object *obedit)
 UV Select Mode set.
 
void ED_uvedit_selectmode_clean_multi (bContext *C)
 
static int uv_select_mode_exec (bContext *C, wmOperator *op)
 
static int uv_select_mode_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void UV_OT_select_mode (wmOperatorType *ot)
 

Edge Loop Select

enum  eUVEdgeLoopBoundaryMode { UV_EDGE_LOOP_BOUNDARY_LOOP = 1 , UV_EDGE_LOOP_BOUNDARY_ALL = 2 }
 
static BMLoopbm_select_edgeloop_double_side_next (const Scene *scene, BMLoop *l_step, BMVert *v_from, const BMUVOffsets offsets)
 
static BMLoopbm_select_edgeloop_single_side_next (const Scene *scene, BMLoop *l_step, BMVert *v_from, const BMUVOffsets offsets)
 
static void bm_loop_tags_clear (BMesh *bm)
 
static void uv_select_edgeloop_double_side_tag (const Scene *scene, BMEditMesh *em, BMLoop *l_init_pair[2], const BMUVOffsets offsets)
 
static void uv_select_edgeloop_single_side_tag (const Scene *scene, BMEditMesh *em, BMLoop *l_init, const BMUVOffsets offsets, enum eUVEdgeLoopBoundaryMode boundary_mode, int r_count_by_select[2])
 
static int uv_select_edgeloop (Scene *scene, Object *obedit, UvNearestHit *hit, const bool extend)
 

Shared Edge Loop/Ring Select Operator Functions

enum  eUVLoopGenericType { UV_LOOP_SELECT = 1 , UV_RING_SELECT = 2 }
 
static int uv_mouse_select_loop_generic_multi (bContext *C, const Span< Object * > objects, const float co[2], const bool extend, enum eUVLoopGenericType loop_type)
 
static int uv_mouse_select_loop_generic (bContext *C, const float co[2], const bool extend, enum eUVLoopGenericType loop_type)
 

Select Similar Operator

static EnumPropertyItem uv_select_similar_type_items []
 
static EnumPropertyItem prop_similar_compare_types []
 
static float get_uv_vert_needle (const eUVSelectSimilar type, BMVert *vert, const float ob_m3[3][3], BMLoop *loop, const BMUVOffsets offsets)
 
static float get_uv_edge_needle (const eUVSelectSimilar type, BMEdge *edge, const float ob_m3[3][3], BMLoop *loop_a, BMLoop *loop_b, const BMUVOffsets offsets)
 
static float get_uv_face_needle (const eUVSelectSimilar type, BMFace *face, int ob_index, const float ob_m3[3][3], const BMUVOffsets offsets)
 
static float get_uv_island_needle (const eUVSelectSimilar type, const FaceIsland *island, const float ob_m3[3][3], const BMUVOffsets offsets)
 
static int uv_select_similar_vert_exec (bContext *C, wmOperator *op)
 
static int uv_select_similar_edge_exec (bContext *C, wmOperator *op)
 
static int uv_select_similar_face_exec (bContext *C, wmOperator *op)
 
static bool uv_island_selected (const Scene *scene, FaceIsland *island)
 
static int uv_select_similar_island_exec (bContext *C, wmOperator *op)
 
static int uv_select_similar_exec (bContext *C, wmOperator *op)
 
static const EnumPropertyItemuv_select_similar_type_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
 
void UV_OT_select_similar (wmOperatorType *ot)
 

Macro Definition Documentation

◆ CURR_FACE_IS_UNSEL

#define CURR_FACE_IS_UNSEL   2

Referenced by uv_select_more_less().

◆ NEIGHBORING_FACE_IS_SEL

#define NEIGHBORING_FACE_IS_SEL   1

Referenced by uv_select_more_less().

◆ SET_SELECTION

#define SET_SELECTION ( value)
Value:
if (select_faces) { \
BM_face_select_set(em->bm, efa, value); \
} \
else { \
uvedit_face_select_set(scene, em->bm, efa, value, false, offsets); \
} \
(void)0

Referenced by uv_select_linked_multi().

Enumeration Type Documentation

◆ eUVEdgeLoopBoundaryMode

Mode for selecting edge loops at boundaries.

Enumerator
UV_EDGE_LOOP_BOUNDARY_LOOP 

Delimit at face corners (don't walk over multiple edges in the same face).

UV_EDGE_LOOP_BOUNDARY_ALL 

Don't delimit, walk over the all connected boundary loops.

Definition at line 1380 of file uvedit_select.cc.

◆ eUVLoopGenericType

Enumerator
UV_LOOP_SELECT 
UV_RING_SELECT 

Definition at line 2739 of file uvedit_select.cc.

◆ eUVSelectSimilar

Enumerator
UV_SSIM_AREA_UV 
UV_SSIM_AREA_3D 
UV_SSIM_FACE 
UV_SSIM_LENGTH_UV 
UV_SSIM_LENGTH_3D 
UV_SSIM_MATERIAL 
UV_SSIM_OBJECT 
UV_SSIM_PIN 
UV_SSIM_SIDES 
UV_SSIM_WINDING 

Definition at line 89 of file uvedit_select.cc.

Function Documentation

◆ bm_clear_uv_vert_selection()

static void bm_clear_uv_vert_selection ( const Scene * scene,
BMesh * bm,
const BMUVOffsets offsets )
static

◆ bm_loop_tags_clear()

◆ bm_select_edgeloop_double_side_next()

static BMLoop * bm_select_edgeloop_double_side_next ( const Scene * scene,
BMLoop * l_step,
BMVert * v_from,
const BMUVOffsets offsets )
static

◆ bm_select_edgeloop_single_side_next()

static BMLoop * bm_select_edgeloop_single_side_next ( const Scene * scene,
BMLoop * l_step,
BMVert * v_from,
const BMUVOffsets offsets )
static

◆ do_lasso_select_mesh_uv()

static bool do_lasso_select_mesh_uv ( bContext * C,
const Span< int2 > mcoords,
const eSelectOp sel_op )
static

Definition at line 3948 of file uvedit_select.cc.

References BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(), BLI_lasso_boundbox(), BMEditMesh::bm, BM_ELEM_CD_GET_FLOAT_P, BM_elem_flag_disable, BM_elem_flag_enable, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_face_uv_calc_center_median(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_mesh_elem_hflag_disable_all(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets(), BM_VERT, CD_PROP_FLOAT2, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CustomData_get_active_layer_name(), depsgraph, do_lasso_select_mesh_uv_is_edge_inside(), do_lasso_select_mesh_uv_is_point_inside(), ED_uvedit_select_sync_flush(), ED_uvedit_selectmode_flush(), l, BMesh::ldata, UvNearestHit::ob, BMLoop::prev, SCE_SELECT_EDGE, SCE_SELECT_FACE, SEL_DESELECT, SEL_OP_SUB, SEL_OP_USE_PRE_DESELECT, select(), ToolSettings::selectmode, SI_STICKY_VERTEX, BMUVOffsets::uv, ToolSettings::uv_flag, uv_select_all_perform_multi(), UV_SELECT_EDGE, UV_SELECT_FACE, uv_select_flush_from_tag_face(), UV_SELECT_ISLAND, uv_select_linked_multi(), uv_select_tag_update_for_object(), ToolSettings::uv_selectmode, ToolSettings::uv_sticky, UV_SYNC_SELECTION, uvedit_edge_select_set_with_sticky(), uvedit_face_select_test(), uvedit_face_visible_test(), uvedit_uv_select_set(), uvedit_uv_select_test(), uvedit_vertex_select_tagged(), and BMLoop::v.

Referenced by uv_lasso_select_exec().

◆ do_lasso_select_mesh_uv_is_edge_inside()

static bool do_lasso_select_mesh_uv_is_edge_inside ( const ARegion * region,
const rcti * clip_rect,
const Span< int2 > mcoords,
const float co_test_a[2],
const float co_test_b[2] )
static

◆ do_lasso_select_mesh_uv_is_point_inside()

static bool do_lasso_select_mesh_uv_is_point_inside ( const ARegion * region,
const rcti * clip_rect,
const Span< int2 > mcoords,
const float co_test[2] )
static

◆ ED_uvedit_active_edge_loop_get()

◆ ED_uvedit_active_edge_loop_set()

void ED_uvedit_active_edge_loop_set ( BMesh * bm,
BMLoop * l )

◆ ED_uvedit_active_vert_loop_get()

◆ ED_uvedit_active_vert_loop_set()

void ED_uvedit_active_vert_loop_set ( BMesh * bm,
BMLoop * l )

◆ ED_uvedit_nearest_uv_multi()

bool ED_uvedit_nearest_uv_multi ( const View2D * v2d,
const Scene * scene,
const Span< Object * > objects,
const float mval_fl[2],
const bool ignore_selected,
float * dist_sq,
float r_uv[2] )

◆ ED_uvedit_select_mode_get()

◆ ED_uvedit_select_sync_flush()

◆ ED_uvedit_selected_edges()

◆ ED_uvedit_selected_faces()

BMFace ** ED_uvedit_selected_faces ( const Scene * scene,
BMesh * bm,
int len_max,
int * r_faces_len )

◆ ED_uvedit_selected_verts()

◆ ED_uvedit_selectmode_clean()

◆ ED_uvedit_selectmode_clean_multi()

◆ ED_uvedit_selectmode_flush()

◆ get_uv_edge_needle()

◆ get_uv_face_needle()

◆ get_uv_island_needle()

static float get_uv_island_needle ( const eUVSelectSimilar type,
const FaceIsland * island,
const float ob_m3[3][3],
const BMUVOffsets offsets )
static

◆ get_uv_vert_needle()

◆ overlap_cmp()

BLI_INLINE bool overlap_cmp ( const void * a_v,
const void * b_v )

Definition at line 4235 of file uvedit_select.cc.

References b.

Referenced by uv_select_overlap().

◆ overlap_hash()

BLI_INLINE uint overlap_hash ( const void * overlap_v)

Definition at line 4222 of file uvedit_select.cc.

References BLI_hash_int_2d(), BVHTreeOverlap::indexA, and BVHTreeOverlap::indexB.

Referenced by uv_select_overlap().

◆ overlap_tri_tri_uv_test()

static bool overlap_tri_tri_uv_test ( const float t1[3][2],
const float t2[3][2],
const float endpoint_bias )
static

Specialized 2D triangle intersection for detecting UV overlap:

Returns
  • false when single corners or edges touch (common for UV coordinates).
  • true when all corners touch (an exactly overlapping triangle).

Definition at line 4256 of file uvedit_select.cc.

References isect_point_tri_v2(), isect_seg_seg_v2_point_ex(), mid_v2_v2v2v2(), and UNPACK3.

Referenced by uv_select_overlap().

◆ uv_box_select_exec()

static int uv_box_select_exec ( bContext * C,
wmOperator * op )
static

Definition at line 3496 of file uvedit_select.cc.

References BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(), BLI_rctf_isect_pt_v(), BLI_rctf_isect_segment(), BMEditMesh::bm, BM_ELEM_CD_GET_BOOL, BM_ELEM_CD_GET_FLOAT_P, BM_elem_flag_disable, BM_elem_flag_enable, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_face_uv_calc_center_median(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_mesh_elem_hflag_disable_all(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_pin_attr(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets(), BM_VERT, CD_PROP_FLOAT2, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CustomData_get_active_layer_name(), depsgraph, ED_uvedit_select_sync_flush(), ED_uvedit_selectmode_flush(), l, BMesh::ldata, UvNearestHit::ob, OPERATOR_CANCELLED, OPERATOR_FINISHED, BMUVOffsets::pin, BMLoop::prev, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), SCE_SELECT_EDGE, SCE_SELECT_FACE, SEL_DESELECT, SEL_OP_SUB, SEL_OP_USE_PRE_DESELECT, select(), ToolSettings::selectmode, SI_STICKY_VERTEX, UI_view2d_region_to_view_rctf(), BMUVOffsets::uv, ToolSettings::uv_flag, uv_select_all_perform_multi(), UV_SELECT_EDGE, UV_SELECT_FACE, uv_select_flush_from_tag_face(), UV_SELECT_ISLAND, uv_select_linked_multi(), uv_select_tag_update_for_object(), ToolSettings::uv_selectmode, ToolSettings::uv_sticky, UV_SYNC_SELECTION, uvedit_edge_select_set_with_sticky(), uvedit_face_visible_test(), uvedit_uv_select_set(), uvedit_uv_select_test(), uvedit_vertex_select_tagged(), BMLoop::v, and WM_operator_properties_border_to_rctf().

Referenced by UV_OT_select_box().

◆ uv_circle_select_exec()

static int uv_circle_select_exec ( bContext * C,
wmOperator * op )
static

Definition at line 3733 of file uvedit_select.cc.

References BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(), BMEditMesh::bm, BM_ELEM_CD_GET_FLOAT_P, BM_elem_flag_disable, BM_elem_flag_enable, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_face_uv_calc_center_median(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_mesh_elem_hflag_disable_all(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets(), BM_VERT, CD_PROP_FLOAT2, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_space_image(), wmOperator::customdata, CustomData_get_active_layer_name(), depsgraph, ED_select_op_modal(), ED_space_image_get_size(), ED_space_image_get_zoom(), ED_uvedit_select_sync_flush(), ED_uvedit_selectmode_flush(), l, BMesh::ldata, UvNearestHit::ob, OPERATOR_CANCELLED, OPERATOR_FINISHED, BMLoop::prev, wmOperator::ptr, RNA_enum_get(), RNA_int_get(), SCE_SELECT_EDGE, SCE_SELECT_FACE, SEL_DESELECT, SEL_OP_SUB, SEL_OP_USE_PRE_DESELECT, select(), ToolSettings::selectmode, SI_STICKY_VERTEX, UI_view2d_region_to_view(), BMUVOffsets::uv, uv_circle_select_is_edge_inside(), uv_circle_select_is_point_inside(), ToolSettings::uv_flag, uv_select_all_perform_multi(), UV_SELECT_EDGE, UV_SELECT_FACE, uv_select_flush_from_tag_face(), UV_SELECT_ISLAND, uv_select_linked_multi(), uv_select_tag_update_for_object(), ToolSettings::uv_selectmode, ToolSettings::uv_sticky, UV_SYNC_SELECTION, uvedit_edge_select_set_with_sticky(), uvedit_face_select_test(), uvedit_face_visible_test(), uvedit_uv_select_set(), uvedit_uv_select_test(), uvedit_vertex_select_tagged(), BMLoop::v, WM_gesture_is_modal_first(), x, and y.

Referenced by UV_OT_select_circle().

◆ uv_circle_select_is_edge_inside()

static bool uv_circle_select_is_edge_inside ( const float uv_a[2],
const float uv_b[2],
const float offset[2],
const float ellipse[2] )
static

Definition at line 3715 of file uvedit_select.cc.

References dist_squared_to_line_segment_v2().

Referenced by uv_circle_select_exec().

◆ uv_circle_select_is_point_inside()

static bool uv_circle_select_is_point_inside ( const float uv[2],
const float offset[2],
const float ellipse[2] )
static

Definition at line 3703 of file uvedit_select.cc.

References len_squared_v2().

Referenced by uv_circle_select_exec().

◆ uv_find_nearest_edge()

◆ uv_find_nearest_edge_multi()

bool uv_find_nearest_edge_multi ( Scene * scene,
const Span< Object * > objects,
const float co[2],
const float penalty,
UvNearestHit * hit )

◆ uv_find_nearest_face()

bool uv_find_nearest_face ( Scene * scene,
Object * obedit,
const float co[2],
UvNearestHit * hit )

Definition at line 946 of file uvedit_select.cc.

References uv_find_nearest_face_ex().

◆ uv_find_nearest_face_ex()

bool uv_find_nearest_face_ex ( Scene * scene,
Object * obedit,
const float co[2],
UvNearestHit * hit,
bool only_in_face )
Parameters
only_in_facewhen true, only hit faces which co is inside. This gives users a result they might expect, especially when zoomed in.
Note
Concave faces can cause odd behavior, although in practice this isn't often an issue. The center can be outside the face, in this case the distance to the center could cause the face to be considered too far away. If this becomes an issue we could track the distance to the faces closest edge.

Definition at line 903 of file uvedit_select.cc.

References BKE_editmesh_from_object(), BLI_assert, BMEditMesh::bm, BM_face_uv_calc_center_median(), BM_face_uv_point_inside_test(), BM_FACES_OF_MESH, BM_ITER_MESH, CD_PROP_FLOAT2, CustomData_get_offset(), BMesh::ldata, len_squared_v2(), mul_v2_v2(), sub_v2_v2v2(), and uvedit_face_visible_test().

Referenced by uv_find_nearest_face(), and uv_find_nearest_face_multi_ex().

◆ uv_find_nearest_face_multi()

bool uv_find_nearest_face_multi ( Scene * scene,
const Span< Object * > objects,
const float co[2],
UvNearestHit * hit )

Definition at line 966 of file uvedit_select.cc.

References uv_find_nearest_face_multi_ex().

Referenced by uv_mouse_select_multi().

◆ uv_find_nearest_face_multi_ex()

bool uv_find_nearest_face_multi_ex ( Scene * scene,
const Span< Object * > objects,
const float co[2],
UvNearestHit * hit,
const bool only_in_face )

Definition at line 951 of file uvedit_select.cc.

References uv_find_nearest_face_ex().

Referenced by uv_find_nearest_face_multi(), and uv_mouse_select_multi().

◆ uv_find_nearest_loop_from_edge()

◆ uv_find_nearest_loop_from_vert()

◆ uv_find_nearest_vert()

◆ uv_find_nearest_vert_multi()

bool uv_find_nearest_vert_multi ( Scene * scene,
const Span< Object * > objects,
float const co[2],
const float penalty_dist,
UvNearestHit * hit )

Definition at line 1043 of file uvedit_select.cc.

References uv_find_nearest_vert().

Referenced by uv_mouse_select_multi().

◆ uv_island_selected()

static bool uv_island_selected ( const Scene * scene,
FaceIsland * island )
static

◆ uv_isolate_selected_islands()

◆ uv_lasso_select_exec()

◆ uv_mouse_select()

static bool uv_mouse_select ( bContext * C,
const float co[2],
const SelectPick_Params * params )
static

◆ uv_mouse_select_loop_generic()

static int uv_mouse_select_loop_generic ( bContext * C,
const float co[2],
const bool extend,
enum eUVLoopGenericType loop_type )
static

◆ uv_mouse_select_loop_generic_multi()

◆ uv_mouse_select_multi()

static bool uv_mouse_select_multi ( bContext * C,
const Span< Object * > objects,
const float co[2],
const SelectPick_Params * params )
static

◆ uv_nearest_between()

static bool uv_nearest_between ( const BMLoop * l,
const float co[2],
const int cd_loop_uv_offset )
static

Definition at line 974 of file uvedit_select.cc.

References BM_ELEM_CD_GET_FLOAT_P, l, line_point_side_v2(), BMLoop::next, and BMLoop::prev.

Referenced by uv_find_nearest_vert().

◆ uv_nearest_hit_init_dist_px()

UvNearestHit uv_nearest_hit_init_dist_px ( const View2D * v2d,
const float dist_px )

◆ uv_nearest_hit_init_max()

◆ uv_nearest_hit_init_max_default()

UvNearestHit uv_nearest_hit_init_max_default ( )

◆ UV_OT_select()

◆ UV_OT_select_all()

◆ UV_OT_select_box()

◆ UV_OT_select_circle()

◆ UV_OT_select_edge_ring()

◆ UV_OT_select_lasso()

◆ UV_OT_select_less()

◆ UV_OT_select_linked()

◆ UV_OT_select_linked_pick()

◆ UV_OT_select_loop()

◆ UV_OT_select_mode()

◆ UV_OT_select_more()

◆ UV_OT_select_overlap()

◆ UV_OT_select_pinned()

◆ UV_OT_select_similar()

◆ UV_OT_select_split()

◆ uv_select_all()

◆ uv_select_all_exec()

◆ uv_select_all_perform()

◆ uv_select_all_perform_multi()

static void uv_select_all_perform_multi ( const Scene * scene,
Span< Object * > objects,
int action )
static

◆ uv_select_all_perform_multi_ex() [1/2]

static void uv_select_all_perform_multi_ex ( const Scene * scene,
const Span< Object * > objects,
int action,
const Object * ob_exclude )
static

◆ uv_select_all_perform_multi_ex() [2/2]

static void uv_select_all_perform_multi_ex ( const Scene * scene,
Span< Object * > objects,
int action,
const Object * ob_exclude )
static

◆ uv_select_edge_ring_exec()

static int uv_select_edge_ring_exec ( bContext * C,
wmOperator * op )
static

◆ uv_select_edge_ring_invoke()

◆ uv_select_edgeloop()

◆ uv_select_edgeloop_double_side_tag()

static void uv_select_edgeloop_double_side_tag ( const Scene * scene,
BMEditMesh * em,
BMLoop * l_init_pair[2],
const BMUVOffsets offsets )
static

◆ uv_select_edgeloop_single_side_tag()

static void uv_select_edgeloop_single_side_tag ( const Scene * scene,
BMEditMesh * em,
BMLoop * l_init,
const BMUVOffsets offsets,
enum eUVEdgeLoopBoundaryMode boundary_mode,
int r_count_by_select[2] )
static

Tag all loops which should be selected, the caller must select.

Parameters
r_count_by_selectCount the number of unselected and selected loops, this is needed to implement cycling between eUVEdgeLoopBoundaryMode.

Definition at line 1482 of file uvedit_select.cc.

References BMEditMesh::bm, BM_edge_other_vert(), BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_TAG, bm_loop_tags_clear(), bm_select_edgeloop_single_side_next(), BMLoop::e, BMLoop::f, UV_EDGE_LOOP_BOUNDARY_LOOP, uvedit_edge_select_test(), uvedit_face_visible_test(), uvedit_loop_find_other_radial_loop_with_visible_face(), BMEdge::v1, and BMEdge::v2.

Referenced by uv_select_edgeloop().

◆ uv_select_edgering()

◆ uv_select_exec()

◆ uv_select_faceloop()

◆ uv_select_flush_from_loop_edge_flag()

static void uv_select_flush_from_loop_edge_flag ( const Scene * scene,
BMEditMesh * em )
static

Flush the selection from UV edges based on sticky modes.

Useful when performing edge selections in different sticky modes, since setting the required edge selection is done manually or using uvedit_edge_select_set_noflush, but dealing with sticky modes for vertex selections is best done in a separate function.

Note
Current behavior is selecting only; deselecting can be added but the behavior isn't required anywhere.

Definition at line 3431 of file uvedit_select.cc.

References BMEditMesh::bm, bm_clear_uv_vert_selection(), BM_ELEM_CD_GET_BOOL, BM_ELEM_CD_SET_BOOL, BM_FACE, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_LOOPS_OF_FACE, BM_mesh_elem_table_ensure(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets(), BM_uv_vert_map_create(), BM_uv_vert_map_free(), CD_PROP_FLOAT2, CustomData_get_active_layer_name(), ELEM, l, BMesh::ldata, BMLoop::next, BMLoop::prev, BMUVOffsets::select_edge, BMUVOffsets::select_vert, SI_STICKY_LOC, SI_STICKY_VERTEX, ToolSettings::uv_flag, uv_select_flush_from_tag_sticky_loc_internal(), ToolSettings::uv_sticky, UV_SYNC_SELECTION, and uvedit_face_visible_test().

Referenced by ED_uvedit_selectmode_clean(), and uv_select_invert().

◆ uv_select_flush_from_tag_face()

static void uv_select_flush_from_tag_face ( const Scene * scene,
Object * obedit,
const bool select )
static

◆ uv_select_flush_from_tag_loop()

static void uv_select_flush_from_tag_loop ( const Scene * scene,
Object * obedit,
const bool select )
static

Flush the selection from loop tags based on sticky and selection modes.

needed because setting the selection of a face is done in a number of places but it also needs to respect the sticky modes for the UV verts, so dealing with the sticky modes is best done in a separate function.

Note
This function is very similar to uv_select_flush_from_tag_face, be sure to update both upon changing.

Definition at line 3350 of file uvedit_select.cc.

References BKE_editmesh_from_object(), BMEditMesh::bm, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_TAG, BM_FACE, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_LOOPS_OF_FACE, BM_mesh_elem_hflag_disable_all(), BM_mesh_elem_table_ensure(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets(), BM_uv_vert_map_create(), BM_uv_vert_map_free(), BM_VERT, CD_PROP_FLOAT2, CustomData_get_active_layer_name(), l, BMesh::ldata, select(), SI_STICKY_LOC, SI_STICKY_VERTEX, ToolSettings::uv_flag, uv_select_flush_from_tag_sticky_loc_internal(), ToolSettings::uv_sticky, UV_SYNC_SELECTION, uvedit_uv_select_set(), and BMLoop::v.

Referenced by ED_uvedit_selectmode_clean(), and uv_select_more_less().

◆ uv_select_flush_from_tag_sticky_loc_internal()

static void uv_select_flush_from_tag_sticky_loc_internal ( const Scene * scene,
BMEditMesh * em,
UvVertMap * vmap,
const uint efa_index,
BMLoop * l,
const bool select,
const BMUVOffsets offsets )
static

◆ uv_select_invert()

◆ uv_select_invoke()

◆ uv_select_less_exec()

static int uv_select_less_exec ( bContext * C,
wmOperator *  )
static

Definition at line 2201 of file uvedit_select.cc.

References uv_select_more_less().

Referenced by UV_OT_select_less().

◆ uv_select_linked_exec()

static int uv_select_linked_exec ( bContext * C,
wmOperator * op )
static

Definition at line 3013 of file uvedit_select.cc.

References uv_select_linked_internal().

Referenced by UV_OT_select_linked().

◆ uv_select_linked_internal()

◆ uv_select_linked_multi()

◆ uv_select_linked_pick_exec()

static int uv_select_linked_pick_exec ( bContext * C,
wmOperator * op )
static

Definition at line 3044 of file uvedit_select.cc.

References uv_select_linked_internal().

Referenced by UV_OT_select_linked_pick().

◆ uv_select_linked_pick_invoke()

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

Definition at line 3039 of file uvedit_select.cc.

References uv_select_linked_internal().

Referenced by UV_OT_select_linked_pick().

◆ uv_select_loop_exec()

static int uv_select_loop_exec ( bContext * C,
wmOperator * op )
static

◆ uv_select_loop_invoke()

◆ uv_select_mode_exec()

◆ uv_select_mode_invoke()

◆ uv_select_more_exec()

static int uv_select_more_exec ( bContext * C,
wmOperator *  )
static

Definition at line 2183 of file uvedit_select.cc.

References uv_select_more_less().

Referenced by UV_OT_select_more().

◆ uv_select_more_less()

◆ uv_select_overlap()

static int uv_select_overlap ( bContext * C,
const bool extend )
static

Definition at line 4295 of file uvedit_select.cc.

References BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(), BLI_assert, BLI_bvhtree_balance(), BLI_bvhtree_free(), BLI_bvhtree_insert(), BLI_bvhtree_new(), BLI_bvhtree_overlap_self(), BLI_gset_add(), BLI_gset_free(), BLI_gset_new_ex(), BLI_heap_clear(), BLI_heap_free(), BLI_heap_new_ex(), BLI_memarena_clear(), BLI_memarena_free(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_POLYFILL_ALLOC_NGON_RESERVE, BLI_polyfill_beautify(), BLI_polyfill_calc_arena(), BMEditMesh::bm, BM_ELEM_CD_GET_FLOAT_P, BM_ELEM_TAG, BM_FACE, BM_FACES_OF_MESH, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_LOOPS_OF_FACE, BM_mesh_elem_hflag_disable_all(), BM_mesh_elem_index_ensure(), BM_mesh_elem_table_ensure(), BM_uv_map_ensure_edge_select_attr(), BM_uv_map_ensure_vert_select_attr(), BM_uv_map_get_offsets(), BM_VERT, CD_PROP_FLOAT2, copy_v2_v2(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CustomData_get_active_layer_name(), CustomData_get_offset(), depsgraph, UVOverlapData::face_index, float, BMesh::ftable, BVHTreeOverlap::indexA, l, BMesh::ldata, BMFace::len, MEM_freeN(), MEM_mallocN, UVOverlapData::ob_index, OPERATOR_FINISHED, overlap_cmp(), overlap_hash(), overlap_tri_tri_uv_test(), SEL_DESELECT, UVOverlapData::tri, UNPACK2, uv_select_all_perform(), uv_select_tag_update_for_object(), uvedit_face_select_enable(), uvedit_face_select_test(), and uvedit_face_visible_test_ex().

Referenced by uv_select_overlap_exec().

◆ uv_select_overlap_exec()

static int uv_select_overlap_exec ( bContext * C,
wmOperator * op )
static

Definition at line 4483 of file uvedit_select.cc.

References wmOperator::ptr, RNA_boolean_get(), and uv_select_overlap().

Referenced by UV_OT_select_overlap().

◆ uv_select_pinned_exec()

◆ uv_select_similar_edge_exec()

◆ uv_select_similar_exec()

◆ uv_select_similar_face_exec()

◆ uv_select_similar_island_exec()

◆ uv_select_similar_type_itemf()

◆ uv_select_similar_vert_exec()

◆ uv_select_split_exec()

◆ uv_select_tag_update_for_object()

◆ uvedit_deselect_flush()

◆ uvedit_edge_select_disable()

◆ uvedit_edge_select_enable()

◆ uvedit_edge_select_set()

void uvedit_edge_select_set ( const Scene * scene,
BMesh * bm,
BMLoop * l,
bool select,
bool do_history,
BMUVOffsets offsets )

Select UV Edge.

Changes selection state of a single UV Edge.

Definition at line 503 of file uvedit_select.cc.

References bm, do_history(), l, select(), uvedit_edge_select_disable(), and uvedit_edge_select_enable().

Referenced by uv_select_similar_edge_exec(), and uvedit_edge_select_set_with_sticky().

◆ uvedit_edge_select_set_noflush()

void uvedit_edge_select_set_noflush ( const Scene * scene,
BMLoop * l,
const bool select,
const int sticky_flag,
BMUVOffsets offsets )

◆ uvedit_edge_select_set_with_sticky()

◆ uvedit_edge_select_shared_vert()

void uvedit_edge_select_shared_vert ( const Scene * scene,
BMEditMesh * em,
BMLoop * l,
const bool select,
const int sticky_flag,
const bool do_history,
BMUVOffsets offsets )

Selects UV edges and shared vertices according to sticky_flag.

Parameters
sticky_flag
  • SI_STICKY_LOC: selects all UV edges that share the same mesh vertices and UV coordinates.
  • SI_STICKY_VERTEX: selects all UV edges sharing the same mesh vertices.

Definition at line 451 of file uvedit_select.cc.

References BLI_assert, BM_ELEM_CD_GET_BOOL, do_history(), ELEM, l, BMLoop::next, BMLoop::radial_next, select(), BMUVOffsets::select_edge, SI_STICKY_LOC, SI_STICKY_VERTEX, uvedit_edge_select_set_noflush(), uvedit_uv_select_shared_vert(), and uvedit_vert_is_edge_select_any_other().

Referenced by uvedit_edge_select_set_with_sticky().

◆ uvedit_edge_select_test()

◆ uvedit_edge_select_test_ex()

◆ uvedit_face_select_disable()

◆ uvedit_face_select_enable()

void uvedit_face_select_enable ( const Scene * scene,
BMesh * bm,
BMFace * efa,
const bool do_history,
const BMUVOffsets offsets )

◆ uvedit_face_select_set()

void uvedit_face_select_set ( const Scene * scene,
BMesh * bm,
BMFace * efa,
bool select,
bool do_history,
BMUVOffsets offsets )

◆ uvedit_face_select_set_with_sticky()

void uvedit_face_select_set_with_sticky ( const Scene * scene,
BMEditMesh * em,
BMFace * efa,
const bool select,
const bool do_history,
const BMUVOffsets offsets )

◆ uvedit_face_select_shared_vert()

void uvedit_face_select_shared_vert ( const Scene * scene,
BMEditMesh * em,
BMFace * efa,
const bool select,
const bool do_history,
const BMUVOffsets offsets )

◆ uvedit_face_select_test()

◆ uvedit_face_select_test_ex()

◆ uvedit_face_visible_test()

bool uvedit_face_visible_test ( const Scene * scene,
BMFace * efa )

Definition at line 240 of file uvedit_select.cc.

References uvedit_face_visible_test_ex().

Referenced by bm_clear_uv_vert_selection(), createTransUVs(), do_lasso_select_mesh_uv(), ED_uvedit_foreach_uv(), ED_uvedit_selected_edges(), ED_uvedit_selected_faces(), ED_uvedit_selected_verts(), ED_uvedit_selectmode_clean(), ED_uvedit_selectmode_flush(), edgetag_filter_cb(), facetag_filter_cb(), uv_box_select_exec(), uv_circle_select_exec(), uv_find_nearest_edge(), uv_find_nearest_face_ex(), uv_find_nearest_loop_from_edge(), uv_find_nearest_loop_from_vert(), uv_find_nearest_vert(), uv_hide_exec(), uv_isolate_selected_islands(), uv_mark_seam_exec(), uv_pin_exec(), uv_rip_object(), uv_seams_from_islands_exec(), uv_select_all(), uv_select_edgeloop_double_side_tag(), uv_select_edgeloop_single_side_tag(), uv_select_edgering(), uv_select_faceloop(), uv_select_flush_from_loop_edge_flag(), uv_select_invert(), uv_select_linked_multi(), uv_select_more_less(), uv_select_pinned_exec(), uv_select_similar_edge_exec(), uv_select_similar_face_exec(), uv_select_similar_vert_exec(), uv_select_split_exec(), uv_snap_uvs_to_adjacent_unselected(), uvedit_center(), uvedit_deselect_flush(), uvedit_edge_select_set_noflush(), uvedit_edge_select_set_with_sticky(), uvedit_face_select_set_with_sticky(), uvedit_first_selected_uv_from_vertex(), uvedit_loop_find_other_radial_loop_with_visible_face(), uvedit_nearest_uv(), uvedit_select_flush(), uvedit_select_is_any_selected(), uvedit_translate(), uvedit_uv_select_set_with_sticky(), uvedit_uv_select_shared_vert(), uvedit_vert_is_all_other_faces_selected(), uvedit_vert_is_edge_select_any_other(), uvedit_vert_is_face_select_any_other(), and verttag_filter_cb().

◆ uvedit_face_visible_test_ex()

bool uvedit_face_visible_test_ex ( const ToolSettings * ts,
BMFace * efa )

◆ uvedit_first_selected_uv_from_vertex()

const float * uvedit_first_selected_uv_from_vertex ( Scene * scene,
BMVert * eve,
BMUVOffsets offsets )
Warning
This returns first selected UV, not ideal in many cases since there could be multiple.

Definition at line 2015 of file uvedit_select.cc.

References BM_ELEM_CD_GET_FLOAT_P, BM_ITER_ELEM, BM_LOOPS_OF_VERT, BMLoop::f, l, BMUVOffsets::uv, uvedit_face_visible_test(), and uvedit_uv_select_test().

◆ uvedit_loop_find_other_boundary_loop_with_visible_face()

static BMLoop * uvedit_loop_find_other_boundary_loop_with_visible_face ( const Scene * scene,
BMLoop * l_edge,
BMVert * v_pivot,
const BMUVOffsets offsets )
static

◆ uvedit_loop_find_other_radial_loop_with_visible_face()

◆ uvedit_nearest_uv()

static bool uvedit_nearest_uv ( const Scene * scene,
Object * obedit,
const float co[2],
const float scale[2],
const bool ignore_selected,
float * dist_sq,
float r_uv[2] )
static

◆ uvedit_select_flush()

◆ uvedit_select_is_any_selected()

◆ uvedit_select_is_any_selected_multi()

bool uvedit_select_is_any_selected_multi ( const Scene * scene,
const Span< Object * > objects )

Definition at line 2252 of file uvedit_select.cc.

References uvedit_select_is_any_selected().

Referenced by uv_select_all_perform_multi_ex().

◆ uvedit_uv_select_disable()

◆ uvedit_uv_select_enable()

◆ uvedit_uv_select_set()

◆ uvedit_uv_select_set_with_sticky()

◆ uvedit_uv_select_shared_vert()

void uvedit_uv_select_shared_vert ( const Scene * scene,
BMEditMesh * em,
BMLoop * l,
const bool select,
const int sticky_flag,
const bool do_history,
BMUVOffsets offsets )

Selects shared UVs based on #sticky_flag.

Parameters
sticky_flagType of sticky selection:

Definition at line 650 of file uvedit_select.cc.

References BLI_assert, BMEditMesh::bm, BM_DISK_EDGE_NEXT, BM_loop_uv_share_vert_check(), do_history(), BMLoop::e, ELEM, BMLoop::f, BMEdge::l, l, BMLoop::radial_next, select(), SI_STICKY_LOC, SI_STICKY_VERTEX, BMUVOffsets::uv, uvedit_face_visible_test(), uvedit_uv_select_set(), and BMLoop::v.

Referenced by uvedit_edge_select_shared_vert(), uvedit_face_select_shared_vert(), and uvedit_uv_select_set_with_sticky().

◆ uvedit_uv_select_test()

◆ uvedit_uv_select_test_ex()

◆ uvedit_vert_is_all_other_faces_selected()

bool uvedit_vert_is_all_other_faces_selected ( const Scene * scene,
BMLoop * l,
const BMUVOffsets offsets )

◆ uvedit_vert_is_edge_select_any_other()

◆ uvedit_vert_is_face_select_any_other()

bool uvedit_vert_is_face_select_any_other ( const Scene * scene,
BMLoop * l,
const BMUVOffsets offsets )

◆ uvedit_vertex_select_tagged()

static void uvedit_vertex_select_tagged ( BMEditMesh * em,
Scene * scene,
bool select,
const BMUVOffsets offsets )
static

Variable Documentation

◆ prop_similar_compare_types

EnumPropertyItem prop_similar_compare_types[]
static
Initial value:
= {{SIM_CMP_EQ, "EQUAL", 0, "Equal", ""},
{SIM_CMP_GT, "GREATER", 0, "Greater", ""},
{SIM_CMP_LT, "LESS", 0, "Less", ""},
{0}}
@ SIM_CMP_LT
@ SIM_CMP_GT
@ SIM_CMP_EQ

Definition at line 5158 of file uvedit_select.cc.

Referenced by UV_OT_select_similar().

◆ uv_select_similar_type_items

EnumPropertyItem uv_select_similar_type_items[]
static
Initial value:
= {
{UV_SSIM_PIN, "PIN", 0, "Pinned", ""},
{UV_SSIM_LENGTH_UV, "LENGTH", 0, "Length", ""},
{UV_SSIM_LENGTH_3D, "LENGTH_3D", 0, "Length 3D", ""},
{UV_SSIM_AREA_UV, "AREA", 0, "Area", ""},
{UV_SSIM_AREA_3D, "AREA_3D", 0, "Area 3D", ""},
{UV_SSIM_MATERIAL, "MATERIAL", 0, "Material", ""},
{UV_SSIM_OBJECT, "OBJECT", 0, "Object", ""},
{UV_SSIM_SIDES, "SIDES", 0, "Polygon Sides", ""},
{UV_SSIM_WINDING, "WINDING", 0, "Winding", ""},
{UV_SSIM_FACE, "FACE", 0, "Amount of Faces in Island", ""},
{0}}
@ UV_SSIM_AREA_UV
@ UV_SSIM_LENGTH_UV
@ UV_SSIM_MATERIAL
@ UV_SSIM_PIN
@ UV_SSIM_FACE
@ UV_SSIM_OBJECT
@ UV_SSIM_WINDING
@ UV_SSIM_LENGTH_3D
@ UV_SSIM_AREA_3D
@ UV_SSIM_SIDES

Definition at line 5145 of file uvedit_select.cc.

Referenced by UV_OT_select_similar(), and uv_select_similar_type_itemf().