Blender  V2.93
ED_uvedit.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct ARegion;
31 struct ARegionType;
32 struct BMEditMesh;
33 struct BMFace;
34 struct BMLoop;
35 struct BMesh;
36 struct Image;
37 struct ImageUser;
38 struct Main;
39 struct Object;
40 struct Scene;
41 struct SpaceImage;
42 struct ToolSettings;
43 struct ViewLayer;
44 struct bNode;
45 struct wmKeyConfig;
46 
47 /* uvedit_ops.c */
48 void ED_operatortypes_uvedit(void);
49 void ED_operatormacros_uvedit(void);
50 void ED_keymap_uvedit(struct wmKeyConfig *keyconf);
51 
52 bool ED_uvedit_minmax(const struct Scene *scene,
53  struct Object *obedit,
54  float min[2],
55  float max[2]);
56 void ED_uvedit_select_all(struct BMesh *bm);
57 
58 bool ED_uvedit_minmax_multi(const struct Scene *scene,
59  struct Object **objects_edit,
60  uint objects_len,
61  float r_min[2],
62  float r_max[2]);
63 bool ED_uvedit_center_multi(const struct Scene *scene,
64  struct Object **objects_edit,
65  uint objects_len,
66  float r_cent[2],
67  char mode);
68 
70  struct Scene *scene,
71  struct ViewLayer *view_layer,
72  float r_center[2],
73  char mode,
74  bool *r_has_select);
75 bool ED_uvedit_center_from_pivot(struct SpaceImage *sima,
76  struct Scene *scene,
77  struct ViewLayer *view_layer,
78  float r_center[2],
79  char mode);
80 
81 bool ED_object_get_active_image(struct Object *ob,
82  int mat_nr,
83  struct Image **r_ima,
84  struct ImageUser **r_iuser,
85  struct bNode **r_node,
86  struct bNodeTree **r_ntree);
87 void ED_object_assign_active_image(struct Main *bmain,
88  struct Object *ob,
89  int mat_nr,
90  struct Image *ima);
91 
92 bool ED_uvedit_test(struct Object *obedit);
93 
94 /* visibility and selection */
95 bool uvedit_face_visible_test_ex(const struct ToolSettings *ts, struct BMFace *efa);
97  struct BMFace *efa,
98  const int cd_loop_uv_offset);
100  struct BMLoop *l,
101  const int cd_loop_uv_offset);
103  struct BMLoop *l,
104  const int cd_loop_uv_offset);
105 
106 bool uvedit_face_visible_test(const struct Scene *scene, struct BMFace *efa);
108  struct BMFace *efa,
109  const int cd_loop_uv_offset);
111  struct BMLoop *l,
112  const int cd_loop_uv_offset);
113 bool uvedit_uv_select_test(const struct Scene *scene,
114  struct BMLoop *l,
115  const int cd_loop_uv_offset);
116 /* uv face */
118  const struct Scene *scene,
119  struct BMEditMesh *em,
120  struct BMFace *efa,
121  const bool select,
122  const bool do_history,
123  const int cd_loop_uv_offset);
124 void uvedit_face_select_set(const struct Scene *scene,
125  struct BMEditMesh *em,
126  struct BMFace *efa,
127  const bool select,
128  const bool do_history,
129  const int cd_loop_uv_offset);
131  struct BMEditMesh *em,
132  struct BMFace *efa,
133  const bool do_history,
134  const int cd_loop_uv_offset);
136  struct BMEditMesh *em,
137  struct BMFace *efa,
138  const int cd_loop_uv_offset);
139 /* uv edge */
141  const struct Scene *scene,
142  struct BMEditMesh *em,
143  struct BMLoop *l,
144  const bool select,
145  const bool do_history,
146  const uint cd_loop_uv_offset);
147 void uvedit_edge_select_set(const struct Scene *scene,
148  struct BMEditMesh *em,
149  struct BMLoop *l,
150  const bool select,
151  const bool do_history,
152  const int cd_loop_uv_offset);
154  struct BMEditMesh *em,
155  struct BMLoop *l,
156  const bool do_history,
157  const int cd_loop_uv_offset);
159  struct BMEditMesh *em,
160  struct BMLoop *l,
161  const int cd_loop_uv_offset);
162 /* uv vert */
164  const struct Scene *scene,
165  struct BMEditMesh *em,
166  struct BMLoop *l,
167  const bool select,
168  const bool do_history,
169  const uint cd_loop_uv_offset);
170 void uvedit_uv_select_set(const struct Scene *scene,
171  struct BMEditMesh *em,
172  struct BMLoop *l,
173  const bool select,
174  const bool do_history,
175  const int cd_loop_uv_offset);
177  struct BMEditMesh *em,
178  struct BMLoop *l,
179  const bool do_history,
180  const int cd_loop_uv_offset);
182  struct BMEditMesh *em,
183  struct BMLoop *l,
184  const int cd_loop_uv_offset);
185 
186 bool ED_uvedit_nearest_uv(const struct Scene *scene,
187  struct Object *obedit,
188  const float co[2],
189  float *dist_sq,
190  float r_uv[2]);
192  struct Object **objects,
193  const uint objects_len,
194  const float co[2],
195  float *dist_sq,
196  float r_uv[2]);
197 
198 struct BMFace **ED_uvedit_selected_faces(struct Scene *scene,
199  struct BMesh *bm,
200  int len_max,
201  int *r_faces_len);
202 struct BMLoop **ED_uvedit_selected_edges(struct Scene *scene,
203  struct BMesh *bm,
204  int len_max,
205  int *r_edges_len);
206 struct BMLoop **ED_uvedit_selected_verts(struct Scene *scene,
207  struct BMesh *bm,
208  int len_max,
209  int *r_verts_len);
210 
211 void ED_uvedit_get_aspect(struct Object *obedit, float *r_aspx, float *r_aspy);
212 
213 void ED_uvedit_active_vert_loop_set(struct BMesh *bm, struct BMLoop *l);
215 
216 void ED_uvedit_active_edge_loop_set(struct BMesh *bm, struct BMLoop *l);
218 
221  struct BMEditMesh *em,
222  const bool select);
223 
224 /* uvedit_unwrap_ops.c */
225 void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit);
227 void ED_uvedit_live_unwrap_end(short cancel);
228 
229 void ED_uvedit_live_unwrap(const struct Scene *scene, struct Object **objects, int objects_len);
230 void ED_uvedit_add_simple_uvs(struct Main *bmain, const struct Scene *scene, struct Object *ob);
231 
232 /* uvedit_draw.c */
233 void ED_image_draw_cursor(struct ARegion *region, const float cursor[2]);
234 
235 /* uvedit_buttons.c */
236 void ED_uvedit_buttons_register(struct ARegionType *art);
237 
238 /* uvedit_islands.c */
247 };
249  Object **objects,
250  const uint objects_len,
251  const struct UVPackIsland_Params *params);
252 
253 #ifdef __cplusplus
254 }
255 #endif
unsigned int uint
Definition: BLI_sys_types.h:83
void ED_uvedit_buttons_register(struct ARegionType *art)
bool ED_uvedit_center_multi(const struct Scene *scene, struct Object **objects_edit, uint objects_len, float r_cent[2], char mode)
void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit)
void ED_operatormacros_uvedit(void)
Definition: uvedit_ops.c:2067
bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **r_ima, struct ImageUser **r_iuser, struct bNode **r_node, struct bNodeTree **r_ntree)
Definition: uvedit_ops.c:125
bool uvedit_edge_select_test_ex(const struct ToolSettings *ts, struct BMLoop *l, const int cd_loop_uv_offset)
struct BMLoop * ED_uvedit_active_edge_loop_get(struct BMesh *bm)
void ED_uvedit_pack_islands_multi(const struct Scene *scene, Object **objects, const uint objects_len, const struct UVPackIsland_Params *params)
void ED_uvedit_select_all(struct BMesh *bm)
Definition: uvedit_ops.c:257
void uvedit_edge_select_enable(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool do_history, const int cd_loop_uv_offset)
bool ED_uvedit_minmax_multi(const struct Scene *scene, struct Object **objects_edit, uint objects_len, float r_min[2], float r_max[2])
void ED_object_assign_active_image(struct Main *bmain, struct Object *ob, int mat_nr, struct Image *ima)
Definition: uvedit_ops.c:176
void uvedit_edge_select_set_with_sticky(const struct SpaceImage *sima, const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool select, const bool do_history, const uint cd_loop_uv_offset)
bool uvedit_face_select_test(const struct Scene *scene, struct BMFace *efa, const int cd_loop_uv_offset)
bool ED_uvedit_center_from_pivot_ex(struct SpaceImage *sima, struct Scene *scene, struct ViewLayer *view_layer, float r_center[2], char mode, bool *r_has_select)
Definition: uvedit_ops.c:334
void ED_keymap_uvedit(struct wmKeyConfig *keyconf)
Definition: uvedit_ops.c:2082
bool ED_uvedit_center_from_pivot(struct SpaceImage *sima, struct Scene *scene, struct ViewLayer *view_layer, float r_center[2], char mode)
Definition: uvedit_ops.c:370
struct BMFace ** ED_uvedit_selected_faces(struct Scene *scene, struct BMesh *bm, int len_max, int *r_faces_len)
bool ED_uvedit_test(struct Object *obedit)
Definition: uvedit_ops.c:80
bool ED_uvedit_nearest_uv(const struct Scene *scene, struct Object *obedit, const float co[2], float *dist_sq, float r_uv[2])
void ED_uvedit_live_unwrap(const struct Scene *scene, struct Object **objects, int objects_len)
void ED_uvedit_get_aspect(struct Object *obedit, float *r_aspx, float *r_aspy)
bool uvedit_uv_select_test(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
void ED_uvedit_active_vert_loop_set(struct BMesh *bm, struct BMLoop *l)
void ED_uvedit_live_unwrap_re_solve(void)
void uvedit_face_select_set(const struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, const bool select, const bool do_history, const int cd_loop_uv_offset)
void uvedit_uv_select_set(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool select, const bool do_history, const int cd_loop_uv_offset)
void ED_uvedit_select_sync_flush(const struct ToolSettings *ts, struct BMEditMesh *em, const bool select)
void ED_operatortypes_uvedit(void)
Definition: uvedit_ops.c:2016
void uvedit_uv_select_disable(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const int cd_loop_uv_offset)
struct BMLoop ** ED_uvedit_selected_verts(struct Scene *scene, struct BMesh *bm, int len_max, int *r_verts_len)
void uvedit_uv_select_enable(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool do_history, const int cd_loop_uv_offset)
void uvedit_face_select_disable(const struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, const int cd_loop_uv_offset)
void uvedit_uv_select_set_with_sticky(const struct SpaceImage *sima, const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool select, const bool do_history, const uint cd_loop_uv_offset)
bool uvedit_edge_select_test(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
bool uvedit_face_visible_test_ex(const struct ToolSettings *ts, struct BMFace *efa)
char ED_uvedit_select_mode_get(const struct Scene *scene)
void ED_uvedit_add_simple_uvs(struct Main *bmain, const struct Scene *scene, struct Object *ob)
struct BMLoop * ED_uvedit_active_vert_loop_get(struct BMesh *bm)
void uvedit_edge_select_set(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool select, const bool do_history, const int cd_loop_uv_offset)
void uvedit_face_select_set_with_sticky(const struct SpaceImage *sima, const struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, const bool select, const bool do_history, const int cd_loop_uv_offset)
struct BMLoop ** ED_uvedit_selected_edges(struct Scene *scene, struct BMesh *bm, int len_max, int *r_edges_len)
void uvedit_edge_select_disable(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const int cd_loop_uv_offset)
void ED_uvedit_active_edge_loop_set(struct BMesh *bm, struct BMLoop *l)
bool ED_uvedit_nearest_uv_multi(const struct Scene *scene, struct Object **objects, const uint objects_len, const float co[2], float *dist_sq, float r_uv[2])
bool uvedit_face_visible_test(const struct Scene *scene, struct BMFace *efa)
bool uvedit_uv_select_test_ex(const struct ToolSettings *ts, struct BMLoop *l, const int cd_loop_uv_offset)
void uvedit_face_select_enable(const struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, const bool do_history, const int cd_loop_uv_offset)
void ED_image_draw_cursor(struct ARegion *region, const float cursor[2])
Definition: uvedit_draw.c:41
bool ED_uvedit_minmax(const struct Scene *scene, struct Object *obedit, float min[2], float max[2])
void ED_uvedit_live_unwrap_end(short cancel)
bool uvedit_face_select_test_ex(const struct ToolSettings *ts, struct BMFace *efa, const int cd_loop_uv_offset)
ATTR_WARN_UNUSED_RESULT BMesh * bm
ATTR_WARN_UNUSED_RESULT const BMLoop * l
Scene scene
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
#define min(a, b)
Definition: sort.c:51
Definition: BKE_main.h:116
float max
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: util_avxb.h:167
static bool do_history(const char *name, ReportList *reports)
Definition: writefile.c:1079