Blender V5.0
bmesh_uvselect.cc File Reference
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "BLI_listbase.h"
#include "BLI_math_bits.h"
#include "bmesh.hh"
#include "bmesh_structure.hh"

Go to the source code of this file.

Functions

Internal Utilities
static void bm_mesh_uvselect_disable_all (BMesh *bm)
UV Selection Functions (low level)
bool BM_loop_vert_uvselect_test (const BMLoop *l)
bool BM_loop_edge_uvselect_test (const BMLoop *l)
bool BM_face_uvselect_test (const BMFace *f)
UV Selection Connectivity Checks
bool BM_loop_vert_uvselect_check_other_loop_vert (BMLoop *l, const char hflag, const int cd_loop_uv_offset)
bool BM_loop_vert_uvselect_check_other_loop_edge (BMLoop *l, const char hflag, const int cd_loop_uv_offset)
bool BM_loop_vert_uvselect_check_other_edge (BMLoop *l, const char hflag, const int cd_loop_uv_offset)
bool BM_loop_vert_uvselect_check_other_face (BMLoop *l, const char hflag, const int cd_loop_uv_offset)
bool BM_loop_edge_uvselect_check_other_loop_edge (BMLoop *l, const char hflag, const int cd_loop_uv_offset)
bool BM_loop_edge_uvselect_check_other_face (BMLoop *l, const char hflag, const int cd_loop_uv_offset)
bool BM_face_uvselect_check_edges_all (BMFace *f)
UV Selection Functions
void BM_loop_vert_uvselect_set_noflush (BMesh *bm, BMLoop *l, bool select)
void BM_loop_edge_uvselect_set_noflush (BMesh *bm, BMLoop *l, bool select)
void BM_loop_edge_uvselect_set (BMesh *bm, BMLoop *l, bool select)
void BM_face_uvselect_set_noflush (BMesh *bm, BMFace *f, bool select)
void BM_face_uvselect_set (BMesh *bm, BMFace *f, bool select)
bool BM_mesh_uvselect_clear (BMesh *bm)
UV Selection Functions (Shared)
void BM_loop_vert_uvselect_set_shared (BMesh *bm, BMLoop *l, bool select, const int cd_loop_uv_offset)
void BM_loop_edge_uvselect_set_shared (BMesh *bm, BMLoop *l, bool select, const int cd_loop_uv_offset)
void BM_face_uvselect_set_shared (BMesh *bm, BMFace *f, bool select, const int cd_loop_uv_offset)
void BM_mesh_uvselect_set_elem_shared (BMesh *bm, bool select, const int cd_loop_uv_offset, const blender::Span< BMLoop * > loop_verts, const blender::Span< BMLoop * > loop_edges, const blender::Span< BMFace * > faces)
UV Selection Picking Versions of Selection Functions

These functions differ in that they perform all necessary flushing but do so only on local elements. This is only practical with a small number of elements since it'd be inefficient on large selections.

Note that we could also support selecting face-corners from the 3D viewport using these functions, however that's not yet supported.

Selection Modes & Flushing

Picking an edge in face-select mode or a vertex in edge-select mode is not supported. This is logical because the user cannot select a single vertex in face select mode. As these functions are exposed publicly for picking, this makes some sense.

Internally however, these functions are currently used by BM_mesh_uvselect_set_elem_from_mesh, which corrects "isolated" elements which should not be selected based on the selection-mode.

