Blender  V3.3
uvedit_intern.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 struct BMFace;
11 struct BMLoop;
12 struct Object;
13 struct Scene;
14 struct SpaceImage;
15 struct wmOperatorType;
16 
17 /* geometric utilities */
18 void uv_poly_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy, int len);
19 
20 /* find nearest */
21 
22 typedef struct UvNearestHit {
24  struct Object *ob;
26  struct BMFace *efa;
27  struct BMLoop *l;
34  float dist_sq;
35 
37  float scale[2];
39 
40 #define UV_NEAREST_HIT_INIT_DIST_PX(v2d, dist_px) \
41  { \
42  .dist_sq = square_f(U.pixelsize * dist_px), \
43  .scale = { \
44  UI_view2d_scale_get_x(v2d), \
45  UI_view2d_scale_get_y(v2d), \
46  }, \
47  }
48 
49 #define UV_NEAREST_HIT_INIT_MAX(v2d) \
50  { \
51  .dist_sq = FLT_MAX, \
52  .scale = { \
53  UI_view2d_scale_get_x(v2d), \
54  UI_view2d_scale_get_y(v2d), \
55  }, \
56  }
57 
58 bool uv_find_nearest_vert(struct Scene *scene,
59  struct Object *obedit,
60  const float co[2],
61  float penalty_dist,
62  struct UvNearestHit *hit);
64  struct Object **objects,
65  uint objects_len,
66  const float co[2],
67  float penalty_dist,
68  struct UvNearestHit *hit);
69 
70 bool uv_find_nearest_edge(struct Scene *scene,
71  struct Object *obedit,
72  const float co[2],
73  float penalty,
74  struct UvNearestHit *hit);
76  struct Object **objects,
77  uint objects_len,
78  const float co[2],
79  float penalty,
80  struct UvNearestHit *hit);
81 
92  struct Object *obedit,
93  const float co[2],
94  struct UvNearestHit *hit,
95  bool only_in_face);
96 bool uv_find_nearest_face(struct Scene *scene,
97  struct Object *obedit,
98  const float co[2],
99  struct UvNearestHit *hit);
101  struct Object **objects,
102  uint objects_len,
103  const float co[2],
104  struct UvNearestHit *hit,
105  bool only_in_face);
107  struct Object **objects,
108  uint objects_len,
109  const float co[2],
110  struct UvNearestHit *hit);
111 
113  struct Object *obedit,
114  struct BMVert *v,
115  const float co[2]);
117  struct Object *obedit,
118  struct BMEdge *e,
119  const float co[2]);
120 
122  struct BMLoop *l,
123  const int cd_loop_uv_offset);
125  struct BMLoop *l,
126  const int cd_loop_uv_offset);
128  struct BMLoop *l,
129  const int cd_loop_uv_offset);
130 
131 /* utility tool functions */
132 
133 void uvedit_live_unwrap_update(struct SpaceImage *sima,
134  struct Scene *scene,
135  struct Object *obedit);
136 
137 /* operators */
138 
140 void UV_OT_cube_project(struct wmOperatorType *ot);
144 void UV_OT_pack_islands(struct wmOperatorType *ot);
145 void UV_OT_reset(struct wmOperatorType *ot);
147 void UV_OT_unwrap(struct wmOperatorType *ot);
148 void UV_OT_rip(struct wmOperatorType *ot);
149 void UV_OT_stitch(struct wmOperatorType *ot);
151 
152 /* uvedit_path.c */
153 
156 
157 /* uvedit_select.c */
158 
159 bool uvedit_select_is_any_selected(const struct Scene *scene, struct Object *obedit);
161  struct Object **objects,
162  uint objects_len);
168  struct BMVert *eve,
169  int cd_loop_uv_offset);
170 
171 void UV_OT_select_all(struct wmOperatorType *ot);
172 void UV_OT_select(struct wmOperatorType *ot);
173 void UV_OT_select_loop(struct wmOperatorType *ot);
177 void UV_OT_select_split(struct wmOperatorType *ot);
179 void UV_OT_select_box(struct wmOperatorType *ot);
180 void UV_OT_select_lasso(struct wmOperatorType *ot);
182 void UV_OT_select_more(struct wmOperatorType *ot);
183 void UV_OT_select_less(struct wmOperatorType *ot);
186 /* Used only when UV sync select is disabled. */
187 void UV_OT_select_mode(struct wmOperatorType *ot);
unsigned int uint
Definition: BLI_sys_types.h:67
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
Scene scene
int len
Definition: draw_manager.c:108
struct BMLoop * l
Definition: uvedit_intern.h:27
struct Object * ob
Definition: uvedit_intern.h:24
float scale[2]
Definition: uvedit_intern.h:37
struct BMFace * efa
Definition: uvedit_intern.h:26
bool uvedit_vert_is_edge_select_any_other(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
void UV_OT_rip(struct wmOperatorType *ot)
Definition: uvedit_rip.c:945
void UV_OT_select_linked(struct wmOperatorType *ot)
void uv_poly_copy_aspect(float uv_orig[][2], float uv[][2], float aspx, float aspy, int len)
Definition: uvedit_ops.c:192
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 uvedit_vert_is_face_select_any_other(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
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 uvedit_select_is_any_selected(const struct Scene *scene, struct Object *obedit)
void UV_OT_select_similar(struct wmOperatorType *ot)
bool uv_find_nearest_face_multi(struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], struct UvNearestHit *hit)
bool uvedit_select_is_any_selected_multi(const struct Scene *scene, struct Object **objects, uint objects_len)
BMLoop * uv_find_nearest_loop_from_vert(struct Scene *scene, struct Object *obedit, struct BMVert *v, const float co[2])
BMLoop * uv_find_nearest_loop_from_edge(struct Scene *scene, struct Object *obedit, struct BMEdge *e, const float co[2])
void UV_OT_select_less(struct wmOperatorType *ot)
void UV_OT_select_loop(struct wmOperatorType *ot)
void UV_OT_select(struct wmOperatorType *ot)
void UV_OT_select_pinned(struct wmOperatorType *ot)
struct UvNearestHit UvNearestHit
const float * uvedit_first_selected_uv_from_vertex(struct Scene *scene, struct BMVert *eve, int cd_loop_uv_offset)
void UV_OT_select_overlap(struct wmOperatorType *ot)
void UV_OT_select_box(struct wmOperatorType *ot)
void UV_OT_unwrap(struct wmOperatorType *ot)
bool uv_find_nearest_vert(struct Scene *scene, struct Object *obedit, const float co[2], float penalty_dist, struct UvNearestHit *hit)
void UV_OT_select_mode(struct wmOperatorType *ot)
void UV_OT_sphere_project(struct wmOperatorType *ot)
bool uvedit_vert_is_all_other_faces_selected(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
void UV_OT_select_more(struct wmOperatorType *ot)
void uvedit_live_unwrap_update(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit)
Definition: uvedit_ops.c:177
void UV_OT_smart_project(struct wmOperatorType *ot)
void UV_OT_shortest_path_pick(struct wmOperatorType *ot)
Definition: uvedit_path.c:753
void UV_OT_shortest_path_select(struct wmOperatorType *ot)
Definition: uvedit_path.c:852
bool uv_find_nearest_face_ex(struct Scene *scene, struct Object *obedit, const float co[2], struct UvNearestHit *hit, bool only_in_face)
void UV_OT_cube_project(struct wmOperatorType *ot)
void UV_OT_cylinder_project(struct wmOperatorType *ot)
void UV_OT_select_split(struct wmOperatorType *ot)
void UV_OT_select_all(struct wmOperatorType *ot)
void UV_OT_stitch(struct wmOperatorType *ot)
void UV_OT_select_lasso(struct wmOperatorType *ot)
void UV_OT_reset(struct wmOperatorType *ot)
bool uv_find_nearest_face(struct Scene *scene, struct Object *obedit, const float co[2], struct UvNearestHit *hit)
void UV_OT_average_islands_scale(struct wmOperatorType *ot)
void UV_OT_select_linked_pick(struct wmOperatorType *ot)
bool uv_find_nearest_edge(struct Scene *scene, struct Object *obedit, const float co[2], float penalty, 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)
void UV_OT_select_circle(struct wmOperatorType *ot)
void UV_OT_project_from_view(struct wmOperatorType *ot)
void UV_OT_pack_islands(struct wmOperatorType *ot)
void UV_OT_minimize_stretch(struct wmOperatorType *ot)
void UV_OT_select_edge_ring(struct wmOperatorType *ot)
wmOperatorType * ot
Definition: wm_files.c:3479