2008-12-30 13:16:14 +00:00
|
|
|
/**
|
2010-03-21 01:14:04 +00:00
|
|
|
* $Id$
|
2008-12-30 13:16:14 +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-12-30 13:16:14 +00:00
|
|
|
*
|
|
|
|
* 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 LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Internal for editmesh_xxxx.c functions */
|
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
#ifndef MESH_INTERN_H
|
|
|
|
#define MESH_INTERN_H
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2008-12-30 16:03:29 +00:00
|
|
|
struct bContext;
|
2009-01-01 13:15:35 +00:00
|
|
|
struct wmOperatorType;
|
2009-12-24 16:10:26 +00:00
|
|
|
struct wmOperator;
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* ******************** editface.c */
|
|
|
|
|
|
|
|
int edgetag_context_check(Scene *scene, EditEdge *eed);
|
|
|
|
void edgetag_context_set(Scene *scene, EditEdge *eed, int val);
|
|
|
|
int edgetag_shortest_path(Scene *scene, EditMesh *em, EditEdge *source, EditEdge *target);
|
|
|
|
|
|
|
|
/* ******************* editmesh.c */
|
|
|
|
|
|
|
|
extern void free_editvert(EditMesh *em, EditVert *eve);
|
|
|
|
extern void free_editedge(EditMesh *em, EditEdge *eed);
|
2010-12-04 13:00:28 +00:00
|
|
|
extern void free_editface(EditMesh *em, EditFace *efa);;
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
extern void free_vertlist(EditMesh *em, ListBase *edve);
|
|
|
|
extern void free_edgelist(EditMesh *em, ListBase *lb);
|
|
|
|
extern void free_facelist(EditMesh *em, ListBase *lb);
|
|
|
|
|
|
|
|
extern void remedge(EditMesh *em, EditEdge *eed);
|
|
|
|
|
|
|
|
extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example);
|
|
|
|
extern struct EditEdge *addedgelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditEdge *example);
|
|
|
|
extern struct EditFace *addfacelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges);
|
|
|
|
extern struct EditEdge *findedgelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2);
|
|
|
|
|
2008-12-30 16:03:29 +00:00
|
|
|
void em_setup_viewcontext(struct bContext *C, ViewContext *vc);
|
|
|
|
|
2009-01-30 15:01:14 +00:00
|
|
|
void MESH_OT_separate(struct wmOperatorType *ot);
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* ******************* editmesh_add.c */
|
2009-04-12 17:28:16 +00:00
|
|
|
void MESH_OT_primitive_plane_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_primitive_cube_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_primitive_circle_add(struct wmOperatorType *ot);
|
2010-09-01 21:11:33 +00:00
|
|
|
void MESH_OT_primitive_cylinder_add(struct wmOperatorType *ot);
|
2009-04-12 17:28:16 +00:00
|
|
|
void MESH_OT_primitive_cone_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_primitive_grid_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_primitive_monkey_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_primitive_uv_sphere_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_primitive_ico_sphere_add(struct wmOperatorType *ot);
|
2009-07-08 16:17:47 +00:00
|
|
|
|
2009-04-12 17:28:16 +00:00
|
|
|
void MESH_OT_edge_face_add(struct wmOperatorType *ot);
|
2009-07-08 16:17:47 +00:00
|
|
|
void MESH_OT_dupli_extrude_cursor(struct wmOperatorType *ot);
|
2009-07-08 21:31:28 +00:00
|
|
|
void MESH_OT_duplicate(struct wmOperatorType *ot);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
void MESH_OT_fgon_make(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_fgon_clear(struct wmOperatorType *ot);
|
2009-01-31 03:23:41 +00:00
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* ******************* editmesh_lib.c */
|
2009-01-15 15:01:39 +00:00
|
|
|
void EM_stats_update(EditMesh *em);
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
extern void EM_fgon_flags(EditMesh *em);
|
|
|
|
extern void EM_hide_reset(EditMesh *em);
|
|
|
|
|
|
|
|
extern int faceselectedOR(EditFace *efa, int flag);
|
|
|
|
extern int faceselectedAND(EditFace *efa, int flag);
|
|
|
|
|
|
|
|
void EM_remove_selection(EditMesh *em, void *data, int type);
|
|
|
|
void EM_clear_flag_all(EditMesh *em, int flag);
|
|
|
|
void EM_set_flag_all(EditMesh *em, int flag);
|
2010-02-28 17:47:49 +00:00
|
|
|
void EM_set_flag_all_selectmode(EditMesh *em, int flag);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
void EM_data_interp_from_verts(EditMesh *em, EditVert *v1, EditVert *v2, EditVert *eve, float fac);
|
|
|
|
void EM_data_interp_from_faces(EditMesh *em, EditFace *efa1, EditFace *efa2, EditFace *efan, int i1, int i2, int i3, int i4);
|
|
|
|
|
|
|
|
int EM_nvertices_selected(EditMesh *em);
|
2009-01-15 15:01:39 +00:00
|
|
|
int EM_nedges_selected(EditMesh *em);
|
2008-12-30 13:16:14 +00:00
|
|
|
int EM_nfaces_selected(EditMesh *em);
|
2009-01-15 15:01:39 +00:00
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
float EM_face_perimeter(EditFace *efa);
|
|
|
|
|
|
|
|
void EM_store_selection(EditMesh *em, void *data, int type);
|
|
|
|
|
|
|
|
extern EditFace *exist_face(EditMesh *em, EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4);
|
|
|
|
extern void flipface(EditMesh *em, EditFace *efa); // flips for normal direction
|
|
|
|
extern int compareface(EditFace *vl1, EditFace *vl2);
|
|
|
|
|
|
|
|
/* flag for selection bits, *nor will be filled with normal for extrusion constraint */
|
|
|
|
/* return value defines if such normal was set */
|
|
|
|
extern short extrudeflag_face_indiv(EditMesh *em, short flag, float *nor);
|
|
|
|
extern short extrudeflag_verts_indiv(EditMesh *em, short flag, float *nor);
|
|
|
|
extern short extrudeflag_edges_indiv(EditMesh *em, short flag, float *nor);
|
2009-12-15 00:53:34 +00:00
|
|
|
extern short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float *nor, int all);
|
|
|
|
extern short extrudeflag(Object *obedit, EditMesh *em, short flag, float *nor, int all);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
extern void adduplicateflag(EditMesh *em, int flag);
|
|
|
|
extern void delfaceflag(EditMesh *em, int flag);
|
|
|
|
|
|
|
|
extern void rotateflag(EditMesh *em, short flag, float *cent, float rotmat[][3]);
|
|
|
|
extern void translateflag(EditMesh *em, short flag, float *vec);
|
|
|
|
|
|
|
|
extern int convex(float *v1, float *v2, float *v3, float *v4);
|
|
|
|
|
|
|
|
extern struct EditFace *EM_face_from_faces(EditMesh *em, struct EditFace *efa1,
|
|
|
|
struct EditFace *efa2, int i1, int i2, int i3, int i4);
|
|
|
|
|
2009-06-16 13:09:36 +00:00
|
|
|
extern int EM_view3d_poll(struct bContext *C);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
/* ******************* editmesh_loop.c */
|
|
|
|
|
2009-02-07 15:44:16 +00:00
|
|
|
void MESH_OT_knife_cut(struct wmOperatorType *ot);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
/* ******************* editmesh_mods.c */
|
2009-04-12 17:43:43 +00:00
|
|
|
void MESH_OT_loop_select(struct wmOperatorType *ot);
|
2009-11-29 22:16:29 +00:00
|
|
|
void MESH_OT_select_all(struct wmOperatorType *ot);
|
2009-01-13 02:09:58 +00:00
|
|
|
void MESH_OT_select_more(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_select_less(struct wmOperatorType *ot);
|
2009-07-08 21:31:28 +00:00
|
|
|
void MESH_OT_select_inverse(struct wmOperatorType *ot);
|
2009-01-13 02:09:58 +00:00
|
|
|
void MESH_OT_select_non_manifold(struct wmOperatorType *ot);
|
2009-02-01 12:40:27 +00:00
|
|
|
void MESH_OT_select_linked(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_select_linked_pick(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_hide(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_reveal(struct wmOperatorType *ot);
|
2009-07-08 15:34:41 +00:00
|
|
|
void MESH_OT_select_by_number_vertices(struct wmOperatorType *ot);
|
2009-10-20 16:31:03 +00:00
|
|
|
void MESH_OT_select_mirror(struct wmOperatorType *ot);
|
2009-04-15 15:40:31 +00:00
|
|
|
void MESH_OT_normals_make_consistent(struct wmOperatorType *ot);
|
2009-04-12 17:43:43 +00:00
|
|
|
void MESH_OT_faces_select_linked_flat(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_edges_select_sharp(struct wmOperatorType *ot);
|
2009-04-15 15:40:31 +00:00
|
|
|
void MESH_OT_select_shortest_path(struct wmOperatorType *ot);
|
2009-07-08 15:34:41 +00:00
|
|
|
void MESH_OT_select_similar(struct wmOperatorType *ot);
|
2009-02-01 12:40:27 +00:00
|
|
|
void MESH_OT_select_random(struct wmOperatorType *ot);
|
2009-04-12 17:43:43 +00:00
|
|
|
void MESH_OT_loop_multi_select(struct wmOperatorType *ot);
|
2009-02-04 02:58:21 +00:00
|
|
|
void MESH_OT_mark_seam(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_mark_sharp(struct wmOperatorType *ot);
|
2009-04-12 17:43:43 +00:00
|
|
|
void MESH_OT_vertices_smooth(struct wmOperatorType *ot);
|
2010-11-07 03:56:58 +00:00
|
|
|
void MESH_OT_noise(struct wmOperatorType *ot);
|
2009-07-08 21:31:28 +00:00
|
|
|
void MESH_OT_flip_normals(struct wmOperatorType *ot);
|
2009-12-14 23:35:13 +00:00
|
|
|
void MESH_OT_solidify(struct wmOperatorType *ot);
|
2009-12-22 19:01:51 +00:00
|
|
|
void MESH_OT_select_nth(struct wmOperatorType *ot);
|
2009-12-14 23:35:13 +00:00
|
|
|
|
2009-01-13 02:09:58 +00:00
|
|
|
|
2008-12-30 16:03:29 +00:00
|
|
|
extern EditEdge *findnearestedge(ViewContext *vc, int *dist);
|
2008-12-30 13:16:14 +00:00
|
|
|
void editmesh_select_by_material(EditMesh *em, int index);
|
2010-01-08 14:41:32 +00:00
|
|
|
void EM_recalc_normal_direction(EditMesh *em, int inside, int select); /* makes faces righthand turning */
|
2008-12-30 13:16:14 +00:00
|
|
|
void EM_select_more(EditMesh *em);
|
2009-01-30 15:01:14 +00:00
|
|
|
void selectconnected_mesh_all(EditMesh *em);
|
2009-02-19 19:03:53 +00:00
|
|
|
void faceloop_select(EditMesh *em, EditEdge *startedge, int select);
|
2008-12-30 13:16:14 +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-12-30 16:03:29 +00:00
|
|
|
extern EditVert *findnearestvert(ViewContext *vc, int *dist, short sel, short strict);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* ******************* editmesh_tools.c */
|
|
|
|
|
|
|
|
#define SUBDIV_SELECT_ORIG 0
|
|
|
|
#define SUBDIV_SELECT_INNER 1
|
|
|
|
#define SUBDIV_SELECT_INNER_SEL 2
|
|
|
|
#define SUBDIV_SELECT_LOOPCUT 3
|
|
|
|
|
2010-04-05 04:58:17 +00:00
|
|
|
/* edge subdivide corner cut types */
|
|
|
|
#define SUBDIV_CORNER_PATH 0
|
|
|
|
#define SUBDIV_CORNER_INNERVERT 1
|
|
|
|
#define SUBDIV_CORNER_FAN 2
|
|
|
|
|
|
|
|
extern EnumPropertyItem corner_type_items[];
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
void join_triangles(EditMesh *em);
|
|
|
|
int removedoublesflag(EditMesh *em, short flag, short automerge, float limit); /* return amount */
|
2010-04-05 04:58:17 +00:00
|
|
|
void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fractal, int beautify, int numcuts, int corner_pattern, int seltype);
|
2009-12-24 16:10:26 +00:00
|
|
|
int EdgeSlide(EditMesh *em, struct wmOperator *op, short immediate, float imperc);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-07-08 21:31:28 +00:00
|
|
|
void MESH_OT_merge(struct wmOperatorType *ot);
|
2009-01-16 04:48:33 +00:00
|
|
|
void MESH_OT_subdivide(struct wmOperatorType *ot);
|
2009-04-15 15:40:31 +00:00
|
|
|
void MESH_OT_remove_doubles(struct wmOperatorType *ot);
|
2009-02-01 12:40:27 +00:00
|
|
|
void MESH_OT_extrude(struct wmOperatorType *ot);
|
2009-02-16 20:04:01 +00:00
|
|
|
void MESH_OT_spin(struct wmOperatorType *ot);
|
2009-02-18 03:01:45 +00:00
|
|
|
void MESH_OT_screw(struct wmOperatorType *ot);
|
2009-01-24 22:21:12 +00:00
|
|
|
|
2009-02-01 12:40:27 +00:00
|
|
|
void MESH_OT_fill(struct wmOperatorType *ot);
|
2010-01-26 11:14:44 +00:00
|
|
|
void MESH_OT_beautify_fill(struct wmOperatorType *ot);
|
2009-04-15 15:40:31 +00:00
|
|
|
void MESH_OT_quads_convert_to_tris(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_tris_convert_to_quads(struct wmOperatorType *ot);
|
2009-01-24 22:21:12 +00:00
|
|
|
void MESH_OT_edge_flip(struct wmOperatorType *ot);
|
2009-02-01 04:22:18 +00:00
|
|
|
void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot);
|
2009-07-21 00:36:07 +00:00
|
|
|
void MESH_OT_faces_shade_flat(struct wmOperatorType *ot);
|
2009-03-29 02:15:13 +00:00
|
|
|
void MESH_OT_split(struct wmOperatorType *ot);
|
2009-02-07 23:20:36 +00:00
|
|
|
void MESH_OT_extrude_repeat(struct wmOperatorType *ot);
|
2009-03-29 02:15:13 +00:00
|
|
|
void MESH_OT_edge_rotate(struct wmOperatorType *ot);
|
2009-07-08 15:34:41 +00:00
|
|
|
void MESH_OT_select_vertex_path(struct wmOperatorType *ot);
|
2009-02-07 23:20:36 +00:00
|
|
|
void MESH_OT_loop_to_region(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_region_to_loop(struct wmOperatorType *ot);
|
2009-11-05 18:29:48 +00:00
|
|
|
void MESH_OT_select_axis(struct wmOperatorType *ot);
|
2009-02-07 23:20:36 +00:00
|
|
|
|
2009-04-12 17:54:07 +00:00
|
|
|
void MESH_OT_uvs_rotate(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_uvs_mirror(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_colors_rotate(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_colors_mirror(struct wmOperatorType *ot);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-02-01 12:40:27 +00:00
|
|
|
void MESH_OT_delete(struct wmOperatorType *ot);
|
2009-02-19 19:03:53 +00:00
|
|
|
void MESH_OT_rip(struct wmOperatorType *ot);
|
2009-01-31 02:31:58 +00:00
|
|
|
|
2009-10-27 15:40:56 +00:00
|
|
|
void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot);
|
2009-10-16 10:05:58 +00:00
|
|
|
void MESH_OT_blend_from_shape(struct wmOperatorType *ot);
|
2010-07-06 19:26:38 +00:00
|
|
|
void MESH_OT_sort_faces(struct wmOperatorType *ot);
|
2009-10-16 10:05:58 +00:00
|
|
|
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
|
|
|
/* ******************* mesh_data.c */
|
2009-07-01 22:25:49 +00:00
|
|
|
|
|
|
|
void MESH_OT_uv_texture_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_uv_texture_remove(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_vertex_color_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_vertex_color_remove(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_sticky_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_sticky_remove(struct wmOperatorType *ot);
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
|
|
|
void MESH_OT_drop_named_image(struct wmOperatorType *ot);
|
2009-07-01 22:25:49 +00:00
|
|
|
|
2009-09-13 16:15:26 +00:00
|
|
|
void MESH_OT_edgering_select(struct wmOperatorType *ot);
|
2009-09-16 09:55:06 +00:00
|
|
|
void MESH_OT_loopcut(struct wmOperatorType *ot);
|
2009-09-13 16:15:26 +00:00
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
#endif // MESH_INTERN_H
|
2008-12-30 13:16:14 +00:00
|
|
|
|