static void bm_vert_uvselect_set_pick (BMesh *bm, BMVert *v, const bool select, const BMUVSelectPickParams &, bool caller_handles_edge_or_face_mode)
static void bm_edge_uvselect_set_pick (BMesh *bm, BMEdge *e, const bool select, const BMUVSelectPickParams &uv_pick_params, const bool caller_handles_face_mode)
static void bm_face_uvselect_set_pick (BMesh *bm, BMFace *f, const bool select, const BMUVSelectPickParams &uv_pick_params)
void BM_vert_uvselect_set_pick (BMesh *bm, BMVert *v, bool select, const BMUVSelectPickParams &params)
void BM_edge_uvselect_set_pick (BMesh *bm, BMEdge *e, bool select, const BMUVSelectPickParams &params)
void BM_face_uvselect_set_pick (BMesh *bm, BMFace *f, bool select, const BMUVSelectPickParams &params)
static void bm_mesh_uvselect_mode_flush_down_deselect_only (BMesh *bm, const short select_mode, const int cd_loop_uv_offset, const bool shared, const bool check_verts, const bool check_edges)
void BM_mesh_uvselect_set_elem_from_mesh (BMesh *bm, const bool select, const BMUVSelectPickParams &params, const blender::VectorList< BMVert * > &verts, const blender::VectorList< BMEdge * > &edges, const blender::VectorList< BMFace * > &faces)
void BM_mesh_uvselect_set_elem_from_mesh (BMesh *bm, bool select, const BMUVSelectPickParams &params, blender::Span< BMVert * > verts, blender::Span< BMEdge * > edges, blender::Span< BMFace * > faces)
UV Selection Flushing (Only Select/De-Select)
void BM_mesh_uvselect_flush_from_loop_verts_only_select (BMesh *bm)
void BM_mesh_uvselect_flush_from_loop_verts_only_deselect (BMesh *bm)
void BM_mesh_uvselect_flush_from_loop_edges_only_select (BMesh *bm)
void BM_mesh_uvselect_flush_from_loop_edges_only_deselect (BMesh *bm)
void BM_mesh_uvselect_flush_from_faces_only_select (BMesh *bm)
void BM_mesh_uvselect_flush_from_faces_only_deselect (BMesh *bm)
void BM_mesh_uvselect_flush_shared_only_select (BMesh *bm, const int cd_loop_uv_offset)
void BM_mesh_uvselect_flush_shared_only_deselect (BMesh *bm, const int cd_loop_uv_offset)
UV Selection Flushing (Between Elements)
void BM_mesh_uvselect_flush_from_loop_verts (BMesh *bm)
void BM_mesh_uvselect_flush_from_loop_edges (BMesh *bm, bool flush_down)
void BM_mesh_uvselect_flush_from_faces (BMesh *bm, bool flush_down)
void BM_mesh_uvselect_flush_from_verts (BMesh *bm, const bool select)
UV Selection Flushing (Selection Mode Aware)
void BM_mesh_uvselect_mode_flush_ex (BMesh *bm, const short selectmode, const bool flush_down)
void BM_mesh_uvselect_mode_flush (BMesh *bm)
void BM_mesh_uvselect_mode_flush_only_select (BMesh *bm)
void BM_mesh_uvselect_mode_flush_update (BMesh *bm, const short selectmode_old, const short selectmode_new, const int cd_loop_uv_offset)
void BM_mesh_uvselect_flush_post_subdivide (BMesh *bm, const int cd_loop_uv_offset)
UV Selection Flushing (From/To Mesh)
static void bm_mesh_uvselect_flush_from_mesh_sticky_vert_for_vert_mode (BMesh *bm)
static void bm_mesh_uvselect_flush_from_mesh_sticky_vert_for_edge_mode (BMesh *bm)
static void bm_mesh_uvselect_flush_from_mesh_sticky_vert_for_face_mode (BMesh *bm)
static void bm_mesh_uvselect_flush_from_mesh_sticky_location_for_vert_mode (BMesh *bm, const int)
static void bm_mesh_uvselect_flush_from_mesh_sticky_location_for_edge_mode (BMesh *bm, const int cd_loop_uv_offset)
static void bm_mesh_uvselect_flush_from_mesh_sticky_location_for_face_mode (BMesh *bm, const int cd_loop_uv_offset)
void BM_mesh_uvselect_sync_from_mesh_sticky_location (BMesh *bm, const int cd_loop_uv_offset)
void BM_mesh_uvselect_sync_from_mesh_sticky_disabled (BMesh *bm)
void BM_mesh_uvselect_sync_from_mesh_sticky_vert (BMesh *bm)
void BM_mesh_uvselect_sync_to_mesh (BMesh *bm)

UV Selection Validation

