Blender V4.3
uvedit_islands.cc File Reference
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BKE_editmesh.hh"
#include "DNA_image_types.h"
#include "ED_uvedit.hh"

Go to the source code of this file.

Classes

struct  SharedUVLoopData
 

Functions

UDIM packing helper functions
bool uv_coords_isect_udim (const Image *image, const int udim_grid[2], const float coords[2])
 
Calculate UV Islands
static bool bm_loop_uv_shared_edge_check (const BMLoop *l_a, const BMLoop *l_b, void *user_data)
 
static bool uvedit_is_face_affected_for_calc_uv_islands (const Scene *scene, BMFace *efa, const bool only_selected_faces, const bool only_selected_uvs, const BMUVOffsets &uv_offsets)
 
int bm_mesh_calc_uv_islands (const Scene *scene, BMesh *bm, ListBase *island_list, const bool only_selected_faces, const bool only_selected_uvs, const bool use_seams, const float aspect_y, const BMUVOffsets uv_offsets)
 

Detailed Description

Utilities for manipulating UV islands.

Note
This is similar to GEO_uv_parametrizer.hh, however the data structures there don't support arbitrary topology such as an edge with 3 or more faces using it. This API uses BMesh data structures and doesn't have limitations for manifold meshes.

Definition in file uvedit_islands.cc.

Function Documentation

◆ bm_loop_uv_shared_edge_check()

static bool bm_loop_uv_shared_edge_check ( const BMLoop * l_a,
const BMLoop * l_b,
void * user_data )
static

◆ bm_mesh_calc_uv_islands()

int bm_mesh_calc_uv_islands ( const Scene * scene,
BMesh * bm,
ListBase * island_list,
const bool only_selected_faces,
const bool only_selected_uvs,
const bool use_seams,
const float aspect_y,
BMUVOffsets offsets )

◆ uv_coords_isect_udim()

bool uv_coords_isect_udim ( const Image * image,
const int udim_grid[2],
const float coords[2] )

Returns true if UV coordinates lie on a valid tile in UDIM grid or tiled image.

Definition at line 29 of file uvedit_islands.cc.

References floorf, IMA_SRC_TILED, is_zero_v2(), LISTBASE_FOREACH, tile, and tile_index.

Referenced by blender::geometry::UVPackIsland_Params::setUDIMOffsetFromSpaceImage(), and uvedit_pack_islands_multi().

◆ uvedit_is_face_affected_for_calc_uv_islands()

static bool uvedit_is_face_affected_for_calc_uv_islands ( const Scene * scene,
BMFace * efa,
const bool only_selected_faces,
const bool only_selected_uvs,
const BMUVOffsets & uv_offsets )
static

Returns true if efa is able to be affected by a packing operation, given various parameters.

Checks if it's (not) hidden, and optionally selected, and/or UV selected.

Will eventually be superseded by BM_uv_element_map_create().

Loosely based on uvedit_is_face_affected, but "bug-compatible" with previous code.

Definition at line 91 of file uvedit_islands.cc.

References BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, and uvedit_face_select_test().

Referenced by bm_mesh_calc_uv_islands().