2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2008 Blender Foundation.
19 * All rights reserved.
21 * Contributor(s): Blender Foundation
23 * ***** END GPL LICENSE BLOCK *****
30 #ifndef __ED_UVEDIT_H__
31 #define __ED_UVEDIT_H__
50 void ED_operatortypes_uvedit(void);
51 void ED_keymap_uvedit(struct wmKeyConfig *keyconf);
53 void ED_uvedit_assign_image(struct Main *bmain, struct Scene *scene, struct Object *obedit, struct Image *ima, struct Image *previma);
54 bool ED_uvedit_minmax(struct Scene *scene, struct Image *ima, struct Object *obedit, float min[2], float max[2]);
56 int ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **ima, struct ImageUser **iuser, struct bNode **node);
57 void ED_object_assign_active_image(struct Main *bmain, struct Object *ob, int mat_nr, struct Image *ima);
59 int ED_uvedit_test(struct Object *obedit);
61 /* visibility and selection */
62 bool uvedit_face_visible_test(struct Scene *scene, struct Image *ima, struct BMFace *efa, struct MTexPoly *tf);
63 bool uvedit_face_select_test(struct Scene *scene, struct BMFace *efa,
64 const int cd_loop_uv_offset);
65 bool uvedit_edge_select_test(struct Scene *scene, struct BMLoop *l,
66 const int cd_loop_uv_offset);
67 bool uvedit_uv_select_test(struct Scene *scene, struct BMLoop *l,
68 const int cd_loop_uv_offset);
70 bool uvedit_face_select_set(struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, const bool select,
71 const bool do_history, const int cd_loop_uv_offset);
72 bool uvedit_face_select_enable(struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa,
73 const bool do_history, const int cd_loop_uv_offset);
74 bool uvedit_face_select_disable(struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa,
75 const int cd_loop_uv_offset);
77 void uvedit_edge_select_set(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l, const bool select,
78 const bool do_history, const int cd_loop_uv_offset);
79 void uvedit_edge_select_enable(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
80 const bool do_history, const int cd_loop_uv_offset);
81 void uvedit_edge_select_disable(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
82 const int cd_loop_uv_offset);
84 void uvedit_uv_select_set(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l, const bool select,
85 const bool do_history, const int cd_loop_uv_offset);
86 void uvedit_uv_select_enable(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
87 const bool do_history, const int cd_loop_uv_offset);
88 void uvedit_uv_select_disable(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
89 const int cd_loop_uv_offset);
91 int ED_uvedit_nearest_uv(struct Scene *scene, struct Object *obedit, struct Image *ima,
92 const float co[2], float r_uv[2]);
94 /* uvedit_unwrap_ops.c */
95 void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit);
96 void ED_uvedit_live_unwrap_re_solve(void);
97 void ED_uvedit_live_unwrap_end(short cancel);
99 void ED_uvedit_live_unwrap(struct Scene *scene, struct Object *obedit);
101 /* single call up unwrap using scene settings, used for edge tag unwrapping */
102 void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel);
105 void draw_image_cursor(struct SpaceImage *sima, struct ARegion *ar);
106 void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit, struct Object *obact);
108 /* uvedit_buttons.c */
109 void ED_uvedit_buttons_register(struct ARegionType *art);
111 #endif /* __ED_UVEDIT_H__ */