Split the validity checks into categories.

  • UV selection and viewport selection are in sync. Where a selected UV-vertex must have it's viewport-vertex selected too. Where a selected viewport-vertex must have at least one selected UV.

    This is core to UV sync-select functioning properly.

    Failure to properly sync is likely to result in bugs where UV's aren't handled properly although it should not cause crashes.

  • UV selection flushing. Where the relationship between selected elements makes sense.
    • An face cannot be selected when one of it's vertices is de-selected.
    • An edge cannot be selected if one of it's vertices is de-selected. ... etc ... This is much the same as selection flushing for viewport selection.
  • Contiguous UV selection Where co-located UV's are all either selected or de-selected.

    Failure to select co-located UV's is not an error (on a data-correctness level) rather, it's something that's applied on a "tool" level - depending on UV sticky options. Depending on the tools, it may be intended that UV selection be contiguous across UV's.

#define MAYBE_ASSERT
#define INCF_MAYBE_ASSERT(var)
static void bm_mesh_loop_clear_tag (BMesh *bm)
static bool bm_mesh_uvselect_check_viewport_sync (BMesh *bm, UVSelectValidateInfo_Sync &info_sub)
static bool bm_mesh_uvselect_check_flush (BMesh *bm, UVSelectValidateInfo_Flush &info_sub)
static bool bm_mesh_uvselect_check_contiguous (BMesh *bm, const int cd_loop_uv_offset, UVSelectValidateInfo_Contiguous &info_sub)
static bool bm_mesh_uvselect_check_flush_and_contiguous (BMesh *bm, const int cd_loop_uv_offset, UVSelectValidateInfo_FlushAndContiguous &info_sub)
bool BM_mesh_uvselect_is_valid (BMesh *bm, const int cd_loop_uv_offset, const bool check_sync, const bool check_flush, const bool check_contiguous, UVSelectValidateInfo *info_p)

Macro Definition Documentation

◆ INCF_MAYBE_ASSERT

#define INCF_MAYBE_ASSERT ( var)

◆ MAYBE_ASSERT

#define MAYBE_ASSERT

Definition at line 1981 of file bmesh_uvselect.cc.

Function Documentation

◆ BM_edge_uvselect_set_pick()

void BM_edge_uvselect_set_pick ( BMesh * bm,
BMEdge * e,
bool select,
const BMUVSelectPickParams & params )

Definition at line 864 of file bmesh_uvselect.cc.

References bm, bm_edge_uvselect_set_pick(), e, params, and select.

Referenced by BM_mesh_uvselect_set_elem_from_mesh(), and EDBM_select_pick().

◆ bm_edge_uvselect_set_pick()

◆ BM_face_uvselect_check_edges_all()

bool BM_face_uvselect_check_edges_all ( BMFace * f)

◆ BM_face_uvselect_set()

◆ BM_face_uvselect_set_noflush()

◆ BM_face_uvselect_set_pick()

void BM_face_uvselect_set_pick ( BMesh * bm,
BMFace * f,
bool select,
const BMUVSelectPickParams & params )

◆ bm_face_uvselect_set_pick()

◆ BM_face_uvselect_set_shared()

void BM_face_uvselect_set_shared ( BMesh * bm,
BMFace * f,
bool select,
const int cd_loop_uv_offset )

◆ BM_face_uvselect_test()

bool BM_face_uvselect_test ( const BMFace * f)

Definition at line 55 of file bmesh_uvselect.cc.

References BM_elem_flag_test, BM_ELEM_HIDDEN, and BM_ELEM_SELECT_UV.

◆ BM_loop_edge_uvselect_check_other_face()

◆ BM_loop_edge_uvselect_check_other_loop_edge()

◆ BM_loop_edge_uvselect_set()

void BM_loop_edge_uvselect_set ( BMesh * bm,
BMLoop * l,
bool select )

◆ BM_loop_edge_uvselect_set_noflush()

◆ BM_loop_edge_uvselect_set_shared()

◆ BM_loop_edge_uvselect_test()

bool BM_loop_edge_uvselect_test ( const BMLoop * l)

