2011-02-23 10:52:22 +00:00
|
|
|
/*
|
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 *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/mesh/mesh_intern.h
|
|
|
|
* \ingroup edmesh
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* Internal for editmesh_xxxx.c functions */
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __MESH_INTERN_H__
|
|
|
|
#define __MESH_INTERN_H__
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-05-18 08:46:04 +00:00
|
|
|
struct BMEdge;
|
2012-03-27 04:46:52 +00:00
|
|
|
struct BMEditMesh;
|
2009-05-18 08:46:04 +00:00
|
|
|
struct BMFace;
|
2012-03-27 04:46:52 +00:00
|
|
|
struct BMHeader;
|
2012-02-11 08:46:56 +00:00
|
|
|
struct BMOperator;
|
2012-03-27 04:46:52 +00:00
|
|
|
struct BMesh;
|
2012-02-11 08:46:56 +00:00
|
|
|
struct EnumPropertyItem;
|
2012-03-27 04:46:52 +00:00
|
|
|
struct ViewContext;
|
|
|
|
struct bContext;
|
|
|
|
struct wmKeyConfig;
|
|
|
|
struct wmKeyMap;
|
|
|
|
struct wmOperator;
|
|
|
|
struct wmOperatorType;
|
2009-12-24 16:10:26 +00:00
|
|
|
|
2012-04-23 03:43:02 +00:00
|
|
|
/* ******************** editmesh_utils.c */
|
2009-05-26 04:17:47 +00:00
|
|
|
|
|
|
|
/*
|
2012-03-03 16:31:46 +00:00
|
|
|
* ok: the EDBM module is for editmode bmesh stuff. in contrast, the
|
|
|
|
* BMEdit module is for code shared with blenkernel that concerns
|
|
|
|
* the BMEditMesh structure.
|
|
|
|
*/
|
2009-05-26 04:17:47 +00:00
|
|
|
|
2010-01-28 00:45:30 +00:00
|
|
|
/*calls a bmesh op, reporting errors to the user, etc*/
|
2012-03-27 04:46:52 +00:00
|
|
|
int EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
|
|
|
|
|
|
|
|
int EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op,
|
2012-03-27 05:03:23 +00:00
|
|
|
const char *selectslot, const char *fmt, ...);
|
2009-05-19 00:33:54 +00:00
|
|
|
|
2012-03-03 16:31:46 +00:00
|
|
|
/* same as above, but doesn't report errors.*/
|
2012-03-27 04:46:52 +00:00
|
|
|
int EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
|
Created a printf-style method of calling operators. I did this to cut down on duplicated
code, and also because calling operators was such a pain. The basic form of the format
is "opname %[code]", where each % matches to an argument.
The codes are fairly simple:
d - int
i - int
f - float
h[v/e/f] - all verts/edges/faces with a certain header flag.
f[v/e/f] - all verts/edges/faces with a certain flag.
For example:
EDBM_CallOpf(em, op, "dissolveverts %hv", BM_SELECT)
will call the dissolve verts operator.
The relevent functions are:
//calls a bmesh operator, doing necassary conversions and error reporting.
int EDBM_CallOpf(EditMesh *em, struct wmOperator *op, char *fmt, ...);
//execute an operator
int BMO_CallOpf(BMesh *bm, char *fmt, ...);
//initializes but doesn't execute an op.
int BMO_InitOpf(BMesh *bm, BMOperator *op, char *fmt, ...);
//vlist version of above.
int BMO_VInitOpf(BMesh *bm, BMOperator *op, char *fmt, va_list vlist);
Note this system is dependant on getting the slot codes from the argument
order. I'd like to make it better, possibly pass in slot names, but that'd
mean actually giving the slots names (which I can do, but wanted to discuss with
Briggs and others what I have now first).
2009-03-02 04:08:24 +00:00
|
|
|
|
2012-03-27 04:46:52 +00:00
|
|
|
/* these next two functions are the split version of EDBM_op_callf, so you can
|
2012-03-03 16:31:46 +00:00
|
|
|
* do stuff with a bmesh operator, after initializing it but before executing
|
|
|
|
* it.
|
|
|
|
*
|
|
|
|
* execute the operator with BM_Exec_Op */
|
2012-03-27 04:46:52 +00:00
|
|
|
int EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
|
2012-03-27 05:03:23 +00:00
|
|
|
struct wmOperator *op, const char *fmt, ...);
|
2009-05-28 04:41:02 +00:00
|
|
|
/*cleans up after a bmesh operator*/
|
2012-03-27 04:46:52 +00:00
|
|
|
int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
|
2012-03-27 05:03:23 +00:00
|
|
|
struct wmOperator *op, const int report);
|
Created a printf-style method of calling operators. I did this to cut down on duplicated
code, and also because calling operators was such a pain. The basic form of the format
is "opname %[code]", where each % matches to an argument.
The codes are fairly simple:
d - int
i - int
f - float
h[v/e/f] - all verts/edges/faces with a certain header flag.
f[v/e/f] - all verts/edges/faces with a certain flag.
For example:
EDBM_CallOpf(em, op, "dissolveverts %hv", BM_SELECT)
will call the dissolve verts operator.
The relevent functions are:
//calls a bmesh operator, doing necassary conversions and error reporting.
int EDBM_CallOpf(EditMesh *em, struct wmOperator *op, char *fmt, ...);
//execute an operator
int BMO_CallOpf(BMesh *bm, char *fmt, ...);
//initializes but doesn't execute an op.
int BMO_InitOpf(BMesh *bm, BMOperator *op, char *fmt, ...);
//vlist version of above.
int BMO_VInitOpf(BMesh *bm, BMOperator *op, char *fmt, va_list vlist);
Note this system is dependant on getting the slot codes from the argument
order. I'd like to make it better, possibly pass in slot names, but that'd
mean actually giving the slots names (which I can do, but wanted to discuss with
Briggs and others what I have now first).
2009-03-02 04:08:24 +00:00
|
|
|
|
2012-02-12 18:43:59 +00:00
|
|
|
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
|
2009-05-18 14:55:34 +00:00
|
|
|
void EDBM_stats_update(struct BMEditMesh *em);
|
2009-03-02 02:21:18 +00:00
|
|
|
|
2011-05-11 02:14:43 +00:00
|
|
|
/* TODO, move to math_geometry.c */
|
|
|
|
float labda_PdistVL2Dfl(const float v1[3], const float v2[3], const float v3[3]);
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* ******************** editface.c */
|
|
|
|
|
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-05-23 03:24:15 +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-07 05:47:34 +00:00
|
|
|
void MESH_OT_primitive_cylinder_add(struct wmOperatorType *ot);
|
2009-05-23 03:24:15 +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-05-23 03:24:15 +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-06-16 13:09:36 +00:00
|
|
|
extern int EM_view3d_poll(struct bContext *C);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2012-04-28 15:42:27 +00:00
|
|
|
struct wmKeyMap *knifetool_modal_keymap(struct wmKeyConfig *keyconf);
|
2011-05-09 21:38:55 +00:00
|
|
|
|
2011-03-27 02:56:41 +00:00
|
|
|
/* ******************* knifetool.c */
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-02-07 15:44:16 +00:00
|
|
|
void MESH_OT_knife_cut(struct wmOperatorType *ot);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2011-03-27 02:56:41 +00:00
|
|
|
/* ******************* bmesh_select.c */
|
2009-05-23 03:24:15 +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);
|
2012-02-19 20:27:30 +00:00
|
|
|
void MESH_OT_select_interior_faces(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);
|
|
|
|
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);
|
2011-06-26 20:23:27 +00:00
|
|
|
void MESH_OT_select_loose_verts(struct wmOperatorType *ot);
|
2009-11-01 00:06:53 +00:00
|
|
|
void MESH_OT_select_mirror(struct wmOperatorType *ot);
|
2009-05-23 03:24:15 +00:00
|
|
|
void MESH_OT_normals_make_consistent(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_faces_select_linked_flat(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_edges_select_sharp(struct wmOperatorType *ot);
|
|
|
|
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-05-23 03:24:15 +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-05-23 03:24:15 +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);
|
2011-03-27 02:56:41 +00:00
|
|
|
void MESH_OT_select_next_loop(struct wmOperatorType *ot);
|
2010-04-05 04:58:17 +00:00
|
|
|
|
2012-02-11 08:46:56 +00:00
|
|
|
extern struct EnumPropertyItem *corner_type_items;
|
|
|
|
|
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-03-29 02:15:13 +00:00
|
|
|
void MESH_OT_remove_doubles(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-05-23 03:24:15 +00:00
|
|
|
void MESH_OT_quads_convert_to_tris(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_tris_convert_to_quads(struct wmOperatorType *ot);
|
2012-03-23 10:30:42 +00:00
|
|
|
void MESH_OT_dissolve(struct wmOperatorType *ot);
|
2012-02-13 14:37:07 +00:00
|
|
|
void MESH_OT_dissolve_limited(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-05-23 03:24:15 +00:00
|
|
|
void MESH_OT_uvs_rotate(struct wmOperatorType *ot);
|
2009-09-12 07:08:57 +00:00
|
|
|
//void MESH_OT_uvs_mirror(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_uvs_reverse(struct wmOperatorType *ot);
|
2009-05-23 03:24:15 +00:00
|
|
|
void MESH_OT_colors_rotate(struct wmOperatorType *ot);
|
2009-09-20 18:18:40 +00:00
|
|
|
//void MESH_OT_colors_mirror(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
void MESH_OT_colors_reverse(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);
|
2012-03-23 10:30:42 +00:00
|
|
|
void MESH_OT_edge_collapse(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_edge_collapse_loop(struct wmOperatorType *ot);
|
2009-02-19 19:03:53 +00:00
|
|
|
void MESH_OT_rip(struct wmOperatorType *ot);
|
2008-12-30 13:16:14 +00:00
|
|
|
|
2009-10-27 15:40:56 +00:00
|
|
|
void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot);
|
2009-11-01 00:06:53 +00:00
|
|
|
void MESH_OT_blend_from_shape(struct wmOperatorType *ot);
|
2012-05-06 17:14:56 +00:00
|
|
|
void MESH_OT_sort_elements(struct wmOperatorType *ot);
|
2009-11-01 00:06:53 +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-07-17 05:09:33 +00:00
|
|
|
/* ************* bmesh_tools.c ***********/
|
|
|
|
void MESH_OT_vert_connect(struct wmOperatorType *ot);
|
2009-07-17 06:05:09 +00:00
|
|
|
void MESH_OT_edge_split(struct wmOperatorType *ot);
|
Brought Extrude all the way back. The contextual menu works,
as does only edges and individual faces extrude (individual vert
extrude already did).
Note that I need to port this, after we all figure out how to handle
operators with variable transform follow-ons.
I also implemented the merge->collapse function, which is currently
accessable under ctrl->v, Bmesh Test Operator. I still need to
implement the other merge modes, and properly hook everything into
the merge menu tool, which I plan on doing soon (tomorrow hopefully).
The cool thing about the collapse tool, is not only does it handle (all)
UV layers, it handles vcols as well. To do this, I had to add a few math
functions to the customdata API, which seem to be working well.
2009-08-11 07:49:35 +00:00
|
|
|
void MESH_OT_extrude_region(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_extrude_verts_indiv(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_extrude_edges_indiv(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_extrude_faces_indiv(struct wmOperatorType *ot);
|
2009-07-17 05:09:33 +00:00
|
|
|
|
2009-09-16 17:43:09 +00:00
|
|
|
void MESH_OT_edgering_select(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_loopcut(struct wmOperatorType *ot);
|
|
|
|
|
2012-04-20 10:52:13 +00:00
|
|
|
void MESH_OT_knife_tool(struct wmOperatorType *ot);
|
2011-03-17 22:59:54 +00:00
|
|
|
void MESH_OT_bevel(struct wmOperatorType *ot);
|
2010-09-25 01:54:58 +00:00
|
|
|
|
2011-08-15 23:38:51 +00:00
|
|
|
void MESH_OT_bridge_edge_loops(struct wmOperatorType *ot);
|
2012-03-19 05:45:15 +00:00
|
|
|
void MESH_OT_inset(struct wmOperatorType *ot);
|
2012-04-29 10:44:00 +00:00
|
|
|
void MESH_OT_wireframe(struct wmOperatorType *ot);
|
2012-04-07 03:15:20 +00:00
|
|
|
void MESH_OT_vert_slide(struct wmOperatorType *ot);
|
2011-08-15 23:38:51 +00:00
|
|
|
|
2012-04-29 16:09:40 +00:00
|
|
|
void MESH_OT_convex_hull(struct wmOperatorType *ot);
|
|
|
|
|
2011-09-27 09:09:52 +00:00
|
|
|
/* ******************* mesh_navmesh.c */
|
2011-10-10 07:21:42 +00:00
|
|
|
void MESH_OT_navmesh_make(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_navmesh_face_copy(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_navmesh_face_add(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_navmesh_reset(struct wmOperatorType *ot);
|
|
|
|
void MESH_OT_navmesh_clear(struct wmOperatorType *ot);
|
2011-09-27 09:09:52 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif // __MESH_INTERN_H__
|
2008-12-30 13:16:14 +00:00
|
|
|
|