2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-01-01 13:15:35 +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
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2009-01-01 13:15:35 +00:00
|
|
|
*
|
|
|
|
* 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.
|
2009-01-01 13:15:35 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
2018-06-01 18:19:39 +02:00
|
|
|
*
|
2009-01-01 13:15:35 +00:00
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/mesh/mesh_ops.c
|
|
|
|
* \ingroup edmesh
|
|
|
|
*/
|
|
|
|
|
2013-06-25 09:27:31 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2013-10-29 02:42:51 +00:00
|
|
|
#include "DNA_modifier_types.h"
|
2013-06-25 09:27:31 +00:00
|
|
|
|
2009-01-01 13:15:35 +00:00
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
2009-10-13 19:02:30 +00:00
|
|
|
#include "ED_object.h"
|
2011-02-14 17:55:27 +00:00
|
|
|
#include "ED_mesh.h"
|
2009-07-08 16:17:47 +00:00
|
|
|
#include "ED_screen.h"
|
2018-08-14 10:28:41 +10:00
|
|
|
#include "ED_select_utils.h"
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2013-04-01 10:18:01 +00:00
|
|
|
#include "mesh_intern.h" /* own include */
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2009-07-08 21:31:28 +00:00
|
|
|
/**************************** registration **********************************/
|
2009-01-01 13:15:35 +00:00
|
|
|
|
|
|
|
void ED_operatortypes_mesh(void)
|
|
|
|
{
|
2009-11-29 22:16:29 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_all);
|
2012-02-19 20:27:30 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_interior_faces);
|
2009-01-13 02:09:58 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_more);
|
|
|
|
WM_operatortype_append(MESH_OT_select_less);
|
|
|
|
WM_operatortype_append(MESH_OT_select_non_manifold);
|
2009-02-01 12:40:27 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_linked);
|
|
|
|
WM_operatortype_append(MESH_OT_select_linked_pick);
|
|
|
|
WM_operatortype_append(MESH_OT_select_random);
|
2013-03-16 16:11:50 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_ungrouped);
|
2009-02-01 12:40:27 +00:00
|
|
|
WM_operatortype_append(MESH_OT_hide);
|
|
|
|
WM_operatortype_append(MESH_OT_reveal);
|
2012-11-01 05:07:15 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_face_by_sides);
|
2013-04-29 16:59:53 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_loose);
|
2009-10-20 16:31:03 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_mirror);
|
2009-04-15 15:40:31 +00:00
|
|
|
WM_operatortype_append(MESH_OT_normals_make_consistent);
|
2009-07-08 21:31:28 +00:00
|
|
|
WM_operatortype_append(MESH_OT_merge);
|
2009-01-16 04:48:33 +00:00
|
|
|
WM_operatortype_append(MESH_OT_subdivide);
|
2013-05-23 06:19:04 +00:00
|
|
|
WM_operatortype_append(MESH_OT_subdivide_edgering);
|
2012-10-16 16:04:12 +00:00
|
|
|
WM_operatortype_append(MESH_OT_unsubdivide);
|
2009-04-12 17:43:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_faces_select_linked_flat);
|
|
|
|
WM_operatortype_append(MESH_OT_edges_select_sharp);
|
2009-04-12 17:28:16 +00:00
|
|
|
WM_operatortype_append(MESH_OT_primitive_plane_add);
|
|
|
|
WM_operatortype_append(MESH_OT_primitive_cube_add);
|
|
|
|
WM_operatortype_append(MESH_OT_primitive_circle_add);
|
2010-09-01 21:11:33 +00:00
|
|
|
WM_operatortype_append(MESH_OT_primitive_cylinder_add);
|
2009-04-12 17:28:16 +00:00
|
|
|
WM_operatortype_append(MESH_OT_primitive_cone_add);
|
|
|
|
WM_operatortype_append(MESH_OT_primitive_grid_add);
|
|
|
|
WM_operatortype_append(MESH_OT_primitive_monkey_add);
|
|
|
|
WM_operatortype_append(MESH_OT_primitive_uv_sphere_add);
|
|
|
|
WM_operatortype_append(MESH_OT_primitive_ico_sphere_add);
|
2018-05-10 20:16:22 +02:00
|
|
|
|
2018-07-14 23:49:00 +02:00
|
|
|
WM_operatortype_append(MESH_OT_primitive_cube_add_gizmo);
|
2018-05-10 20:16:22 +02:00
|
|
|
|
2009-07-08 21:31:28 +00:00
|
|
|
WM_operatortype_append(MESH_OT_duplicate);
|
2009-04-15 15:40:31 +00:00
|
|
|
WM_operatortype_append(MESH_OT_remove_doubles);
|
2009-02-16 20:04:01 +00:00
|
|
|
WM_operatortype_append(MESH_OT_spin);
|
2009-02-18 03:01:45 +00:00
|
|
|
WM_operatortype_append(MESH_OT_screw);
|
2010-03-09 04:32:40 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(MESH_OT_extrude_region);
|
2018-05-07 21:30:55 +02:00
|
|
|
WM_operatortype_append(MESH_OT_extrude_context);
|
2010-03-09 04:32:40 +00:00
|
|
|
WM_operatortype_append(MESH_OT_extrude_faces_indiv);
|
|
|
|
WM_operatortype_append(MESH_OT_extrude_edges_indiv);
|
|
|
|
WM_operatortype_append(MESH_OT_extrude_verts_indiv);
|
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(MESH_OT_split);
|
2009-02-07 23:20:36 +00:00
|
|
|
WM_operatortype_append(MESH_OT_extrude_repeat);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(MESH_OT_edge_rotate);
|
2013-06-04 01:23:51 +00:00
|
|
|
WM_operatortype_append(MESH_OT_shortest_path_select);
|
2009-02-07 23:20:36 +00:00
|
|
|
WM_operatortype_append(MESH_OT_loop_to_region);
|
|
|
|
WM_operatortype_append(MESH_OT_region_to_loop);
|
2009-11-05 18:29:48 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_axis);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-04-12 17:54:07 +00:00
|
|
|
WM_operatortype_append(MESH_OT_uvs_rotate);
|
2011-12-02 17:17:40 +00:00
|
|
|
WM_operatortype_append(MESH_OT_uvs_reverse);
|
2009-04-12 17:54:07 +00:00
|
|
|
WM_operatortype_append(MESH_OT_colors_rotate);
|
2011-12-02 17:17:40 +00:00
|
|
|
WM_operatortype_append(MESH_OT_colors_reverse);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-02-01 12:40:27 +00:00
|
|
|
WM_operatortype_append(MESH_OT_fill);
|
2013-05-15 20:34:40 +00:00
|
|
|
WM_operatortype_append(MESH_OT_fill_grid);
|
2013-07-25 18:43:05 +00:00
|
|
|
WM_operatortype_append(MESH_OT_fill_holes);
|
2010-01-26 11:14:44 +00:00
|
|
|
WM_operatortype_append(MESH_OT_beautify_fill);
|
2009-04-15 15:40:31 +00:00
|
|
|
WM_operatortype_append(MESH_OT_quads_convert_to_tris);
|
|
|
|
WM_operatortype_append(MESH_OT_tris_convert_to_quads);
|
2016-07-08 23:35:27 +10:00
|
|
|
WM_operatortype_append(MESH_OT_decimate);
|
2013-05-08 13:48:57 +00:00
|
|
|
WM_operatortype_append(MESH_OT_dissolve_verts);
|
|
|
|
WM_operatortype_append(MESH_OT_dissolve_edges);
|
|
|
|
WM_operatortype_append(MESH_OT_dissolve_faces);
|
2013-08-06 05:01:11 +00:00
|
|
|
WM_operatortype_append(MESH_OT_dissolve_mode);
|
2012-02-13 14:37:07 +00:00
|
|
|
WM_operatortype_append(MESH_OT_dissolve_limited);
|
2014-02-17 11:32:35 +11:00
|
|
|
WM_operatortype_append(MESH_OT_dissolve_degenerate);
|
2013-06-14 03:04:36 +00:00
|
|
|
WM_operatortype_append(MESH_OT_delete_edgeloop);
|
2009-02-01 04:22:18 +00:00
|
|
|
WM_operatortype_append(MESH_OT_faces_shade_smooth);
|
2009-07-21 00:36:07 +00:00
|
|
|
WM_operatortype_append(MESH_OT_faces_shade_flat);
|
2012-05-06 17:14:56 +00:00
|
|
|
WM_operatortype_append(MESH_OT_sort_elements);
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2011-10-06 02:04:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_mark_freestyle_face);
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2009-02-01 04:22:18 +00:00
|
|
|
|
2009-02-01 12:40:27 +00:00
|
|
|
WM_operatortype_append(MESH_OT_delete);
|
2014-01-17 12:08:12 +11:00
|
|
|
WM_operatortype_append(MESH_OT_delete_loose);
|
2012-03-23 10:30:42 +00:00
|
|
|
WM_operatortype_append(MESH_OT_edge_collapse);
|
2009-01-31 02:31:58 +00:00
|
|
|
|
2009-01-30 15:01:14 +00:00
|
|
|
WM_operatortype_append(MESH_OT_separate);
|
2.5
- Edit mesh: Add ctrl+click add vertex or extrude.
I've made it not move the 3d cursor in that case.
Also found out tweak events conflicted with existing
keymap definitions; on tweak failure (= no mousemove)
it now passes on the mouse event as 'mouse down' for
the remaining keymaps to check.
These then actually respond to mouse-up instead of down...
The location in the keymaps where tweaks get generated
remains important. Examples:
1 - 'select' mouse-handler, operator return pass-through
2 - tweak handler checks, and makes tweak event
3 - grabber responds to tweak event
1 - ctrl+mouse tweak handler checks, makes tweak event,
or passes event on
2 - if tweak event, it runs lasso
3 - else when passed on, ctrl+click extrude happens
In the first case, select works on mouse-down, immediate.
In the second case, extrude happens on mouse-release, even
though the keymap defined mouse-press.
This will make designing nice balanced keymaps still not
simple; especially because you can't tell operators to
pass on the key... although we can add the convention that
select-mouse operators always pass on to enable tweaks.
Still a good reason to wait with custom keymaps
when this is fully settled!
2009-01-30 18:18:41 +00:00
|
|
|
WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
|
2009-04-12 17:43:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_loop_select);
|
2009-04-12 17:28:16 +00:00
|
|
|
WM_operatortype_append(MESH_OT_edge_face_add);
|
2013-06-04 01:23:51 +00:00
|
|
|
WM_operatortype_append(MESH_OT_shortest_path_pick);
|
2009-07-08 15:34:41 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_similar);
|
2014-09-15 15:40:50 +10:00
|
|
|
WM_operatortype_append(MESH_OT_select_similar_region);
|
2012-11-13 05:44:49 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_mode);
|
2009-04-12 17:43:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_loop_multi_select);
|
2009-02-04 02:58:21 +00:00
|
|
|
WM_operatortype_append(MESH_OT_mark_seam);
|
|
|
|
WM_operatortype_append(MESH_OT_mark_sharp);
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2011-10-06 02:04:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_mark_freestyle_edge);
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2009-04-12 17:43:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_vertices_smooth);
|
2012-10-24 10:39:11 +00:00
|
|
|
WM_operatortype_append(MESH_OT_vertices_smooth_laplacian);
|
2009-07-08 21:31:28 +00:00
|
|
|
WM_operatortype_append(MESH_OT_flip_normals);
|
2009-02-19 19:03:53 +00:00
|
|
|
WM_operatortype_append(MESH_OT_rip);
|
2014-06-14 01:38:57 +10:00
|
|
|
WM_operatortype_append(MESH_OT_rip_edge);
|
2009-10-16 10:05:58 +00:00
|
|
|
WM_operatortype_append(MESH_OT_blend_from_shape);
|
2009-10-27 15:40:56 +00:00
|
|
|
WM_operatortype_append(MESH_OT_shape_propagate_to_all);
|
2017-10-25 15:42:08 +11:00
|
|
|
|
|
|
|
/* editmesh_polybuild */
|
|
|
|
WM_operatortype_append(MESH_OT_polybuild_face_at_cursor);
|
|
|
|
WM_operatortype_append(MESH_OT_polybuild_split_at_cursor);
|
|
|
|
WM_operatortype_append(MESH_OT_polybuild_dissolve_at_cursor);
|
|
|
|
WM_operatortype_append(MESH_OT_polybuild_hover);
|
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
WM_operatortype_append(MESH_OT_uv_texture_add);
|
|
|
|
WM_operatortype_append(MESH_OT_uv_texture_remove);
|
|
|
|
WM_operatortype_append(MESH_OT_vertex_color_add);
|
|
|
|
WM_operatortype_append(MESH_OT_vertex_color_remove);
|
2015-05-03 15:18:27 +02:00
|
|
|
WM_operatortype_append(MESH_OT_customdata_mask_clear);
|
2015-05-03 15:09:48 +02:00
|
|
|
WM_operatortype_append(MESH_OT_customdata_skin_add);
|
2015-05-03 15:18:27 +02:00
|
|
|
WM_operatortype_append(MESH_OT_customdata_skin_clear);
|
Add Custom Loop Normals.
This is the core code for it, tools (datatransfer and modifier) will come in next commits).
RNA api is already there, though.
See the code for details, but basically, we define, for each 'smooth fan'
(which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal),
a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store
custom normal as two angular factors inside that space. This allows to have custom normals
'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer.
Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals,
and be converted back into storage format at the end.
Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can
be rather heavy with high poly meshes.
Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-02-05 14:24:48 +01:00
|
|
|
WM_operatortype_append(MESH_OT_customdata_custom_splitnormals_add);
|
|
|
|
WM_operatortype_append(MESH_OT_customdata_custom_splitnormals_clear);
|
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
|
|
|
|
2009-09-13 16:15:26 +00:00
|
|
|
WM_operatortype_append(MESH_OT_edgering_select);
|
2009-09-16 09:55:06 +00:00
|
|
|
WM_operatortype_append(MESH_OT_loopcut);
|
2009-12-14 23:35:13 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(MESH_OT_solidify);
|
2009-12-22 19:01:51 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_nth);
|
2010-03-10 11:16:26 +00:00
|
|
|
WM_operatortype_append(MESH_OT_vert_connect);
|
2015-02-06 15:46:38 +11:00
|
|
|
WM_operatortype_append(MESH_OT_vert_connect_path);
|
2015-02-02 09:04:31 +11:00
|
|
|
WM_operatortype_append(MESH_OT_vert_connect_concave);
|
2013-07-28 19:53:46 +00:00
|
|
|
WM_operatortype_append(MESH_OT_vert_connect_nonplanar);
|
2015-06-11 21:46:51 +10:00
|
|
|
WM_operatortype_append(MESH_OT_face_make_planar);
|
2012-04-20 10:52:13 +00:00
|
|
|
WM_operatortype_append(MESH_OT_knife_tool);
|
2013-03-15 13:06:31 +00:00
|
|
|
WM_operatortype_append(MESH_OT_knife_project);
|
2011-03-17 22:59:54 +00:00
|
|
|
|
|
|
|
WM_operatortype_append(MESH_OT_bevel);
|
2011-03-27 02:56:41 +00:00
|
|
|
|
2011-08-15 23:38:51 +00:00
|
|
|
WM_operatortype_append(MESH_OT_bridge_edge_loops);
|
2012-03-19 05:45:15 +00:00
|
|
|
WM_operatortype_append(MESH_OT_inset);
|
2015-06-15 10:58:07 +10:00
|
|
|
WM_operatortype_append(MESH_OT_offset_edge_loops);
|
2014-03-19 15:28:38 +11:00
|
|
|
WM_operatortype_append(MESH_OT_intersect);
|
2015-12-11 17:46:19 +11:00
|
|
|
WM_operatortype_append(MESH_OT_intersect_boolean);
|
2014-07-11 10:32:33 +10:00
|
|
|
WM_operatortype_append(MESH_OT_face_split_by_edges);
|
2013-04-06 02:45:43 +00:00
|
|
|
WM_operatortype_append(MESH_OT_poke);
|
2012-04-29 10:44:00 +00:00
|
|
|
WM_operatortype_append(MESH_OT_wireframe);
|
2012-03-23 03:10:44 +00:00
|
|
|
WM_operatortype_append(MESH_OT_edge_split);
|
2011-09-27 09:09:52 +00:00
|
|
|
|
2012-10-23 23:54:15 +00:00
|
|
|
#ifdef WITH_BULLET
|
2012-04-29 16:09:40 +00:00
|
|
|
WM_operatortype_append(MESH_OT_convex_hull);
|
2012-10-23 23:54:15 +00:00
|
|
|
#endif
|
2012-04-29 16:09:40 +00:00
|
|
|
|
2013-08-23 11:46:08 +00:00
|
|
|
WM_operatortype_append(MESH_OT_bisect);
|
2012-10-15 23:50:09 +00:00
|
|
|
WM_operatortype_append(MESH_OT_symmetrize);
|
2013-06-19 21:35:06 +00:00
|
|
|
WM_operatortype_append(MESH_OT_symmetry_snap);
|
2018-05-25 22:24:24 +05:30
|
|
|
|
|
|
|
WM_operatortype_append(MESH_OT_point_normals);
|
|
|
|
WM_operatortype_append(MESH_OT_merge_normals);
|
|
|
|
WM_operatortype_append(MESH_OT_split_normals);
|
|
|
|
WM_operatortype_append(MESH_OT_normals_tools);
|
|
|
|
WM_operatortype_append(MESH_OT_set_normals_from_faces);
|
|
|
|
WM_operatortype_append(MESH_OT_average_normals);
|
|
|
|
WM_operatortype_append(MESH_OT_smoothen_normals);
|
|
|
|
WM_operatortype_append(MESH_OT_mod_weighted_strength);
|
2009-10-12 12:54:08 +00:00
|
|
|
}
|
2009-09-13 16:15:26 +00:00
|
|
|
|
2011-02-23 05:17:29 +00:00
|
|
|
#if 0 /* UNUSED, remove? */
|
2011-02-14 17:55:27 +00:00
|
|
|
static int ED_operator_editmesh_face_select(bContext *C)
|
2009-11-17 20:40:39 +00:00
|
|
|
{
|
2012-03-26 02:56:48 +00:00
|
|
|
Object *obedit = CTX_data_edit_object(C);
|
|
|
|
if (obedit && obedit->type == OB_MESH) {
|
2013-04-16 05:59:48 +00:00
|
|
|
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
2009-11-17 20:40:39 +00:00
|
|
|
if (em && em->selectmode & SCE_SELECT_FACE) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2011-02-23 05:17:29 +00:00
|
|
|
#endif
|
2009-11-17 20:40:39 +00:00
|
|
|
|
2009-10-12 12:54:08 +00:00
|
|
|
void ED_operatormacros_mesh(void)
|
|
|
|
{
|
|
|
|
wmOperatorType *ot;
|
|
|
|
wmOperatorTypeMacro *otmacro;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", "Cut mesh loop and slide it",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2009-11-17 22:19:48 +00:00
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_loopcut");
|
2018-08-22 14:19:55 +10:00
|
|
|
WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
|
2011-05-04 20:42:34 +00:00
|
|
|
|
2015-06-15 10:58:07 +10:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_offset_edge_loops_slide", "Offset Edge Slide", "Offset edge loop slide",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_offset_edge_loops");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
|
|
|
|
RNA_boolean_set(otmacro->ptr, "single_side", true);
|
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", "Duplicate mesh and move",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2009-11-17 20:40:39 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", "Rip polygons and move the result",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-10-14 04:42:11 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip");
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2009-11-17 20:40:39 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2009-11-17 20:40:39 +00:00
|
|
|
|
2014-06-14 16:15:38 +10:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_rip_edge_move", "Extend Vertices", "Extend vertices and move the result",
|
2014-06-14 01:38:57 +10:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_rip_edge");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move",
|
|
|
|
"Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2009-11-17 20:40:39 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2018-05-07 21:30:55 +02:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_context_move", "Extrude Region and Move",
|
|
|
|
"Extrude context and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_context");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-10-15 18:30:49 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_shrink_fatten", "Extrude Region and Shrink/Fatten",
|
|
|
|
"Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move",
|
|
|
|
"Extrude faces and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
|
2010-02-01 18:30:00 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2010-02-01 18:30:00 +00:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move",
|
|
|
|
"Extrude edges and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2010-02-01 18:30:00 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2010-02-01 18:30:00 +00:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move",
|
|
|
|
"Extrude vertices and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
2012-03-24 02:51:46 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2009-11-17 20:40:39 +00:00
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2017-10-25 15:42:08 +11:00
|
|
|
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro(
|
|
|
|
"MESH_OT_polybuild_face_at_cursor_move", "Face At Cursor Move", "",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_polybuild_face_at_cursor");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro(
|
|
|
|
"MESH_OT_polybuild_split_at_cursor_move", "Split At Cursor Move", "",
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_polybuild_split_at_cursor");
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2009-01-01 13:15:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* note mesh keymap also for other space? */
|
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(wmKeyConfig *keyconf)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2009-09-17 21:36:02 +00:00
|
|
|
wmKeyMap *keymap;
|
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
|
|
|
wmKeyMapItem *kmi;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap = WM_keymap_find(keyconf, "Mesh", 0, 0);
|
|
|
|
keymap->poll = ED_operator_editmesh;
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-08-22 14:19:55 +10:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
{
|
|
|
|
PointerRNA macro_ptr = RNA_pointer_get(kmi->ptr, "TRANSFORM_OT_edge_slide");
|
|
|
|
RNA_boolean_set(¯o_ptr, "release_confirm", false);
|
|
|
|
}
|
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_offset_edge_loops_slide", RKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
|
|
|
{
|
|
|
|
PointerRNA macro_ptr = RNA_pointer_get(kmi->ptr, "TRANSFORM_OT_edge_slide");
|
|
|
|
RNA_boolean_set(¯o_ptr, "release_confirm", false);
|
|
|
|
}
|
|
|
|
|
2012-05-16 14:30:41 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_inset", IKEY, KM_PRESS, 0, 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2013-04-06 02:45:43 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_poke", PKEY, KM_PRESS, KM_ALT, 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2013-01-21 01:52:23 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "vertex_only", false);
|
2013-01-21 01:52:23 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "vertex_only", true);
|
2013-01-21 01:52:23 +00:00
|
|
|
|
2018-07-25 11:02:12 +10:00
|
|
|
/* Selec Vert/Edge/Face. */
|
|
|
|
ED_keymap_editmesh_elem_mode(keyconf, keymap);
|
2018-06-07 20:46:12 +02:00
|
|
|
|
2009-01-31 13:30:56 +00:00
|
|
|
/* standard mouse selection goes via space_view3d */
|
2012-01-14 17:56:44 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", false);
|
2012-03-26 02:56:48 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", true);
|
2009-09-13 16:15:26 +00:00
|
|
|
|
2012-03-26 02:56:48 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", false);
|
2012-03-26 02:56:48 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT | KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "toggle", true);
|
2009-01-31 13:30:56 +00:00
|
|
|
|
2016-03-31 04:30:33 +11:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_shortest_path_pick", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "use_fill", false);
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_shortest_path_pick", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "use_fill", true);
|
2009-09-14 06:06:01 +00:00
|
|
|
|
2012-01-14 21:19:41 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
2018-07-03 15:07:22 +02:00
|
|
|
RNA_enum_set(kmi->ptr, "action", SEL_SELECT);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_all", AKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "action", SEL_DESELECT);
|
2012-01-14 21:19:41 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
|
2012-01-14 06:58:03 +00:00
|
|
|
|
2009-01-13 02:09:58 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
2016-01-08 02:54:15 +11:00
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_next_item", PADPLUSKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_prev_item", PADMINUS, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
|
|
|
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2012-03-26 02:56:48 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL | KM_SHIFT | KM_ALT), 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-02-01 12:40:27 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
|
2012-01-14 17:56:44 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", false);
|
2012-01-14 17:56:44 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "deselect", true);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2012-03-26 02:56:48 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL | KM_SHIFT | KM_ALT), 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2009-02-04 02:58:21 +00:00
|
|
|
|
2018-07-04 17:10:41 +02:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
|
|
|
|
2014-09-27 18:30:48 +10:00
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
|
2018-05-29 17:25:19 +02:00
|
|
|
|
2.5
Editmesh: add primitive basics back. Had to clean up a load of
crap there... but it's sorta in control, so I think Shul can
pick it up again.
Test: ctrl+0 adds plane, or ctrl+9 adds grid.
Notes for Shul:
- i've added a transform function, which gets correctly passed
on to the add_prim function, should work for all object
transforms. Only the code inside add_prim might be needed
to check (it uses 4x4 mat now, not a 3x3)
- The old code with buttons has been ifdeffed out, check for
user input and make it rna properties, which get read
in the exec(), and handed over to the add_prim. Set them
default now to the values from old buttons.
- Operator naming is preferred lower case, I gave this
a new name.
- check a bit on formatting code, but don't use the old code
as example! Look also at ED_keymap_mesh() for example.
2009-01-14 19:26:11 +00:00
|
|
|
/* hide */
|
2012-01-14 17:56:44 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "unselected", false);
|
2012-01-14 17:56:44 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "unselected", true);
|
2009-02-01 12:40:27 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
|
2009-11-16 13:59:27 +00:00
|
|
|
|
2.5
Editmesh: add primitive basics back. Had to clean up a load of
crap there... but it's sorta in control, so I think Shul can
pick it up again.
Test: ctrl+0 adds plane, or ctrl+9 adds grid.
Notes for Shul:
- i've added a transform function, which gets correctly passed
on to the add_prim function, should work for all object
transforms. Only the code inside add_prim might be needed
to check (it uses 4x4 mat now, not a 3x3)
- The old code with buttons has been ifdeffed out, check for
user input and make it rna properties, which get read
in the exec(), and handed over to the add_prim. Set them
default now to the values from old buttons.
- Operator naming is preferred lower case, I gave this
a new name.
- check a bit on formatting code, but don't use the old code
as example! Look also at ED_keymap_mesh() for example.
2009-01-14 19:26:11 +00:00
|
|
|
/* tools */
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2012-01-14 17:56:44 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "inside", false);
|
2012-03-26 02:56:48 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "inside", true);
|
2018-06-29 12:46:16 +02:00
|
|
|
#else
|
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "inside", false);
|
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
|
|
|
|
RNA_boolean_set(kmi->ptr, "inside", true);
|
|
|
|
#endif
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-10-13 01:58:09 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); /* python operator */
|
2010-02-12 22:13:47 +00:00
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_extrude", EKEY, KM_PRESS, KM_ALT, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-11-07 23:02:08 +00:00
|
|
|
WM_keymap_add_item(keymap, "TRANSFORM_OT_edge_crease", EKEY, KM_PRESS, KM_SHIFT, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2009-02-16 20:04:01 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-03-23 16:17:48 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_ALT, 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2012-03-26 02:56:48 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2012-01-20 02:24:01 +00:00
|
|
|
|
2012-04-23 04:24:11 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
|
2013-10-29 02:42:51 +00:00
|
|
|
RNA_enum_set(kmi->ptr, "quad_method", MOD_TRIANGULATE_QUAD_BEAUTY);
|
|
|
|
RNA_enum_set(kmi->ptr, "ngon_method", MOD_TRIANGULATE_NGON_BEAUTY);
|
2012-03-04 02:18:17 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
2013-10-29 02:42:51 +00:00
|
|
|
RNA_enum_set(kmi->ptr, "quad_method", MOD_TRIANGULATE_QUAD_FIXED);
|
2014-02-21 15:03:34 +11:00
|
|
|
RNA_enum_set(kmi->ptr, "ngon_method", MOD_TRIANGULATE_NGON_EARCLIP);
|
2012-03-04 02:18:17 +00:00
|
|
|
|
2009-04-15 15:40:31 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
|
2009-11-02 17:24:06 +00:00
|
|
|
|
2018-05-11 20:02:12 +02:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_rip_move", VKEY, KM_PRESS, 0, 0);
|
|
|
|
{
|
|
|
|
PointerRNA macro_ptr = RNA_pointer_get(kmi->ptr, "MESH_OT_rip");
|
|
|
|
RNA_boolean_set(¯o_ptr, "use_fill", false);
|
|
|
|
}
|
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_rip_move", VKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
{
|
|
|
|
PointerRNA macro_ptr = RNA_pointer_get(kmi->ptr, "MESH_OT_rip");
|
|
|
|
RNA_boolean_set(¯o_ptr, "use_fill", true);
|
|
|
|
}
|
2012-10-14 04:42:11 +00:00
|
|
|
|
2014-06-14 01:38:57 +10:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_rip_edge_move", DKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
|
RNA
* Enums can now be dynamically created in the _itemf callback,
using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
for operators. This doesn't fit design well at all, needed to do
some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
_itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
(unselected, deselect), to make them consistent with other ops.
2009-07-10 19:56:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
|
2009-02-19 19:03:53 +00:00
|
|
|
|
2010-04-19 01:22:56 +00:00
|
|
|
WM_keymap_add_item(keymap, "TRANSFORM_OT_shrink_fatten", SKEY, KM_PRESS, KM_ALT, 0);
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
|
2009-01-31 09:23:17 +00:00
|
|
|
/* add/remove */
|
2009-04-12 17:28:16 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0);
|
2010-01-26 14:39:01 +00:00
|
|
|
// WM_keymap_add_item(keymap, "MESH_OT_skin", FKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); /* python, removed */
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-11-17 15:29:55 +00:00
|
|
|
WM_keymap_add_menu(keymap, "INFO_MT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2009-09-23 11:26:16 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, 0, 0);
|
2009-11-02 17:24:06 +00:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_split", YKEY, KM_PRESS, 0, 0);
|
2015-02-06 15:46:38 +11:00
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_vert_connect_path", JKEY, KM_PRESS, 0, 0);
|
2009-11-23 16:24:28 +00:00
|
|
|
|
2018-05-25 22:24:24 +05:30
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_point_normals", LKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
|
2012-04-07 03:15:20 +00:00
|
|
|
/* Vertex Slide */
|
2013-01-15 03:48:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "TRANSFORM_OT_vert_slide", VKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-11-23 16:24:28 +00:00
|
|
|
/* use KM_CLICK because same key is used for tweaks */
|
2015-04-07 14:08:30 +02:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "rotate_source", true);
|
2015-04-20 21:10:52 +10:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT | KM_CTRL, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "rotate_source", false);
|
2010-10-13 07:43:39 +00:00
|
|
|
|
2012-03-23 10:30:42 +00:00
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", XKEY, KM_PRESS, 0, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", DELKEY, KM_PRESS, 0, 0);
|
2013-08-06 05:01:11 +00:00
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_dissolve_mode", XKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_item(keymap, "MESH_OT_dissolve_mode", DELKEY, KM_PRESS, KM_CTRL, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-04-20 10:52:13 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, 0, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "use_occlude_geometry", true);
|
|
|
|
RNA_boolean_set(kmi->ptr, "only_selected", false);
|
2012-04-20 10:52:13 +00:00
|
|
|
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2012-04-20 10:52:13 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, KM_SHIFT, 0);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(kmi->ptr, "use_occlude_geometry", false);
|
|
|
|
RNA_boolean_set(kmi->ptr, "only_selected", true);
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2010-01-11 05:55:34 +00:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
|
2009-07-08 21:31:28 +00:00
|
|
|
|
|
|
|
/* menus */
|
2009-11-17 15:29:55 +00:00
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_specials", WKEY, KM_PRESS, 0, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_faces", FKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_edges", EKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_vertices", VKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_uv_map", UKEY, KM_PRESS, 0, 0);
|
2018-07-04 17:10:41 +02:00
|
|
|
|
2009-11-22 06:20:56 +00:00
|
|
|
WM_keymap_add_menu(keymap, "VIEW3D_MT_vertex_group", GKEY, KM_PRESS, KM_CTRL, 0);
|
2018-07-04 17:10:41 +02:00
|
|
|
WM_keymap_add_item(keymap, "OBJECT_OT_vertex_group_remove_from", GKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2018-06-29 12:46:16 +02:00
|
|
|
#ifdef USE_WM_KEYMAP_27X
|
2011-04-23 11:20:30 +00:00
|
|
|
/* useful stuff from object-mode */
|
2018-06-29 12:46:16 +02:00
|
|
|
for (int i = 0; i <= 5; i++) {
|
2012-03-26 02:56:48 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY + i, KM_PRESS, KM_CTRL, 0);
|
2011-04-23 11:20:30 +00:00
|
|
|
RNA_int_set(kmi->ptr, "level", i);
|
|
|
|
}
|
2018-06-29 12:46:16 +02:00
|
|
|
#endif
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2012-05-30 08:02:49 +00:00
|
|
|
ED_keymap_proportional_cycle(keyconf, keymap);
|
2013-03-24 12:13:13 +00:00
|
|
|
ED_keymap_proportional_editmode(keyconf, keymap, true);
|
2012-05-30 08:02:49 +00:00
|
|
|
|
2011-05-09 21:38:55 +00:00
|
|
|
knifetool_modal_keymap(keyconf);
|
2018-05-25 22:24:24 +05:30
|
|
|
point_normals_modal_keymap(keyconf);
|
2009-01-01 13:15:35 +00:00
|
|
|
}
|