Definition at line 49 of file bmesh_uvselect.cc.

References BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV_EDGE, and l.

Referenced by ED_uvedit_active_vert_loop_get().

◆ BM_loop_vert_uvselect_check_other_edge()

bool BM_loop_vert_uvselect_check_other_edge ( BMLoop * l,
const char hflag,
const int cd_loop_uv_offset )

◆ BM_loop_vert_uvselect_check_other_face()

◆ BM_loop_vert_uvselect_check_other_loop_edge()

◆ BM_loop_vert_uvselect_check_other_loop_vert()

◆ BM_loop_vert_uvselect_set_noflush()

◆ BM_loop_vert_uvselect_set_shared()

◆ BM_loop_vert_uvselect_test()

bool BM_loop_vert_uvselect_test ( const BMLoop * l)

Definition at line 45 of file bmesh_uvselect.cc.

References BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV, and l.

◆ bm_mesh_loop_clear_tag()

void bm_mesh_loop_clear_tag ( BMesh * bm)
static

◆ bm_mesh_uvselect_check_contiguous()

◆ bm_mesh_uvselect_check_flush()

◆ bm_mesh_uvselect_check_flush_and_contiguous()

◆ bm_mesh_uvselect_check_viewport_sync()

◆ BM_mesh_uvselect_clear()

bool BM_mesh_uvselect_clear ( BMesh * bm)

Call this function when selecting mesh elements in the viewport and the relationship with UV's is lost.

Returns
True if UV select is cleared (a change was made).

This has two purposes:

  • Maintaining the UV selection isn't needed: Some operations such as adding a new mesh primitive clear the selection, selecting all geometry from the new primitive. In this case a UV selection is redundant & should be cleared.
  • Maintaining the UV selection isn't supported: Some selection operations don't support maintaining a valid UV selection, in that case it's necessary to clear the UV selection otherwise tools may seem to be broken if they aren't operating on the selection properly.

    NOTE(@ideasman42): It's worth noting that in this case clearing the selection is "lossy", users may wish that all selection operations would handle UV selection data too. Supporting additional operations is always possible, at the time of writing it's impractical to do so, see: #131642 design task for details.

Internally this marks the UV selection data as invalid, using the mesh selection as the "source-of-truth".

Note
By convention call this immediately after flushing.
In many cases the UV selection can be maintained and this function removed, although it adds some complexity & overhead. See UVSyncSelectFromMesh.
Calls to this function that should not be removed in favor of supporting UV selection, this should be mentioned in a code-comment, making it clear this is not a limitation to fix.

Definition at line 335 of file bmesh_uvselect.cc.

References bm.

Referenced by EDBM_uvselect_clear(), uv_select_sync_update(), and uvedit_select_prepare_custom_data().

◆ bm_mesh_uvselect_disable_all()

◆ BM_mesh_uvselect_flush_from_faces()

void BM_mesh_uvselect_flush_from_faces ( BMesh * bm,
bool flush_down )

Mode independent UV selection/de-selection flush from UV faces.

Flush from faces down to edges & vertices (when flush_down is true).

Note
The caller may need to run BM_mesh_uvselect_flush_shared_only_select afterwards.

Definition at line 1352 of file bmesh_uvselect.cc.

References bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_edge_uvselect_set_noflush(), BM_loop_vert_uvselect_set_noflush(), and BMLoop::next.

Referenced by BM_mesh_uvselect_mode_flush_ex().

◆ BM_mesh_uvselect_flush_from_faces_only_deselect()

◆ BM_mesh_uvselect_flush_from_faces_only_select()

◆ BM_mesh_uvselect_flush_from_loop_edges()

void BM_mesh_uvselect_flush_from_loop_edges ( BMesh * bm,
bool flush_down )

Mode independent UV selection/de-selection flush from UV edges.

Flush from loop edges up to faces and optionally down to vertices (when flush_down is true).

Note
The caller may need to run BM_mesh_uvselect_flush_shared_only_select afterwards.

Definition at line 1305 of file bmesh_uvselect.cc.

References bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV_EDGE, BM_FACE_FIRST_LOOP, BM_face_uvselect_set_noflush(), BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_vert_uvselect_set_noflush(), and BMLoop::next.

Referenced by BM_mesh_uvselect_mode_flush_ex(), BM_mesh_uvselect_mode_flush_update(), and uv_select_flush_from_loop_edge_flag().

◆ BM_mesh_uvselect_flush_from_loop_edges_only_deselect()

◆ BM_mesh_uvselect_flush_from_loop_edges_only_select()

◆ BM_mesh_uvselect_flush_from_loop_verts()

void BM_mesh_uvselect_flush_from_loop_verts ( BMesh * bm)

Mode independent UV selection/de-selection flush from UV vertices.

Parameters
selectWhen true, flush the selection state to de-selected elements, otherwise perform the opposite, flushing de-selection.
Note
The caller may need to run BM_mesh_uvselect_flush_shared_only_select afterwards.

Definition at line 1281 of file bmesh_uvselect.cc.

References bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV, BM_FACE_FIRST_LOOP, BM_face_uvselect_set_noflush(), BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_edge_uvselect_set_noflush(), BMLoop::next, and select.

Referenced by BM_mesh_uvselect_mode_flush_ex(), BM_mesh_uvselect_mode_flush_update(), and uv_rip_object().

◆ BM_mesh_uvselect_flush_from_loop_verts_only_deselect()

◆ BM_mesh_uvselect_flush_from_loop_verts_only_select()

◆ bm_mesh_uvselect_flush_from_mesh_sticky_location_for_edge_mode()

void bm_mesh_uvselect_flush_from_mesh_sticky_location_for_edge_mode ( BMesh * bm,
const int cd_loop_uv_offset )
static

◆ bm_mesh_uvselect_flush_from_mesh_sticky_location_for_face_mode()

◆ bm_mesh_uvselect_flush_from_mesh_sticky_location_for_vert_mode()

void bm_mesh_uvselect_flush_from_mesh_sticky_location_for_vert_mode ( BMesh * bm,
const int  )
static

◆ bm_mesh_uvselect_flush_from_mesh_sticky_vert_for_edge_mode()

◆ bm_mesh_uvselect_flush_from_mesh_sticky_vert_for_face_mode()

◆ bm_mesh_uvselect_flush_from_mesh_sticky_vert_for_vert_mode()

◆ BM_mesh_uvselect_flush_from_verts()

void BM_mesh_uvselect_flush_from_verts ( BMesh * bm,
bool select )

Mode independent UV selection/de-selection flush from UV vertices.

Use this when it's know geometry was only selected/de-selected.

Note
An equivalent to BM_mesh_select_flush_from_verts for the UV selection.

Definition at line 1375 of file bmesh_uvselect.cc.

References bm, BM_mesh_uvselect_flush_from_loop_verts_only_deselect(), BM_mesh_uvselect_flush_from_loop_verts_only_select(), and select.

Referenced by bpy_bmesh_uv_select_flush().

◆ BM_mesh_uvselect_flush_post_subdivide()

void BM_mesh_uvselect_flush_post_subdivide ( BMesh * bm,
int cd_loop_uv_offset )

A specialized flushing that fills in selection information after subdividing.

It's important this runs:

  • After subdivision.
  • After the mesh selection has already been flushed.
Note
Intended to be a generic utility to be used in any situation new geometry is created by splitting existing geometry.

Definition at line 1515 of file bmesh_uvselect.cc.

References bm, BM_edge_is_any_face_flag_test(), BM_EDGES_OF_MESH, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_ELEM_SELECT_UV, BM_ELEM_SELECT_UV_EDGE, BM_FACE_FIRST_LOOP, BM_face_uvselect_set(), BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_edge_uvselect_check_other_loop_edge(), BM_loop_edge_uvselect_set(), BM_loop_vert_uvselect_check_other_loop_vert(), BM_loop_vert_uvselect_set_noflush(), BM_mesh_uvselect_mode_flush_only_select(), e, BMLoop::next, BMLoop::radial_next, SCE_SELECT_EDGE, and SCE_SELECT_VERTEX.

