2011-02-21 07:25:24 +00:00
|
|
|
/*
|
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-07-13 00:40:20 +00:00
|
|
|
struct wmOperator;
|
2009-01-01 13:15:35 +00:00
|
|
|
struct wmWindowManager;
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
struct wmKeyConfig;
|
2009-09-28 14:28:45 +00:00
|
|
|
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-04-01 12:43:07 +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;
|
2009-09-28 14:28:45 +00:00
|
|
|
struct Material;
|
|
|
|
struct Object;
|
2009-11-03 11:00:10 +00:00
|
|
|
struct rcti;
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-07-08 21:31:28 +00:00
|
|
|
#define EM_FGON_DRAW 1 // face flag
|
|
|
|
#define EM_FGON 2 // edge and face flag both
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
/* editbutflag */
|
2009-07-08 21:31:28 +00:00
|
|
|
#define B_CLOCKWISE 1
|
|
|
|
#define B_KEEPORIG 2
|
|
|
|
#define B_BEAUTY 4
|
|
|
|
#define B_SMOOTH 8
|
|
|
|
#define B_BEAUTY_SHORT 0x10
|
|
|
|
#define B_AUTOFGON 0x20
|
|
|
|
#define B_KNIFE 0x80
|
2008-12-30 13:16:14 +00:00
|
|
|
#define B_PERCENTSUBD 0x40
|
2009-10-14 14:28: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-08 21:31:28 +00:00
|
|
|
#define B_FRACTAL 0x2000
|
|
|
|
#define B_SPHERE 0x4000
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2008-12-31 17:11:42 +00:00
|
|
|
/* meshtools.c */
|
|
|
|
|
2011-12-16 07:27:56 +00:00
|
|
|
intptr_t mesh_octree_table(struct Object *ob, struct EditMesh *em, float *co, char mode);
|
|
|
|
int mesh_mirrtopo_table(struct Object *ob, char mode);
|
2010-03-31 07:22:18 +00:00
|
|
|
|
2010-02-17 19:50:42 +00:00
|
|
|
struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditMesh *em, struct EditVert *eve, float *co, int index);
|
2009-02-25 19:29:58 +00:00
|
|
|
int mesh_get_x_mirror_vert(struct Object *ob, int index);
|
|
|
|
int *mesh_get_x_mirror_faces(struct Object *ob, struct EditMesh *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-12 12:54:08 +00:00
|
|
|
void ED_operatormacros_mesh(void);
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
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-09-28 14:28:45 +00:00
|
|
|
void make_editMesh(struct Scene *scene, struct Object *ob);
|
|
|
|
void load_editMesh(struct Scene *scene, struct Object *ob);
|
|
|
|
void remake_editMesh(struct Scene *scene, struct Object *ob);
|
2009-01-01 13:15:35 +00:00
|
|
|
void free_editMesh(struct EditMesh *em);
|
2008-12-31 17:11:42 +00:00
|
|
|
|
2009-01-03 22:15:59 +00:00
|
|
|
void recalc_editnormals(struct EditMesh *em);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2008-12-30 16:03:29 +00:00
|
|
|
void EM_init_index_arrays(struct EditMesh *em, int forVert, int forEdge, int forFace);
|
2008-12-30 13:16:14 +00:00
|
|
|
void EM_free_index_arrays(void);
|
2009-01-01 13:15:35 +00:00
|
|
|
struct EditVert *EM_get_vert_for_index(int index);
|
|
|
|
struct EditEdge *EM_get_edge_for_index(int index);
|
|
|
|
struct EditFace *EM_get_face_for_index(int index);
|
2008-12-30 16:03:29 +00:00
|
|
|
int EM_texFaceCheck(struct EditMesh *em);
|
|
|
|
int EM_vertColorCheck(struct EditMesh *em);
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2010-11-17 09:45:45 +00:00
|
|
|
void undo_push_mesh(struct bContext *C, const char *name);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2011-07-05 18:03:31 +00:00
|
|
|
void paintvert_flush_flags(struct Object *ob);
|
2011-07-12 19:06:06 +00:00
|
|
|
void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
/* editmesh_lib.c */
|
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
struct EditFace *EM_get_actFace(struct EditMesh *em, int sloppy);
|
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
|
|
|
void EM_set_actFace(struct EditMesh *em, struct EditFace *efa);
|
|
|
|
float EM_face_area(struct EditFace *efa);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
void EM_select_edge(struct EditEdge *eed, int sel);
|
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
|
|
|
void EM_select_face(struct EditFace *efa, int sel);
|
2009-01-01 13:15:35 +00:00
|
|
|
void EM_select_face_fgon(struct EditMesh *em, struct EditFace *efa, int val);
|
2009-02-07 01:27:46 +00:00
|
|
|
void EM_select_swap(struct EditMesh *em);
|
|
|
|
void EM_toggle_select_all(struct EditMesh *em);
|
2009-09-22 16:35:07 +00:00
|
|
|
void EM_select_all(struct EditMesh *em);
|
2009-11-29 22:16:29 +00:00
|
|
|
void EM_deselect_all(struct EditMesh *em);
|
2008-12-30 16:03:29 +00:00
|
|
|
void EM_selectmode_flush(struct EditMesh *em);
|
|
|
|
void EM_deselect_flush(struct EditMesh *em);
|
2009-01-01 18:05:12 +00:00
|
|
|
void EM_selectmode_set(struct EditMesh *em);
|
2009-01-10 19:34:23 +00:00
|
|
|
void EM_select_flush(struct EditMesh *em);
|
2009-01-01 18:05:12 +00:00
|
|
|
void EM_convertsel(struct EditMesh *em, short oldmode, short selectmode);
|
2009-02-09 20:58:31 +00:00
|
|
|
void EM_validate_selections(struct EditMesh *em);
|
2010-01-30 16:09:56 +00:00
|
|
|
void EM_selectmode_to_scene(struct Scene *scene, struct Object *obedit);
|
2009-02-14 13:07:09 +00:00
|
|
|
|
2008-12-31 17:11:42 +00:00
|
|
|
/* exported to transform */
|
2009-01-01 13:15:35 +00:00
|
|
|
int EM_get_actSelection(struct EditMesh *em, struct EditSelection *ese);
|
|
|
|
void EM_editselection_normal(float *normal, struct EditSelection *ese);
|
|
|
|
void EM_editselection_plane(float *plane, struct EditSelection *ese);
|
2009-02-14 13:07:09 +00:00
|
|
|
void EM_editselection_center(float *center, struct EditSelection *ese);
|
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
|
|
|
struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_face_idx_array, float *limit);
|
|
|
|
struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
|
|
|
|
void EM_free_uv_vert_map(struct UvVertMap *vmap);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2010-08-23 22:16:45 +00:00
|
|
|
void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type, const char *name);
|
2009-07-01 22:25:49 +00:00
|
|
|
void EM_free_data_layer(struct EditMesh *em, struct CustomData *data, int type);
|
|
|
|
|
2009-12-14 23:35:13 +00:00
|
|
|
void EM_make_hq_normals(struct EditMesh *em);
|
|
|
|
void EM_solidify(struct EditMesh *em, float dist);
|
|
|
|
|
2009-12-22 19:01:51 +00:00
|
|
|
int EM_deselect_nth(struct EditMesh *em, int nth);
|
|
|
|
|
2010-10-13 07:43:39 +00:00
|
|
|
void EM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct Object *obedit, struct EditMesh *em);
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* editmesh_mods.c */
|
|
|
|
extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs;
|
|
|
|
|
2009-10-20 16:31:03 +00:00
|
|
|
void EM_cache_x_mirror_vert(struct Object *ob, struct EditMesh *em);
|
2011-05-12 16:47:36 +00:00
|
|
|
int mouse_mesh(struct bContext *C, const int mval[2], short extend);
|
2008-12-30 13:16:14 +00:00
|
|
|
int EM_check_backbuf(unsigned int index);
|
2011-05-12 16:47:36 +00:00
|
|
|
int EM_mask_init_backbuf_border(struct ViewContext *vc, int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax);
|
2008-12-30 13:16:14 +00:00
|
|
|
void EM_free_backbuf(void);
|
2009-01-01 19:18:03 +00:00
|
|
|
int EM_init_backbuf_border(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
|
|
|
|
int EM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short rads);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-02-09 20:58:31 +00:00
|
|
|
void EM_hide_mesh(struct EditMesh *em, int swap);
|
|
|
|
void EM_reveal_mesh(struct EditMesh *em);
|
|
|
|
|
2009-06-24 14:07:48 +00:00
|
|
|
void EM_select_by_material(struct EditMesh *em, int index);
|
|
|
|
void EM_deselect_by_material(struct EditMesh *em, int index);
|
|
|
|
|
2009-10-13 07:39:08 +00:00
|
|
|
void EM_automerge(struct Scene *scene, struct Object *obedit, int update);
|
|
|
|
|
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);
|
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 MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy);
|
2011-05-12 16:47:36 +00:00
|
|
|
int paintface_mouse_select(struct bContext *C, struct Object *ob, const int 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);
|
2011-05-12 16:47:36 +00:00
|
|
|
void paintface_select_linked(struct bContext *C, struct Object *ob, int mval[2], int mode);
|
2010-11-03 01:56:02 +00:00
|
|
|
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);
|
2011-02-17 22:34:41 +00:00
|
|
|
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +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
|
|
|
|
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +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-11-23 16:12:11 +00:00
|
|
|
void ED_vgroup_clear(struct Object *ob);
|
2011-02-07 22:48:23 +00:00
|
|
|
void ED_vgroup_select_by_name(struct Object *ob, const char *name);
|
2011-06-07 18:04:03 +00:00
|
|
|
int ED_vgroup_data_create(struct ID *id);
|
2009-10-20 10:19:48 +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);
|
2011-11-01 08:11:55 +00:00
|
|
|
void ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups, const short all_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);
|
|
|
|
|
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
2009-09-09 11:52:56 +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-22 08:41:03 +00:00
|
|
|
/*needed by edge slide*/
|
|
|
|
struct EditVert *editedge_getOtherVert(struct EditEdge *eed, struct EditVert *eve);
|
|
|
|
struct EditVert *editedge_getSharedVert(struct EditEdge *eed, struct EditEdge *eed2);
|
|
|
|
int editedge_containsVert(struct EditEdge *eed, struct EditVert *eve);
|
|
|
|
int editface_containsVert(struct EditFace *efa, struct EditVert *eve);
|
|
|
|
int editface_containsEdge(struct EditFace *efa, struct EditEdge *eed);
|
|
|
|
short sharesFace(struct EditMesh *em, struct EditEdge *e1, struct EditEdge *e2);
|
|
|
|
|
2009-09-28 14:28:45 +00:00
|
|
|
/* mesh_data.c */
|
2010-08-26 22:44:05 +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-09-28 14:28:45 +00:00
|
|
|
|
|
|
|
void ED_mesh_transform(struct Mesh *me, float *mat);
|
|
|
|
void ED_mesh_calc_normals(struct Mesh *me);
|
2010-08-26 22:44:05 +00:00
|
|
|
void ED_mesh_material_link(struct Mesh *me, struct Material *ma);
|
2009-10-12 19:34:58 +00:00
|
|
|
void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges);
|
2009-09-28 14:28:45 +00:00
|
|
|
|
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-09-28 14:28:45 +00:00
|
|
|
int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
|
2010-08-23 22:16:45 +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-09-28 14:28:45 +00:00
|
|
|
int ED_mesh_color_remove(struct bContext *C, struct Object *ob, struct Mesh *me);
|
2011-08-03 18:31:48 +00:00
|
|
|
int ED_mesh_color_remove_named(struct bContext *C, struct Object *ob, struct Mesh *me, const char *name);
|
2009-09-28 14:28:45 +00:00
|
|
|
|
2011-12-20 10:05:58 +00:00
|
|
|
|
|
|
|
/* mirrtopo */
|
|
|
|
typedef struct MirrTopoStore_t {
|
|
|
|
intptr_t *index_lookup;
|
|
|
|
int prev_vert_tot;
|
|
|
|
int prev_edge_tot;
|
|
|
|
int prev_ob_mode;
|
|
|
|
} MirrTopoStore_t;
|
|
|
|
|
|
|
|
int ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
|
2011-12-20 23:14:29 +00:00
|
|
|
void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
|
|
|
|
const short skip_em_vert_array_init);
|
2011-12-20 10:05:58 +00:00
|
|
|
void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
|
|
|
|
|
2010-10-05 00:05:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
#endif /* ED_MESH_H */
|
2008-01-01 18:29:19 +00:00
|
|
|
|