Blender  V3.3
Classes | Macros | Typedefs | Functions
uvedit_intern.h File Reference

Go to the source code of this file.

Classes

struct  UvNearestHit
 

Macros

#define UV_NEAREST_HIT_INIT_DIST_PX(v2d, dist_px)
 
#define UV_NEAREST_HIT_INIT_MAX(v2d)
 

Typedefs

typedef struct UvNearestHit UvNearestHit
 

Functions

void uv_poly_copy_aspect (float uv_orig[][2], float uv[][2], float aspx, float aspy, int len)
 
bool uv_find_nearest_vert (struct Scene *scene, struct Object *obedit, const float co[2], float penalty_dist, struct UvNearestHit *hit)
 
bool uv_find_nearest_vert_multi (struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], float penalty_dist, struct UvNearestHit *hit)
 
bool uv_find_nearest_edge (struct Scene *scene, struct Object *obedit, const float co[2], float penalty, struct UvNearestHit *hit)
 
bool uv_find_nearest_edge_multi (struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], float penalty, struct UvNearestHit *hit)
 
bool uv_find_nearest_face_ex (struct Scene *scene, struct Object *obedit, const float co[2], struct UvNearestHit *hit, bool only_in_face)
 
bool uv_find_nearest_face (struct Scene *scene, struct Object *obedit, const float co[2], struct UvNearestHit *hit)
 
bool uv_find_nearest_face_multi_ex (struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], struct UvNearestHit *hit, bool only_in_face)
 
bool uv_find_nearest_face_multi (struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], struct UvNearestHit *hit)
 
BMLoopuv_find_nearest_loop_from_vert (struct Scene *scene, struct Object *obedit, struct BMVert *v, const float co[2])
 
BMLoopuv_find_nearest_loop_from_edge (struct Scene *scene, struct Object *obedit, struct BMEdge *e, const float co[2])
 