Referenced by BM_mesh_esubdivide().

◆ BM_mesh_uvselect_flush_shared_only_deselect()

◆ BM_mesh_uvselect_flush_shared_only_select()

void BM_mesh_uvselect_flush_shared_only_select ( BMesh * bm,
int cd_loop_uv_offset )

A useful utility so simple selection operations can be performed on edges/faces, afterwards this can be used to select UV's that are connected. This avoids having to use more involved UV connectivity aware logic inline.

Definition at line 1213 of file bmesh_uvselect.cc.

References BLI_assert, bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV, BM_ELEM_SELECT_UV_EDGE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_edge_uvselect_check_other_loop_edge(), BM_loop_edge_uvselect_set_noflush(), BM_loop_vert_uvselect_check_other_loop_vert(), BM_loop_vert_uvselect_set_noflush(), and BMLoop::next.

Referenced by bpy_bmesh_uv_select_flush_shared(), ED_uvedit_select_sync_flush(), and uv_select_invert().

◆ BM_mesh_uvselect_is_valid()

bool BM_mesh_uvselect_is_valid ( BMesh * bm,
int cd_loop_uv_offset,
bool check_sync,
bool check_flush,
bool check_contiguous,
UVSelectValidateInfo * info )

Check the UV selection is valid, mainly for debugging & testing purposes.

The primary check which should remain valid is: check_sync, if there is ever a selected vertex without any selected UV's or a selected UV without it's vertex being selected (and similar kinds of issues), then the selection is out-of-sync, which Blender should never allow.

While an invalid selection should not crash, tools that operate on selection may behave unpredictably.

The other checks may be desired or not although this depends more on the situation.

Parameters
cd_loop_uv_offsetThe UV custom-data layer to check. Ignored when -1 (UV checks wont be used).
check_syncWhen true, check the selection is synchronized between the UV and mesh selection. This should practically always be true, as it doesn't make sense to check the UV selection if valid otherwise, unless the UV selection is being set and has not yet been synchronized.
check_flushWhen true, check the selection is flushed based on BMesh::selectmode.
check_contiguousWhen true, check that UV selection is contiguous. Note that this is not considered an error since users may cause this to happen and tools are expected to work properly, however some operations are expected to maintain a contiguous selection. This check is included to ensure those operations are working.

Definition at line 2463 of file bmesh_uvselect.cc.

References BLI_assert, bm, bm_mesh_uvselect_check_contiguous(), bm_mesh_uvselect_check_flush(), bm_mesh_uvselect_check_flush_and_contiguous(), bm_mesh_uvselect_check_viewport_sync(), UVSelectValidateInfo::contiguous, UVSelectValidateInfo::flush, UVSelectValidateInfo::flush_contiguous, and UVSelectValidateInfo::sync.

Referenced by bpy_bm_utils_uv_select_check(), and undomesh_from_editmesh().

◆ BM_mesh_uvselect_mode_flush()

void BM_mesh_uvselect_mode_flush ( BMesh * bm)

◆ bm_mesh_uvselect_mode_flush_down_deselect_only()

void bm_mesh_uvselect_mode_flush_down_deselect_only ( BMesh * bm,
const short select_mode,
const int cd_loop_uv_offset,
const bool shared,
const bool check_verts,
const bool check_edges )
static

Ensure isolated elements aren't selected which should be unselected based on select_mode.

Regarding Picking

Run this when picking a vertex in edge selection mode or an edge in face select mode.

This is not supported by individual picking, however when operating on many elements, it's useful to be able to support this so users of the API can select vertices for example Without it failing entirely because the users has the mesh in edge/face selection mode.

Definition at line 893 of file bmesh_uvselect.cc.

References bm, BM_elem_flag_disable, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT_UV, BM_ELEM_SELECT_UV_EDGE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_loop_edge_uvselect_check_other_face(), BM_loop_vert_uvselect_check_other_face(), BM_loop_vert_uvselect_check_other_loop_edge(), BMLoop::next, BMLoop::prev, SCE_SELECT_EDGE, SCE_SELECT_FACE, SCE_SELECT_VERTEX, and shared.

