diff options
Diffstat (limited to 'source/blender/editors/include/ED_mesh.h')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 77 |
1 files changed, 41 insertions, 36 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 865da8f0e6e..f84281a4f08 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -74,7 +74,7 @@ struct rcti; /* editmesh_utils.c */ -void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const short use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */ +void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const bool use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */ void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to); struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v); void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v); @@ -86,11 +86,15 @@ void EDBM_mesh_clear(struct BMEditMesh *em); void EDBM_selectmode_to_scene(struct bContext *C); void EDBM_mesh_make(struct ToolSettings *ts, struct Scene *scene, struct Object *ob); -void EDBM_mesh_free(struct BMEditMesh *tm); +void EDBM_mesh_free(struct BMEditMesh *em); void EDBM_mesh_load(struct Object *ob); -void EDBM_index_arrays_init(struct BMEditMesh *em, int forvert, int foredge, int forface); +void EDBM_index_arrays_ensure(struct BMEditMesh *em, const char htype); +void EDBM_index_arrays_init(struct BMEditMesh *em, const char htype); void EDBM_index_arrays_free(struct BMEditMesh *em); +#ifndef NDEBUG +bool EDBM_index_arrays_check(struct BMEditMesh *em); +#endif struct BMVert *EDBM_vert_at_index(struct BMEditMesh *em, int index); struct BMEdge *EDBM_edge_at_index(struct BMEditMesh *em, int index); struct BMFace *EDBM_face_at_index(struct BMEditMesh *em, int index); @@ -115,7 +119,7 @@ int EDBM_vert_color_check(struct BMEditMesh *em); void EDBM_mesh_hide(struct BMEditMesh *em, int swap); void EDBM_mesh_reveal(struct BMEditMesh *em); -void EDBM_update_generic(struct bContext *C, struct BMEditMesh *em, const short do_tessface); +void EDBM_update_generic(struct BMEditMesh *em, const bool do_tessface, const bool is_destructive); struct UvElementMap *EDBM_uv_element_map_create(struct BMEditMesh *em, int selected, int doIslands); void EDBM_uv_element_map_free(struct UvElementMap *vmap); @@ -126,37 +130,40 @@ struct MTexPoly *EDBM_mtexpoly_active_get(struct BMEditMesh *em, struct BMFace * void EDBM_uv_vert_map_free(struct UvVertMap *vmap); struct UvMapVert *EDBM_uv_vert_map_at_index(struct UvVertMap *vmap, unsigned int v); -struct UvVertMap *EDBM_uv_vert_map_create(struct BMEditMesh *em, int selected, int do_face_idx_array, const float limit[2]); +struct UvVertMap *EDBM_uv_vert_map_create(struct BMEditMesh *em, bool use_select, const float limit[2]); void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag); void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); /* editmesh_select.c */ -void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, int extend); +void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, bool extend); void EDBM_automerge(struct Scene *scene, struct Object *ob, int update); -int EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); +bool EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); int EDBM_backbuf_check(unsigned int index); void EDBM_backbuf_free(void); -int EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot, +bool EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax); -int EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads); +bool EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads); -struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *r_dist, const short sel, const short strict); +struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *r_dist, const bool sel, const bool strict); struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, float *r_dist); struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, float *r_dist); -int EDBM_select_pick(struct bContext *C, const int mval[2], short extend, short deselect, short toggle); +bool EDBM_select_pick(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); void EDBM_selectmode_set(struct BMEditMesh *em); void EDBM_selectmode_convert(struct BMEditMesh *em, const short selectmode_old, const short selectmode_new); /* user access this */ -int EDBM_selectmode_toggle(struct bContext *C, const short selectmode_new, - const int action, const int use_extend, const int use_expand); +bool EDBM_selectmode_toggle(struct bContext *C, const short selectmode_new, + const int action, const bool use_extend, const bool use_expand); +bool EDBM_selectmode_disable(struct Scene *scene, struct BMEditMesh *em, + const short selectmode_disable, + const short selectmode_fallback); void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select); @@ -168,17 +175,10 @@ void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc); /* renam extern unsigned int bm_vertoffs, bm_solidoffs, bm_wireoffs; - /* mesh_ops.c */ void ED_operatortypes_mesh(void); void ED_operatormacros_mesh(void); void ED_keymap_mesh(struct wmKeyConfig *keyconf); -void ED_keymap_mesh(struct wmKeyConfig *keyconf); - - -/* spacetypes.c */ -void ED_spacetypes_init(void); - /* editmesh_tools.c (could be moved) */ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEditMesh *em); @@ -186,16 +186,17 @@ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEd /* editface.c */ void paintface_flush_flags(struct Object *ob); -int paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], int extend, int deselect, int toggle); -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, int mval[2], int mode); -int paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]); +bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle); +int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, bool select, bool extend); +void paintface_deselect_all_visible(struct Object *ob, int action, bool flush_flags); +void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], int mode); +bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]); void paintface_hide(struct Object *ob, const int unselected); void paintface_reveal(struct Object *ob); -void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags); +void paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags); +void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags); void paintvert_flush_flags(struct Object *ob); /* mirrtopo */ @@ -206,9 +207,9 @@ typedef struct MirrTopoStore_t { int prev_ob_mode; } MirrTopoStore_t; -int ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store); +bool ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store); void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store, - const short skip_em_vert_array_init); + const bool skip_em_vert_array_init); void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store); @@ -223,6 +224,7 @@ void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *de void ED_vgroup_clear(struct Object *ob); void ED_vgroup_select_by_name(struct Object *ob, const char *name); int ED_vgroup_data_create(struct ID *id); +void ED_vgroup_data_clamp_range(struct ID *id, const int total); int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot); int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from); void ED_vgroup_mirror(struct Object *ob, const short mirror_weights, const short flip_vgroups, const short all_vgroups); @@ -252,13 +254,16 @@ void ED_mesh_calc_tessface(struct Mesh *mesh); void ED_mesh_material_link(struct Mesh *me, struct Material *ma); void ED_mesh_update(struct Mesh *mesh, struct bContext *C, int calc_edges, int calc_tessface); -int ED_mesh_uv_texture_add(struct bContext *C, struct Mesh *me, const char *name, int active_set); -int ED_mesh_uv_texture_remove(struct bContext *C, struct Object *ob, struct Mesh *me); +int ED_mesh_uv_texture_add(struct Mesh *me, const char *name, const bool active_set); +bool ED_mesh_uv_texture_remove_index(struct Mesh *me, const int n); +bool ED_mesh_uv_texture_remove_active(struct Mesh *me); +bool ED_mesh_uv_texture_remove_named(struct Mesh *me, const char *name); int ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me); int ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum); -int ED_mesh_color_add(struct bContext *C, struct Scene *scene, struct Object *ob, struct Mesh *me, const char *name, int active_set); -int ED_mesh_color_remove(struct bContext *C, struct Object *ob, struct Mesh *me); -int ED_mesh_color_remove_named(struct bContext *C, struct Object *ob, struct Mesh *me, const char *name); +int ED_mesh_color_add(struct Mesh *me, const char *name, const bool active_set); +bool ED_mesh_color_remove_index(struct Mesh *me, const int n); +bool ED_mesh_color_remove_active(struct Mesh *me); +bool ED_mesh_color_remove_named(struct Mesh *me, const char *name); /* mesh backup */ typedef struct BMBackup { @@ -287,9 +292,9 @@ int mesh_get_x_mirror_vert(struct Object *ob, int index); struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index); int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em); -int ED_mesh_pick_vert(struct bContext *C, struct Mesh *me, const int mval[2], unsigned int *index, int size); -int ED_mesh_pick_face(struct bContext *C, struct Mesh *me, const int mval[2], unsigned int *index, int size); -int ED_mesh_pick_face_vert(struct bContext *C, struct Mesh *me, struct Object *ob, const int mval[2], unsigned int *index, int size); +bool ED_mesh_pick_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size, bool use_zbuf); +bool ED_mesh_pick_face(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size); +bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size); #define ED_MESH_PICK_DEFAULT_VERT_SIZE 50 #define ED_MESH_PICK_DEFAULT_FACE_SIZE 3 |