2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* of the License, or (at your option) any later version. The Blender
|
|
|
|
|
* Foundation also sells licenses for use in proprietary software under
|
|
|
|
|
* the Blender License. See http://www.blender.org/BL/ for information
|
|
|
|
|
* about this.
|
|
|
|
|
*
|
|
|
|
|
* 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,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*/
|
2002-11-25 11:16:17 +00:00
|
|
|
|
2005-08-23 18:13:30 +00:00
|
|
|
struct Mesh;
|
2007-09-10 12:26:36 +00:00
|
|
|
struct EditMesh;
|
2007-09-17 18:22:06 +00:00
|
|
|
|
|
|
|
|
/* id can be from 0 to 3 */
|
2005-04-23 01:36:08 +00:00
|
|
|
#define TF_PIN_MASK(id) (TF_PIN1 << id)
|
|
|
|
|
#define TF_SEL_MASK(id) (TF_SEL1 << id)
|
|
|
|
|
|
2007-09-19 10:54:49 +00:00
|
|
|
|
|
|
|
|
/* this checks weather a face is drarn without the local image check */
|
|
|
|
|
#define SIMA_FACEDRAW_CHECK_NOLOCAL(efa) \
|
2007-09-17 18:22:06 +00:00
|
|
|
((G.sima->flag & SI_SYNC_UVSEL) ? (efa->h==0) : (efa->h==0 && efa->f & SELECT))
|
2007-09-19 10:54:49 +00:00
|
|
|
|
|
|
|
|
/* this check includes the local image check - (does the faces image match the space image?) */
|
|
|
|
|
#define SIMA_FACEDRAW_CHECK(efa, tf) \
|
|
|
|
|
((G.sima->flag & SI_LOCAL_UV) ? ((tf->tpage==G.sima->image) ? SIMA_FACEDRAW_CHECK_NOLOCAL(efa):0) : (SIMA_FACEDRAW_CHECK_NOLOCAL(efa)))
|
|
|
|
|
|
2007-09-17 18:22:06 +00:00
|
|
|
#define SIMA_FACESEL_CHECK(efa, tf) \
|
|
|
|
|
((G.sima->flag & SI_SYNC_UVSEL) ? (efa->f & SELECT) : (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4)))
|
|
|
|
|
#define SIMA_FACESEL_SET(efa, tf) \
|
|
|
|
|
((G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 1)) : (tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)))
|
|
|
|
|
#define SIMA_FACESEL_UNSET(efa, tf) \
|
|
|
|
|
((G.sima->flag & SI_SYNC_UVSEL) ? (EM_select_face(efa, 0)) : (tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)))
|
|
|
|
|
|
|
|
|
|
#define SIMA_UVSEL_CHECK(efa, tf, i) (G.sima->flag & SI_SYNC_UVSEL ? \
|
|
|
|
|
(G.scene->selectmode == SCE_SELECT_FACE ? efa->f & SELECT : ((*(&efa->v1 + i))->f & SELECT) ) : (tf->flag & TF_SEL_MASK(i) ))
|
|
|
|
|
#define SIMA_UVSEL_SET(efa, tf, i) (G.sima->flag & SI_SYNC_UVSEL ? \
|
|
|
|
|
(G.scene->selectmode == SCE_SELECT_FACE ? EM_select_face(efa, 1) : ((*(&efa->v1 + i))->f |= SELECT) ) : (tf->flag |= TF_SEL_MASK(i) ))
|
|
|
|
|
#define SIMA_UVSEL_UNSET(efa, tf, i) (G.sima->flag & SI_SYNC_UVSEL ? \
|
|
|
|
|
(G.scene->selectmode == SCE_SELECT_FACE ? EM_select_face(efa, 0) : ((*(&efa->v1 + i))->f &= ~SELECT) ) : (tf->flag &= ~TF_SEL_MASK(i) ))
|
|
|
|
|
|
2005-08-18 11:31:20 +00:00
|
|
|
struct Object;
|
|
|
|
|
|
|
|
|
|
void object_uvs_changed(struct Object *ob);
|
|
|
|
|
void object_tface_flags_changed(struct Object *ob, int updateButtons);
|
|
|
|
|
|
2004-04-19 22:05:37 +00:00
|
|
|
int is_uv_tface_editing_allowed(void);
|
2004-04-23 21:38:01 +00:00
|
|
|
int is_uv_tface_editing_allowed_silent(void);
|
2005-08-23 18:13:30 +00:00
|
|
|
|
|
|
|
|
void get_connected_limit_tface_uv(float *limit);
|
|
|
|
|
int minmax_tface_uv(float *min, float *max);
|
2007-09-15 10:43:13 +00:00
|
|
|
int cent_tface_uv(float *cent, int mode);
|
2005-08-23 18:13:30 +00:00
|
|
|
|
|
|
|
|
void transform_width_height_tface_uv(int *width, int *height);
|
|
|
|
|
void transform_aspect_ratio_tface_uv(float *aspx, float *aspy);
|
|
|
|
|
|
2007-09-14 16:12:17 +00:00
|
|
|
void mouseco_to_cursor_sima(void);
|
2005-10-20 10:31:02 +00:00
|
|
|
void borderselect_sima(short whichuvs);
|
2002-10-12 11:37:38 +00:00
|
|
|
void mouseco_to_curtile(void);
|
|
|
|
|
void mouse_select_sima(void);
|
2007-09-15 10:43:13 +00:00
|
|
|
void snap_menu_sima(void);
|
|
|
|
|
|
2007-06-10 14:06:34 +00:00
|
|
|
void select_invert_tface_uv(void);
|
2002-10-12 11:37:38 +00:00
|
|
|
void select_swap_tface_uv(void);
|
2004-04-05 13:22:55 +00:00
|
|
|
void mirrormenu_tface_uv(void);
|
2005-04-23 01:36:08 +00:00
|
|
|
void mirror_tface_uv(char mirroraxis);
|
2004-04-01 12:55:12 +00:00
|
|
|
void hide_tface_uv(int swap);
|
|
|
|
|
void reveal_tface_uv(void);
|
|
|
|
|
void stitch_uv_tface(int mode);
|
|
|
|
|
void unlink_selection(void);
|
2005-04-23 01:36:08 +00:00
|
|
|
void select_linked_tface_uv(int mode);
|
2004-04-05 13:22:55 +00:00
|
|
|
void toggle_uv_select(int mode);
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
void pin_tface_uv(int mode);
|
2005-04-23 01:36:08 +00:00
|
|
|
void weld_align_menu_tface_uv(void);
|
|
|
|
|
void weld_align_tface_uv(char tool);
|
2007-09-10 12:26:36 +00:00
|
|
|
void be_square_tface_uv(struct EditMesh *em);
|
2005-10-20 10:31:02 +00:00
|
|
|
void select_pinned_tface_uv(void);
|
2002-10-30 02:07:20 +00:00
|
|
|
|
2006-01-09 23:52:51 +00:00
|
|
|
void sima_sample_color(void);
|
|
|
|
|
|
2005-10-20 10:31:02 +00:00
|
|
|
#define UV_SELECT_ALL 1
|
|
|
|
|
#define UV_SELECT_PINNED 2
|
2006-09-25 22:00:52 +00:00
|
|
|
|
|
|
|
|
void new_image_sima(void);
|
|
|
|
|
void reload_image_sima(void);
|
|
|
|
|
void save_image_sima(void);
|
|
|
|
|
void save_as_image_sima(void);
|
2006-12-20 17:57:56 +00:00
|
|
|
void save_image_sequence_sima(void);
|
2006-09-25 22:00:52 +00:00
|
|
|
void replace_image_sima(short imageselect);
|
|
|
|
|
void open_image_sima(short imageselect);
|
|
|
|
|
void pack_image_sima(void);
|
|
|
|
|
|
2006-12-20 17:57:56 +00:00
|
|
|
/* checks images for forced updates on frame change */
|
|
|
|
|
void BIF_image_update_frame(void);
|
2007-09-17 18:22:06 +00:00
|
|
|
|
|
|
|
|
|