2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_UVEDIT_H__
|
|
|
|
|
#define __ED_UVEDIT_H__
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
|
2011-05-02 11:11:57 +00:00
|
|
|
struct ARegionType;
|
2012-02-27 13:47:53 +00:00
|
|
|
struct BMEditMesh;
|
|
|
|
|
struct BMFace;
|
|
|
|
|
struct BMLoop;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct BMesh;
|
2017-04-04 13:09:17 +02:00
|
|
|
struct Depsgraph;
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
struct Image;
|
2011-11-08 13:07:16 +00:00
|
|
|
struct ImageUser;
|
2012-02-27 13:47:53 +00:00
|
|
|
struct Main;
|
2011-05-02 11:11:57 +00:00
|
|
|
struct Object;
|
|
|
|
|
struct Scene;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct SpaceImage;
|
2019-02-04 01:12:05 +01:00
|
|
|
struct ToolSettings;
|
2018-11-25 09:50:34 -02:00
|
|
|
struct View3D;
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer;
|
2011-11-08 13:07:16 +00:00
|
|
|
struct bNode;
|
2009-10-22 23:22:05 +00:00
|
|
|
struct wmKeyConfig;
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
|
|
|
|
|
/* uvedit_ops.c */
|
|
|
|
|
void ED_operatortypes_uvedit(void);
|
2009-10-22 23:22:05 +00:00
|
|
|
void ED_keymap_uvedit(struct wmKeyConfig *keyconf);
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
|
2013-05-11 01:06:01 +00:00
|
|
|
bool ED_uvedit_minmax(struct Scene *scene, struct Image *ima, struct Object *obedit, float min[2], float max[2]);
|
2017-06-16 07:30:27 +10:00
|
|
|
bool ED_uvedit_center(Scene *scene, Image *ima, struct Object *obedit, float cent[2], char mode);
|
2014-10-31 14:37:36 +01:00
|
|
|
void ED_uvedit_select_all(struct BMesh *bm);
|
2.5: Space Image ported back
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
2009-01-15 04:38:18 +00:00
|
|
|
|
2018-05-25 17:28:37 +02:00
|
|
|
bool ED_uvedit_minmax_multi(
|
|
|
|
|
struct Scene *scene, struct Image *ima, struct Object **objects_edit, uint objects_len, float r_min[2], float r_max[2]);
|
|
|
|
|
bool ED_uvedit_center_multi(
|
|
|
|
|
Scene *scene, Image *ima, struct Object **objects_edit, uint objects_len, float r_cent[2], char mode);
|
|
|
|
|
|
2018-03-13 18:06:05 +11:00
|
|
|
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);
|
2011-11-08 13:07:16 +00:00
|
|
|
void ED_object_assign_active_image(struct Main *bmain, struct Object *ob, int mat_nr, struct Image *ima);
|
|
|
|
|
|
2014-01-22 02:48:11 +11:00
|
|
|
bool ED_uvedit_test(struct Object *obedit);
|
2009-01-28 21:43:43 +00:00
|
|
|
|
2010-12-04 13:00:28 +00:00
|
|
|
/* visibility and selection */
|
2019-02-04 01:12:05 +01:00
|
|
|
bool uvedit_face_visible_nolocal_ex(
|
|
|
|
|
const struct ToolSettings *ts, struct BMFace *efa);
|
|
|
|
|
bool uvedit_face_visible_test_ex(
|
|
|
|
|
const struct ToolSettings *ts, struct Object *obedit, struct Image *ima, struct BMFace *efa);
|
|
|
|
|
bool uvedit_face_select_test_ex(
|
|
|
|
|
const struct ToolSettings *ts, struct BMFace *efa,
|
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
|
bool uvedit_edge_select_test_ex(
|
|
|
|
|
const struct ToolSettings *ts, struct BMLoop *l,
|
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
|
bool uvedit_uv_select_test_ex(
|
|
|
|
|
const struct ToolSettings *ts, struct BMLoop *l,
|
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
|
|
2019-01-09 22:56:27 +01:00
|
|
|
bool uvedit_face_visible_nolocal(
|
|
|
|
|
struct Scene *scene, struct BMFace *efa);
|
2018-03-13 18:39:51 +11:00
|
|
|
bool uvedit_face_visible_test(
|
|
|
|
|
struct Scene *scene, struct Object *obedit, struct Image *ima, struct BMFace *efa);
|
2018-03-13 18:06:05 +11:00
|
|
|
bool uvedit_face_select_test(
|
|
|
|
|
struct Scene *scene, struct BMFace *efa,
|
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
|
bool uvedit_edge_select_test(
|
|
|
|
|
struct Scene *scene, struct BMLoop *l,
|
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
|
bool uvedit_uv_select_test(
|
|
|
|
|
struct Scene *scene, struct BMLoop *l,
|
|
|
|
|
const int cd_loop_uv_offset);
|
2013-05-10 06:46:32 +00:00
|
|
|
/* uv face */
|
2018-03-13 18:06:05 +11:00
|
|
|
bool uvedit_face_select_set(
|
|
|
|
|
struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa, const bool select,
|
|
|
|
|
const bool do_history, const int cd_loop_uv_offset);
|
|
|
|
|
bool uvedit_face_select_enable(
|
|
|
|
|
struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa,
|
|
|
|
|
const bool do_history, const int cd_loop_uv_offset);
|
|
|
|
|
bool uvedit_face_select_disable(
|
|
|
|
|
struct Scene *scene, struct BMEditMesh *em, struct BMFace *efa,
|
|
|
|
|
const int cd_loop_uv_offset);
|
2013-05-10 06:46:32 +00:00
|
|
|
/* uv edge */
|
2018-03-13 18:06:05 +11:00
|
|
|
void uvedit_edge_select_set(
|
|
|
|
|
struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l, const bool select,
|
|
|
|
|
const bool do_history, const int cd_loop_uv_offset);
|
|
|
|
|
void uvedit_edge_select_enable(
|
|
|
|
|
struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
|
|
|
|
|
const bool do_history, const int cd_loop_uv_offset);
|
|
|
|
|
void uvedit_edge_select_disable(
|
|
|
|
|
struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
|
|
|
|
|
const int cd_loop_uv_offset);
|
2013-05-10 06:46:32 +00:00
|
|
|
/* uv vert */
|
2018-03-13 18:06:05 +11:00
|
|
|
void uvedit_uv_select_set(
|
|
|
|
|
struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l, const bool select,
|
|
|
|
|
const bool do_history, const int cd_loop_uv_offset);
|
|
|
|
|
void uvedit_uv_select_enable(
|
|
|
|
|
struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
|
|
|
|
|
const bool do_history, const int cd_loop_uv_offset);
|
|
|
|
|
void uvedit_uv_select_disable(
|
|
|
|
|
struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l,
|
|
|
|
|
const int cd_loop_uv_offset);
|
|
|
|
|
|
|
|
|
|
bool ED_uvedit_nearest_uv(
|
2018-09-19 09:54:36 +10:00
|
|
|
struct Scene *scene, struct Object *obedit, struct Image *ima, const float co[2],
|
|
|
|
|
float *dist_sq, float r_uv[2]);
|
2018-09-18 16:20:14 -03:00
|
|
|
bool ED_uvedit_nearest_uv_multi(
|
2018-09-19 09:54:36 +10:00
|
|
|
struct Scene *scene, struct Image *ima,
|
|
|
|
|
struct Object **objects, const uint objects_len, const float co[2],
|
|
|
|
|
float *dist_sq, float r_uv[2]);
|
2009-01-28 21:43:43 +00:00
|
|
|
|
2014-12-11 19:46:35 +01:00
|
|
|
void ED_uvedit_get_aspect(struct Scene *scene, struct Object *ob, struct BMesh *em, float *aspx, float *aspy);
|
|
|
|
|
|
2011-03-10 05:52:16 +00:00
|
|
|
/* uvedit_unwrap_ops.c */
|
2009-01-28 21:43:43 +00:00
|
|
|
void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit);
|
|
|
|
|
void ED_uvedit_live_unwrap_re_solve(void);
|
|
|
|
|
void ED_uvedit_live_unwrap_end(short cancel);
|
|
|
|
|
|
2019-01-24 12:14:24 +01:00
|
|
|
void ED_uvedit_live_unwrap(struct Scene *scene, struct Object **objects, int objects_len);
|
2018-12-21 11:43:28 +01:00
|
|
|
void ED_uvedit_add_simple_uvs(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
2012-04-15 09:20:42 +00:00
|
|
|
|
2014-10-31 14:37:36 +01:00
|
|
|
|
2011-03-10 05:52:16 +00:00
|
|
|
/* uvedit_draw.c */
|
2018-03-13 18:06:05 +11:00
|
|
|
void ED_image_draw_cursor(
|
2018-04-16 16:27:55 +02:00
|
|
|
struct ARegion *ar, const float cursor[2]);
|
2018-02-06 17:28:00 +11:00
|
|
|
void ED_uvedit_draw_main(
|
2018-04-05 18:20:27 +02:00
|
|
|
struct SpaceImage *sima,
|
2018-02-06 17:28:00 +11:00
|
|
|
struct ARegion *ar, struct Scene *scene, struct ViewLayer *view_layer,
|
|
|
|
|
struct Object *obedit, struct Object *obact, struct Depsgraph *depsgraph);
|
2011-02-14 17:55:27 +00:00
|
|
|
|
2011-05-02 11:11:57 +00:00
|
|
|
/* uvedit_buttons.c */
|
|
|
|
|
void ED_uvedit_buttons_register(struct ARegionType *art);
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_UVEDIT_H__ */
|