bool uvedit_vert_is_edge_select_any_other (const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
 
bool uvedit_vert_is_face_select_any_other (const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
 
bool uvedit_vert_is_all_other_faces_selected (const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
 
void uvedit_live_unwrap_update (struct SpaceImage *sima, struct Scene *scene, struct Object *obedit)
 
void UV_OT_average_islands_scale (struct wmOperatorType *ot)
 
void UV_OT_cube_project (struct wmOperatorType *ot)
 
void UV_OT_cylinder_project (struct wmOperatorType *ot)
 
void UV_OT_project_from_view (struct wmOperatorType *ot)
 
void UV_OT_minimize_stretch (struct wmOperatorType *ot)
 
void UV_OT_pack_islands (struct wmOperatorType *ot)
 
void UV_OT_reset (struct wmOperatorType *ot)
 
void UV_OT_sphere_project (struct wmOperatorType *ot)
 
void UV_OT_unwrap (struct wmOperatorType *ot)
 
void UV_OT_rip (struct wmOperatorType *ot)
 
void UV_OT_stitch (struct wmOperatorType *ot)
 
void UV_OT_smart_project (struct wmOperatorType *ot)
 
void UV_OT_shortest_path_pick (struct wmOperatorType *ot)
 
void UV_OT_shortest_path_select (struct wmOperatorType *ot)
 
bool uvedit_select_is_any_selected (const struct Scene *scene, struct Object *obedit)
 
bool uvedit_select_is_any_selected_multi (const struct Scene *scene, struct Object **objects, uint objects_len)
 
const floatuvedit_first_selected_uv_from_vertex (struct Scene *scene, struct BMVert *eve, int cd_loop_uv_offset)
 
void UV_OT_select_all (struct wmOperatorType *ot)
 
void UV_OT_select (struct wmOperatorType *ot)
 
void UV_OT_select_loop (struct wmOperatorType *ot)
 
void UV_OT_select_edge_ring (struct wmOperatorType *ot)
 
void UV_OT_select_linked (struct wmOperatorType *ot)
 
void UV_OT_select_linked_pick (struct wmOperatorType *ot)
 
void UV_OT_select_split (struct wmOperatorType *ot)
 
void UV_OT_select_pinned (struct wmOperatorType *ot)
 
void UV_OT_select_box (struct wmOperatorType *ot)
 
void UV_OT_select_lasso (struct wmOperatorType *ot)
 
void UV_OT_select_circle (struct wmOperatorType *ot)
 
void UV_OT_select_more (struct wmOperatorType *ot)
 
void UV_OT_select_less (struct wmOperatorType *ot)
 
void UV_OT_select_overlap (struct wmOperatorType *ot)
 
void UV_OT_select_similar (struct wmOperatorType *ot)
 
void UV_OT_select_mode (struct wmOperatorType *ot)
 

Macro Definition Documentation

◆ UV_NEAREST_HIT_INIT_DIST_PX

#define UV_NEAREST_HIT_INIT_DIST_PX (   v2d,
  dist_px 
)
Value:
{ \
.dist_sq = square_f(U.pixelsize * dist_px), \
.scale = { \
UI_view2d_scale_get_x(v2d), \
UI_view2d_scale_get_y(v2d), \
}, \
}
MINLINE float square_f(float a)
unsigned int U
Definition: btGjkEpa3.h:78

Definition at line 40 of file uvedit_intern.h.

◆ UV_NEAREST_HIT_INIT_MAX

#define UV_NEAREST_HIT_INIT_MAX (   v2d)
Value:
{ \
.dist_sq = FLT_MAX, \
.scale = { \
UI_view2d_scale_get_x(v2d), \
UI_view2d_scale_get_y(v2d), \
}, \
}

Definition at line 49 of file uvedit_intern.h.

Typedef Documentation

◆ UvNearestHit

typedef struct UvNearestHit UvNearestHit

Function Documentation

◆ uv_find_nearest_edge()

bool uv_find_nearest_edge ( struct Scene scene,
struct Object obedit,
const float  co[2],
float  penalty,
struct UvNearestHit hit 
)

◆ uv_find_nearest_edge_multi()

bool uv_find_nearest_edge_multi ( struct Scene scene,
struct Object **  objects,
uint  objects_len,
const float  co[2],
float  penalty,
struct UvNearestHit hit 
)

◆ uv_find_nearest_face()

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

Definition at line 942 of file uvedit_select.c.

References scene, and uv_find_nearest_face_ex().

Referenced by uv_shortest_path_pick_invoke().

◆ uv_find_nearest_face_ex()

bool uv_find_nearest_face_ex ( struct Scene scene,
struct Object obedit,
const float  co[2],
struct 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 899 of file uvedit_select.c.

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_MLOOPUV, CustomData_get_offset(), UvNearestHit::dist_sq, UvNearestHit::efa, BMesh::ldata, len_squared_v2(), mul_v2_v2(), UvNearestHit::ob, UvNearestHit::scale, scene, 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 ( struct Scene scene,
struct Object **  objects,
uint  objects_len,
const float  co[2],
struct UvNearestHit hit 
)

Definition at line 964 of file uvedit_select.c.

References scene, and 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 ( struct Scene scene,
struct Object **  objects,
uint  objects_len,
const float  co[2],
struct UvNearestHit hit,
bool  only_in_face 
)

Definition at line 947 of file uvedit_select.c.

References scene, and uv_find_nearest_face_ex().

Referenced by uv_find_nearest_face_multi(), and uv_mouse_select_multi().

◆ uv_find_nearest_loop_from_edge()

BMLoop* uv_find_nearest_loop_from_edge ( struct Scene scene,
struct Object obedit,
struct BMEdge e,
const float  co[2] 
)

◆ uv_find_nearest_loop_from_vert()

BMLoop* uv_find_nearest_loop_from_vert ( struct Scene scene,
struct Object obedit,
struct BMVert v,
const float  co[2] 
)

◆ uv_find_nearest_vert()

bool uv_find_nearest_vert ( struct Scene scene,
struct Object obedit,
const float  co[2],
float  penalty_dist,
struct UvNearestHit hit 
)

◆ uv_find_nearest_vert_multi()

bool uv_find_nearest_vert_multi ( struct Scene scene,
struct Object **  objects,
uint  objects_len,
const float  co[2],
float  penalty_dist,
struct UvNearestHit hit 
)

Definition at line 1038 of file uvedit_select.c.

References scene, and uv_find_nearest_vert().

Referenced by stitch_select(), and uv_mouse_select_multi().

◆ UV_OT_average_islands_scale()

void UV_OT_average_islands_scale ( struct wmOperatorType ot)

◆ UV_OT_cube_project()

void UV_OT_cube_project ( struct wmOperatorType ot)

◆ UV_OT_cylinder_project()

void UV_OT_cylinder_project ( struct wmOperatorType ot)

◆ UV_OT_minimize_stretch()

void UV_OT_minimize_stretch ( struct wmOperatorType ot)

◆ UV_OT_pack_islands()

void UV_OT_pack_islands ( struct wmOperatorType ot)

◆ UV_OT_project_from_view()

void UV_OT_project_from_view ( struct wmOperatorType ot)

◆ UV_OT_reset()

void UV_OT_reset ( struct wmOperatorType ot)

◆ UV_OT_rip()

void UV_OT_rip ( struct wmOperatorType ot)

◆ UV_OT_select()

void UV_OT_select ( struct wmOperatorType ot)

◆ UV_OT_select_all()

void UV_OT_select_all ( struct wmOperatorType ot)

◆ UV_OT_select_box()

void UV_OT_select_box ( struct wmOperatorType ot)

◆ UV_OT_select_circle()

void UV_OT_select_circle ( struct wmOperatorType ot)

◆ UV_OT_select_edge_ring()

void UV_OT_select_edge_ring ( struct wmOperatorType ot)

◆ UV_OT_select_lasso()

void UV_OT_select_lasso ( struct wmOperatorType ot)

◆ UV_OT_select_less()

void UV_OT_select_less ( struct wmOperatorType ot)

◆ UV_OT_select_linked()

void UV_OT_select_linked ( struct wmOperatorType ot)

◆ UV_OT_select_linked_pick()

void UV_OT_select_linked_pick ( struct wmOperatorType ot)

◆ UV_OT_select_loop()

void UV_OT_select_loop ( struct wmOperatorType ot)

◆ UV_OT_select_mode()

void UV_OT_select_mode ( struct wmOperatorType ot)

◆ UV_OT_select_more()

void UV_OT_select_more ( struct wmOperatorType ot)

◆ UV_OT_select_overlap()

void UV_OT_select_overlap ( struct wmOperatorType ot)

◆ UV_OT_select_pinned()

void UV_OT_select_pinned ( struct wmOperatorType ot)

◆ UV_OT_select_similar()

void UV_OT_select_similar ( struct wmOperatorType ot)

◆ UV_OT_select_split()

void UV_OT_select_split ( struct wmOperatorType ot)

◆ UV_OT_shortest_path_pick()

void UV_OT_shortest_path_pick ( struct wmOperatorType ot)

◆ UV_OT_shortest_path_select()

void UV_OT_shortest_path_select ( struct wmOperatorType ot)

◆ UV_OT_smart_project()

void UV_OT_smart_project ( struct wmOperatorType ot)

◆ UV_OT_sphere_project()

void UV_OT_sphere_project ( struct wmOperatorType ot)

◆ UV_OT_stitch()

void UV_OT_stitch ( struct wmOperatorType ot)

◆ UV_OT_unwrap()

void UV_OT_unwrap ( struct wmOperatorType ot)

◆ uv_poly_copy_aspect()

void uv_poly_copy_aspect ( float  uv_orig[][2],
float  uv[][2],
float  aspx,
float  aspy,
int  len 
)

Definition at line 192 of file uvedit_ops.c.

References len.

◆ uvedit_first_selected_uv_from_vertex()

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

Definition at line 2016 of file uvedit_select.c.

References BM_ELEM_CD_GET_VOID_P, BM_ITER_ELEM, BM_LOOPS_OF_VERT, BMLoop::f, l, NULL, scene, MLoopUV::uv, uvedit_face_visible_test(), and uvedit_uv_select_test().

◆ uvedit_live_unwrap_update()

void uvedit_live_unwrap_update ( struct SpaceImage sima,
struct Scene scene,
struct Object obedit 
)

◆ uvedit_select_is_any_selected()

bool uvedit_select_is_any_selected ( const struct Scene scene,
struct Object obedit 
)

◆ uvedit_select_is_any_selected_multi()

bool uvedit_select_is_any_selected_multi ( const struct Scene scene,
struct Object **  objects,
uint  objects_len 
)

◆ uvedit_vert_is_all_other_faces_selected()

bool uvedit_vert_is_all_other_faces_selected ( const struct Scene scene,
struct BMLoop l,
const int  cd_loop_uv_offset 
)

◆ uvedit_vert_is_edge_select_any_other()

bool uvedit_vert_is_edge_select_any_other ( const struct Scene scene,
struct BMLoop l,
const int  cd_loop_uv_offset 
)

◆ uvedit_vert_is_face_select_any_other()

bool uvedit_vert_is_face_select_any_other ( const struct Scene scene,
struct BMLoop l,
const int  cd_loop_uv_offset 
)