2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2010-03-21 01:14:04 +00:00
|
|
|
* $Id$
|
2008-01-01 18:29:19 +00:00
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL 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.
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
2008-01-01 18:29:19 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
2011-02-21 07:25:24 +00:00
|
|
|
|
|
|
|
|
/** \file ED_mesh.h
|
|
|
|
|
* \ingroup editors
|
|
|
|
|
*/
|
|
|
|
|
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
#ifndef ED_MESH_H
|
|
|
|
|
#define ED_MESH_H
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-01-10 14:19:14 +00:00
|
|
|
struct ID;
|
2008-12-30 13:16:14 +00:00
|
|
|
struct View3D;
|
2008-12-30 16:03:29 +00:00
|
|
|
struct ARegion;
|
|
|
|
|
struct EditMesh;
|
2009-01-01 13:15:35 +00:00
|
|
|
struct EditVert;
|
|
|
|
|
struct EditEdge;
|
|
|
|
|
struct EditFace;
|
2008-12-31 17:11:42 +00:00
|
|
|
struct bContext;
|
2009-01-01 13:15:35 +00:00
|
|
|
struct wmWindowManager;
|
2009-10-22 23:22:05 +00:00
|
|
|
struct wmKeyConfig;
|
|
|
|
|
struct ReportList;
|
2009-01-01 13:15:35 +00:00
|
|
|
struct EditSelection;
|
2009-01-05 15:19:31 +00:00
|
|
|
struct ViewContext;
|
2009-01-07 19:23:22 +00:00
|
|
|
struct bDeformGroup;
|
|
|
|
|
struct MDeformWeight;
|
|
|
|
|
struct MDeformVert;
|
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 Scene;
|
2009-05-23 03:24:15 +00:00
|
|
|
struct Mesh;
|
2011-02-09 01:27:46 +00:00
|
|
|
struct MFace;
|
|
|
|
|
struct MEdge;
|
|
|
|
|
struct MVert;
|
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 MCol;
|
|
|
|
|
struct UvVertMap;
|
|
|
|
|
struct UvMapVert;
|
|
|
|
|
struct CustomData;
|
2010-07-14 22:06:10 +00:00
|
|
|
struct BMEditMesh;
|
2009-05-18 08:46:04 +00:00
|
|
|
struct BMEditSelection;
|
|
|
|
|
struct BMesh;
|
|
|
|
|
struct BMVert;
|
2011-02-27 06:19:40 +00:00
|
|
|
struct MLoopCol;
|
2009-05-18 08:46:04 +00:00
|
|
|
struct BMEdge;
|
|
|
|
|
struct BMFace;
|
2009-07-21 08:39:58 +00:00
|
|
|
struct UvVertMap;
|
|
|
|
|
struct UvMapVert;
|
2009-10-22 23:22:05 +00:00
|
|
|
struct Material;
|
|
|
|
|
struct Object;
|
2009-11-03 11:00:10 +00:00
|
|
|
struct rcti;
|
2010-09-04 05:31:25 +00:00
|
|
|
struct wmOperator;
|
2011-04-15 01:19:13 +00:00
|
|
|
struct ToolSeetings;
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
|
// edge and face flag both
|
|
|
|
|
#define EM_FGON 2
|
|
|
|
|
// face flag
|
|
|
|
|
#define EM_FGON_DRAW 1
|
|
|
|
|
|
|
|
|
|
/* editbutflag */
|
|
|
|
|
#define B_CLOCKWISE 1
|
|
|
|
|
#define B_KEEPORIG 2
|
|
|
|
|
#define B_BEAUTY 4
|
|
|
|
|
#define B_SMOOTH 8
|
|
|
|
|
#define B_BEAUTY_SHORT 16
|
|
|
|
|
#define B_AUTOFGON 32
|
|
|
|
|
#define B_KNIFE 0x80
|
|
|
|
|
#define B_PERCENTSUBD 0x40
|
2009-10-22 23:22:05 +00:00
|
|
|
//#define B_MESH_X_MIRROR 0x100 // deprecated, use mesh
|
2008-12-30 13:16:14 +00:00
|
|
|
#define B_JOINTRIA_UV 0x200
|
|
|
|
|
#define B_JOINTRIA_VCOL 0X400
|
|
|
|
|
#define B_JOINTRIA_SHARP 0X800
|
|
|
|
|
#define B_JOINTRIA_MAT 0X1000
|
2009-07-16 06:27:37 +00:00
|
|
|
#define B_FRACTAL 0x2000
|
|
|
|
|
#define B_SPHERE 0x4000
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2010-07-14 22:06:10 +00:00
|
|
|
float *bm_get_cd_float(struct CustomData *cdata, void *data, int type);
|
|
|
|
|
|
2009-03-06 06:06:14 +00:00
|
|
|
/* bmeshutils.c */
|
|
|
|
|
|
2011-02-27 06:19:40 +00:00
|
|
|
/*
|
|
|
|
|
[note: I've decided to use ideasman's code for non-editmode stuff, but since
|
|
|
|
|
it has a big "not for editmode!" disclaimer, I'm going to keep what I have here
|
|
|
|
|
- joeedh]
|
|
|
|
|
|
|
|
|
|
x-mirror editing api. usage:
|
2010-03-11 05:30:01 +00:00
|
|
|
|
|
|
|
|
EDBM_CacheMirrorVerts(em);
|
|
|
|
|
...
|
|
|
|
|
...
|
|
|
|
|
BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
|
|
|
|
|
mirrorv = EDBM_GetMirrorVert(em, v);
|
|
|
|
|
}
|
|
|
|
|
...
|
|
|
|
|
...
|
|
|
|
|
EDBM_EndMirrorCache(em);
|
|
|
|
|
|
|
|
|
|
note: why do we only allow x axis mirror editing?
|
|
|
|
|
*/
|
|
|
|
|
void EDBM_CacheMirrorVerts(struct BMEditMesh *em);
|
|
|
|
|
|
|
|
|
|
/*retrieves mirrored cache vert, or NULL if there isn't one.
|
|
|
|
|
note: calling this without ensuring the mirror cache state
|
|
|
|
|
is bad.*/
|
|
|
|
|
struct BMVert *EDBM_GetMirrorVert(struct BMEditMesh *em, struct BMVert *v);
|
|
|
|
|
void EDBM_EndMirrorCache(struct BMEditMesh *em);
|
|
|
|
|
|
2009-05-28 04:41:02 +00:00
|
|
|
void EDBM_RecalcNormals(struct BMEditMesh *em);
|
2009-07-21 08:39:58 +00:00
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
void EDBM_MakeEditBMesh(struct ToolSettings *ts, struct Scene *scene, struct Object *ob);
|
2009-05-18 08:46:04 +00:00
|
|
|
void EDBM_FreeEditBMesh(struct BMEditMesh *tm);
|
|
|
|
|
void EDBM_LoadEditBMesh(struct Scene *scene, struct Object *ob);
|
2009-07-21 08:39:58 +00:00
|
|
|
|
2010-01-28 00:45:30 +00:00
|
|
|
void EDBM_init_index_arrays(struct BMEditMesh *em, int forvert, int foredge, int forface);
|
|
|
|
|
void EDBM_free_index_arrays(struct BMEditMesh *em);
|
|
|
|
|
struct BMVert *EDBM_get_vert_for_index(struct BMEditMesh *em, int index);
|
|
|
|
|
struct BMEdge *EDBM_get_edge_for_index(struct BMEditMesh *em, int index);
|
|
|
|
|
struct BMFace *EDBM_get_face_for_index(struct BMEditMesh *em, int index);
|
2009-05-18 08:46:04 +00:00
|
|
|
struct BMFace *EDBM_get_actFace(struct BMEditMesh *em, int sloppy);
|
2009-07-21 08:39:58 +00:00
|
|
|
|
2010-01-28 00:45:30 +00:00
|
|
|
int EDBM_CallAndSelectOpf(struct BMEditMesh *em, struct wmOperator *op,
|
2011-02-27 06:19:40 +00:00
|
|
|
const char *selectslot, const char *fmt, ...);
|
2010-01-28 00:45:30 +00:00
|
|
|
|
2009-08-05 02:34:54 +00:00
|
|
|
/*flushes based on the current select mode. if in vertex select mode,
|
|
|
|
|
verts select/deselect edges and faces, if in edge select mode,
|
|
|
|
|
edges select/deselect faces and vertices, and in face select mode faces select/deselect
|
|
|
|
|
edges and vertices.*/
|
2009-05-18 08:46:04 +00:00
|
|
|
void EDBM_selectmode_flush(struct BMEditMesh *em);
|
2009-09-16 17:43:09 +00:00
|
|
|
|
2009-05-18 08:46:04 +00:00
|
|
|
int EDBM_get_actSelection(struct BMEditMesh *em, struct BMEditSelection *ese);
|
2009-09-16 17:43:09 +00:00
|
|
|
|
2009-08-05 02:34:54 +00:00
|
|
|
/*exactly the same as EDBM_selectmode_flush, but you pass in the selectmode
|
|
|
|
|
instead of using the current one*/
|
|
|
|
|
void EDBM_select_flush(struct BMEditMesh *em, int selectmode);
|
2009-09-16 17:43:09 +00:00
|
|
|
void EDBM_deselect_flush(struct BMEditMesh *em);
|
2009-08-05 02:34:54 +00:00
|
|
|
|
|
|
|
|
void EDBM_selectmode_set(struct BMEditMesh *em);
|
|
|
|
|
void EDBM_convertsel(struct BMEditMesh *em, short oldmode, short selectmode);
|
2011-02-27 06:19:40 +00:00
|
|
|
void undo_push_mesh(struct bContext *C, const char *name);
|
2009-07-21 08:39:58 +00:00
|
|
|
|
2009-05-18 08:46:04 +00:00
|
|
|
void EDBM_editselection_center(struct BMEditMesh *em, float *center, struct BMEditSelection *ese);
|
|
|
|
|
void EDBM_editselection_plane(struct BMEditMesh *em, float *plane, struct BMEditSelection *ese);
|
2009-07-16 06:27:37 +00:00
|
|
|
void EDBM_editselection_normal(float *normal, struct BMEditSelection *ese);
|
2009-08-28 10:17:31 +00:00
|
|
|
int EDBM_vertColorCheck(struct BMEditMesh *em);
|
2011-02-27 06:19:40 +00:00
|
|
|
void EDBM_validate_selections(struct BMEditMesh *em);
|
2009-05-18 10:29:37 +00:00
|
|
|
|
2009-09-10 03:59:12 +00:00
|
|
|
void EDBM_pin_mesh(struct BMEditMesh *em, int swap);
|
|
|
|
|
void EDBM_unpin_mesh(struct BMEditMesh *em, int swap);
|
|
|
|
|
|
2009-07-21 11:48:58 +00:00
|
|
|
void EDBM_hide_mesh(struct BMEditMesh *em, int swap);
|
|
|
|
|
void EDBM_reveal_mesh(struct BMEditMesh *em);
|
|
|
|
|
|
2009-05-18 10:29:37 +00:00
|
|
|
int EDBM_check_backbuf(unsigned int index);
|
|
|
|
|
int EDBM_mask_init_backbuf_border(struct ViewContext *vc, short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax);
|
|
|
|
|
void EDBM_free_backbuf(void);
|
|
|
|
|
int EDBM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
|
|
|
|
|
int EDBM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-07-21 08:39:58 +00:00
|
|
|
void EDBM_select_swap(struct BMEditMesh *em); /* exported for UV */
|
|
|
|
|
void EDBM_set_actFace(struct BMEditMesh *em, struct BMFace *efa);
|
|
|
|
|
|
|
|
|
|
int EDBM_texFaceCheck(struct BMEditMesh *em);
|
|
|
|
|
struct MTexPoly *EDBM_get_active_mtexpoly(struct BMEditMesh *em, struct BMFace **act_efa, int sloppy);
|
|
|
|
|
|
|
|
|
|
void EDBM_free_uv_vert_map(struct UvVertMap *vmap);
|
|
|
|
|
struct UvMapVert *EDBM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
|
|
|
|
|
struct UvVertMap *EDBM_make_uv_vert_map(struct BMEditMesh *em, int selected, int do_face_idx_array, float *limit);
|
2011-02-27 06:19:40 +00:00
|
|
|
void EM_add_data_layer(struct BMEditMesh *em, struct CustomData *data, int type, const char *name);
|
|
|
|
|
void EM_free_data_layer(struct BMEditMesh *em, struct CustomData *data, int type);
|
2009-07-21 08:39:58 +00:00
|
|
|
|
|
|
|
|
void EDBM_toggle_select_all(struct BMEditMesh *em);
|
|
|
|
|
void EDBM_set_flag_all(struct BMEditMesh *em, int flag);
|
2011-02-27 06:19:40 +00:00
|
|
|
void EDBM_clear_flag_all(struct BMEditMesh *em, int flag);
|
|
|
|
|
void EDBM_automerge(struct Scene *scene, struct Object *ob, int update);
|
2009-07-21 08:39:58 +00:00
|
|
|
|
2008-12-31 17:11:42 +00:00
|
|
|
/* meshtools.c */
|
|
|
|
|
|
2011-02-27 06:19:40 +00:00
|
|
|
void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object *obedit, struct BMEditMesh *em);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2011-02-27 06:19:40 +00:00
|
|
|
/* editmesh_mods.c */
|
|
|
|
|
extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs;
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-05-18 08:46:04 +00:00
|
|
|
intptr_t mesh_octree_table(struct Object *ob, struct BMEditMesh *em, float *co, char mode);
|
2011-02-27 06:19:40 +00:00
|
|
|
long mesh_mirrtopo_table(struct Object *ob, char mode);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2011-05-08 23:43:18 +00:00
|
|
|
//BMESH_TODO void EM_cache_x_mirror_vert(struct Object *ob, struct BMEditMesh *em);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2011-05-08 23:43:18 +00:00
|
|
|
int mouse_mesh(struct bContext *C, const short mval[2], short extend);
|
2009-12-14 23:35:13 +00:00
|
|
|
|
2011-02-27 06:19:40 +00:00
|
|
|
struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, float *co, int index);
|
2009-02-25 19:29:58 +00:00
|
|
|
int mesh_get_x_mirror_vert(struct Object *ob, int index);
|
2009-05-18 08:46:04 +00:00
|
|
|
int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em);
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2009-07-13 00:40:20 +00:00
|
|
|
int join_mesh_exec(struct bContext *C, struct wmOperator *op);
|
2009-11-28 04:04:01 +00:00
|
|
|
int join_mesh_shapes_exec(struct bContext *C, struct wmOperator *op);
|
2009-07-13 00:40:20 +00:00
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
/* mesh_ops.c */
|
|
|
|
|
void ED_operatortypes_mesh(void);
|
2009-10-22 23:22:05 +00:00
|
|
|
void ED_operatormacros_mesh(void);
|
|
|
|
|
void ED_keymap_mesh(struct wmKeyConfig *keyconf);
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2008-12-30 16:03:29 +00:00
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* editmesh.c */
|
2009-03-30 07:28:37 +00:00
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
void ED_spacetypes_init(void);
|
2009-10-22 23:22:05 +00:00
|
|
|
void ED_keymap_mesh(struct wmKeyConfig *keyconf);
|
2009-02-09 20:58:31 +00:00
|
|
|
|
2010-09-07 05:47:34 +00:00
|
|
|
/* bmesh_mods.c */
|
2009-05-18 10:29:37 +00:00
|
|
|
extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs;
|
2008-12-30 13:16:14 +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
|
|
|
/* editface.c */
|
2010-11-03 01:56:02 +00:00
|
|
|
void paintface_flush_flags(struct Object *ob);
|
2011-02-27 06:19:40 +00:00
|
|
|
struct MTexPoly *EM_get_active_mtexpoly(struct BMEditMesh *em, struct BMFace **act_efa, struct MLoopCol **col, int sloppy);
|
2011-04-21 17:25:58 +00:00
|
|
|
int paintface_mouse_select(struct bContext *C, struct Object *ob, const short mval[2], int extend);
|
2010-11-03 01:56:02 +00:00
|
|
|
int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend);
|
|
|
|
|
void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags);
|
|
|
|
|
void paintface_select_linked(struct bContext *C, struct Object *ob, short mval[2], int mode);
|
|
|
|
|
int paintface_minmax(struct Object *ob, float *min, float *max);
|
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-02-24 16:04:36 +00:00
|
|
|
void paintface_hide(struct Object *ob, const int unselected);
|
|
|
|
|
void paintface_reveal(struct Object *ob);
|
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
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
/* object_vgroup.c */
|
2009-01-07 19:23:22 +00:00
|
|
|
|
|
|
|
|
#define WEIGHT_REPLACE 1
|
|
|
|
|
#define WEIGHT_ADD 2
|
|
|
|
|
#define WEIGHT_SUBTRACT 3
|
|
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
struct bDeformGroup *ED_vgroup_add(struct Object *ob);
|
2010-11-17 09:45:45 +00:00
|
|
|
struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name);
|
2011-01-07 09:50:23 +00:00
|
|
|
void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup);
|
2011-02-07 22:48:23 +00:00
|
|
|
void ED_vgroup_select_by_name(struct Object *ob, const char *name);
|
2009-09-16 17:43:09 +00:00
|
|
|
void ED_vgroup_data_create(struct ID *id);
|
2009-11-01 00:06:53 +00:00
|
|
|
int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
|
2010-02-09 22:00:19 +00:00
|
|
|
int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from);
|
2010-01-25 23:12:02 +00:00
|
|
|
void ED_vgroup_mirror(struct Object *ob, int mirror_weights, int flip_vgroups);
|
2009-01-10 14:19:14 +00:00
|
|
|
|
2011-01-07 09:50:23 +00:00
|
|
|
int ED_vgroup_object_is_edit_mode(struct Object *ob);
|
|
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
void ED_vgroup_vert_add(struct Object *ob, struct bDeformGroup *dg, int vertnum, float weight, int assignmode);
|
|
|
|
|
void ED_vgroup_vert_remove(struct Object *ob, struct bDeformGroup *dg, int vertnum);
|
|
|
|
|
float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vertnum);
|
2009-01-07 19:23:22 +00:00
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
/**
|
|
|
|
|
* findnearestvert
|
|
|
|
|
*
|
|
|
|
|
* dist (in/out): minimal distance to the nearest and at the end, actual distance
|
|
|
|
|
* sel: selection bias
|
|
|
|
|
* if SELECT, selected vertice are given a 5 pixel bias to make them farter than unselect verts
|
|
|
|
|
* if 0, unselected vertice are given the bias
|
|
|
|
|
* strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
|
|
|
|
|
*/
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
struct BMVert *EDBM_findnearestvert(struct ViewContext *vc, int *dist, short sel, short strict);
|
|
|
|
|
struct BMEdge *EDBM_findnearestedge(struct ViewContext *vc, int *dist);
|
|
|
|
|
struct BMFace *EDBM_findnearestface(struct ViewContext *vc, int *dist);
|
|
|
|
|
|
2009-10-22 23:22:05 +00:00
|
|
|
/* mesh_data.c */
|
2010-09-07 05:47:34 +00:00
|
|
|
// void ED_mesh_geometry_add(struct Mesh *mesh, struct ReportList *reports, int verts, int edges, int faces);
|
|
|
|
|
void ED_mesh_faces_add(struct Mesh *mesh, struct ReportList *reports, int count);
|
|
|
|
|
void ED_mesh_edges_add(struct Mesh *mesh, struct ReportList *reports, int count);
|
|
|
|
|
void ED_mesh_vertices_add(struct Mesh *mesh, struct ReportList *reports, int count);
|
2009-10-22 23:22:05 +00:00
|
|
|
|
|
|
|
|
void ED_mesh_transform(struct Mesh *me, float *mat);
|
|
|
|
|
void ED_mesh_calc_normals(struct Mesh *me);
|
2010-09-07 05:47:34 +00:00
|
|
|
void ED_mesh_material_link(struct Mesh *me, struct Material *ma);
|
2009-10-22 23:22:05 +00:00
|
|
|
void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges);
|
|
|
|
|
|
2010-10-16 14:32:17 +00:00
|
|
|
int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name, int active_set);
|
2009-10-22 23:22:05 +00:00
|
|
|
int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
|
2010-09-07 05:47:34 +00:00
|
|
|
int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me, const char *name, int active_set);
|
2009-10-22 23:22:05 +00:00
|
|
|
int ED_mesh_color_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
|
|
|
|
|
|
2011-02-27 06:19:40 +00:00
|
|
|
void EDBM_selectmode_to_scene(struct Scene *scene, struct Object *obedit);
|
|
|
|
|
|
2010-12-23 02:14:03 +00:00
|
|
|
#include "../mesh/editbmesh_bvh.h"
|
|
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
#endif /* ED_MESH_H */
|