Referenced by BM_mesh_uvselect_mode_flush_update(), BM_mesh_uvselect_set_elem_from_mesh(), and BM_mesh_uvselect_set_elem_from_mesh().

◆ BM_mesh_uvselect_mode_flush_ex()

void BM_mesh_uvselect_mode_flush_ex ( BMesh * bm,
const short selectmode,
bool flush_down )

◆ BM_mesh_uvselect_mode_flush_only_select()

void BM_mesh_uvselect_mode_flush_only_select ( BMesh * bm)

Select elements based on the selection mode. (flushes the selection up based on the mode).

  • With vertex selection mode enabled: flush up to edges and faces.
  • With edge selection mode enabled: flush to faces.
  • With only face selection mode enabled: do nothing.
Note
An "only deselect" version function could be added, it's not needed at the moment.a

Definition at line 1409 of file bmesh_uvselect.cc.

References bm, BM_mesh_uvselect_flush_from_loop_edges_only_select(), BM_mesh_uvselect_flush_from_loop_verts_only_select(), SCE_SELECT_EDGE, and SCE_SELECT_VERTEX.

Referenced by BM_mesh_uvselect_flush_post_subdivide().

◆ BM_mesh_uvselect_mode_flush_update()

void BM_mesh_uvselect_mode_flush_update ( BMesh * bm,
short selectmode_old,
short selectmode_new,
int cd_loop_uv_offset )

When the select mode changes, update to ensure the selection is valid. So single vertices aren't selected in edge-select mode for example.

The mesh selection flushing must have already run.

Definition at line 1422 of file bmesh_uvselect.cc.

References bm, BM_elem_flag_disable, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_ELEM_SELECT_UV, BM_ELEM_SELECT_UV_EDGE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_mesh_uvselect_flush_from_loop_edges(), BM_mesh_uvselect_flush_from_loop_verts(), bm_mesh_uvselect_mode_flush_down_deselect_only(), BMLoop::e, highest_order_bit_s(), BMLoop::next, SCE_SELECT_EDGE, SCE_SELECT_VERTEX, shared, and BMLoop::v.

Referenced by EDBM_selectmode_set(), and uv_select_sync_update().

◆ BM_mesh_uvselect_set_elem_from_mesh() [1/2]

void BM_mesh_uvselect_set_elem_from_mesh ( BMesh * bm,
bool select,
const BMUVSelectPickParams & params,
blender::Span< BMVert * > verts,
blender::Span< BMEdge * > edges,
blender::Span< BMFace * > faces )

Select/deselect elements in the viewport, then integrate the selection with the UV selection, without clearing an re-initializing the synchronized state. (likely to re-select islands bounds from a user-perspective).

Definition at line 1026 of file bmesh_uvselect.cc.

References bm, BM_edge_uvselect_set_pick(), BM_face_uvselect_set_pick(), bm_mesh_uvselect_mode_flush_down_deselect_only(), BM_vert_uvselect_set_pick(), e, faces, blender::Span< T >::is_empty(), params, select, v, and verts.

◆ BM_mesh_uvselect_set_elem_from_mesh() [2/2]

◆ BM_mesh_uvselect_set_elem_shared()

◆ BM_mesh_uvselect_sync_from_mesh_sticky_disabled()

void BM_mesh_uvselect_sync_from_mesh_sticky_disabled ( BMesh * bm)

◆ BM_mesh_uvselect_sync_from_mesh_sticky_location()

◆ BM_mesh_uvselect_sync_from_mesh_sticky_vert()

◆ BM_mesh_uvselect_sync_to_mesh()

◆ BM_vert_uvselect_set_pick()

void BM_vert_uvselect_set_pick ( BMesh * bm,
BMVert * v,
bool select,
const BMUVSelectPickParams & params )

Definition at line 856 of file bmesh_uvselect.cc.

References bm, bm_vert_uvselect_set_pick(), params, select, and v.

Referenced by BM_mesh_uvselect_set_elem_from_mesh(), and EDBM_select_pick().

◆ bm_vert_uvselect_set_pick()