2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2009 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup edmesh
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
|
2023-08-10 22:40:27 +02:00
|
|
|
#include "RNA_access.hh"
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2023-08-04 23:11:22 +02:00
|
|
|
#include "WM_api.hh"
|
|
|
|
|
#include "WM_types.hh"
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "ED_mesh.hh"
|
2023-08-04 23:11:22 +02:00
|
|
|
#include "ED_screen.hh"
|
2009-01-01 13:15:35 +00:00
|
|
|
|
2024-01-24 11:30:39 -05:00
|
|
|
#include "mesh_intern.hh" /* 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
|
|
|
|
2023-07-06 10:29:02 +10:00
|
|
|
void ED_operatortypes_mesh()
|
2009-01-01 13:15:35 +00:00
|
|
|
{
|
2024-02-07 14:17:16 +01:00
|
|
|
using namespace blender::ed::mesh;
|
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);
|
2024-10-04 15:06:18 +10:00
|
|
|
WM_operatortype_append(MESH_OT_select_by_pole_count);
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-14 23:49:00 +02:00
|
|
|
WM_operatortype_append(MESH_OT_primitive_cube_add_gizmo);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-02-15 04:34:53 +01:00
|
|
|
WM_operatortype_append(MESH_OT_attribute_set);
|
|
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2023-10-17 09:24:51 +02:00
|
|
|
WM_operatortype_append(MESH_OT_select_by_attribute);
|
2009-02-07 23:20:36 +00:00
|
|
|
WM_operatortype_append(MESH_OT_region_to_loop);
|
2009-11-05 18:29:48 +00:00
|
|
|
WM_operatortype_append(MESH_OT_select_axis);
|
2019-04-17 06:17:24 +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);
|
2019-04-17 06:17:24 +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);
|
2024-02-07 14:17:16 +01:00
|
|
|
WM_operatortype_append(MESH_OT_set_sharpness_by_angle);
|
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);
|
2019-04-17 06:17:24 +02: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);
|
2021-03-16 19:35:53 +01:00
|
|
|
#if defined(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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-08-27 16:19:25 +02:00
|
|
|
WM_operatortype_append(MESH_OT_polybuild_transform_at_cursor);
|
|
|
|
|
WM_operatortype_append(MESH_OT_polybuild_delete_at_cursor);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-07-01 22:25:49 +00:00
|
|
|
WM_operatortype_append(MESH_OT_uv_texture_add);
|
|
|
|
|
WM_operatortype_append(MESH_OT_uv_texture_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);
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-03-17 22:59:54 +00:00
|
|
|
WM_operatortype_append(MESH_OT_bevel);
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-10 15:18:51 +02:00
|
|
|
WM_operatortype_append(MESH_OT_paint_mask_extract);
|
2020-09-03 17:25:30 +02:00
|
|
|
WM_operatortype_append(MESH_OT_face_set_extract);
|
2019-11-21 18:26:16 +01:00
|
|
|
WM_operatortype_append(MESH_OT_paint_mask_slice);
|
2019-09-10 15:18:51 +02:00
|
|
|
|
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);
|
2020-04-07 15:12:18 +10:00
|
|
|
WM_operatortype_append(MESH_OT_smooth_normals);
|
2018-05-25 22:24:24 +05:30
|
|
|
WM_operatortype_append(MESH_OT_mod_weighted_strength);
|
2023-01-27 11:00:36 -08:00
|
|
|
WM_operatortype_append(MESH_OT_flip_quad_tessellation);
|
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
|
|
|
|
2023-07-06 10:29:02 +10:00
|
|
|
void ED_operatormacros_mesh()
|
2009-10-12 12:54:08 +00:00
|
|
|
{
|
|
|
|
|
wmOperatorType *ot;
|
|
|
|
|
wmOperatorTypeMacro *otmacro;
|
2019-04-17 06:17:24 +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");
|
2019-04-17 06:17:24 +02: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);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02: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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02: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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2014-06-14 01:38:57 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2018-05-07 21:30:55 +02:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-15 12:01:43 -03:00
|
|
|
ot = WM_operatortype_append_macro(
|
2020-06-22 09:20:43 -03:00
|
|
|
"MESH_OT_extrude_manifold",
|
|
|
|
|
"Extrude Manifold",
|
2020-04-15 12:01:43 -03:00
|
|
|
"Extrude, dissolves edges whose faces form a flat surface and intersect new edges",
|
|
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "use_dissolve_ortho_edges", true);
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "use_automerge_and_split", true);
|
|
|
|
|
|
2018-05-07 21:30:55 +02:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_context_move",
|
|
|
|
|
"Extrude Region and Move",
|
2019-05-05 21:36:12 +02:00
|
|
|
"Extrude region together along the average normal",
|
2018-05-07 21:30:55 +02:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_context");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-10-15 18:30:49 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-10-15 18:30:49 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_shrink_fatten",
|
|
|
|
|
"Extrude Region and Shrink/Fatten",
|
2019-05-05 21:36:12 +02:00
|
|
|
"Extrude region together along local normals",
|
2018-10-02 11:17:31 +10:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2013-10-15 18:30:49 +00:00
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move",
|
|
|
|
|
"Extrude Individual Faces and Move",
|
2019-05-05 21:36:12 +02:00
|
|
|
"Extrude each individual face separately along local normals",
|
2012-05-05 19:26:53 +00:00
|
|
|
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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02: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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02: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");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2013-03-24 12:13:13 +00:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-09-10 16:14:26 +10:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_polybuild_face_at_cursor_move",
|
|
|
|
|
"Face at Cursor Move",
|
2023-07-05 20:03:41 +02:00
|
|
|
nullptr,
|
2017-10-25 15:42:08 +11:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_polybuild_face_at_cursor");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2017-10-25 15:42:08 +11:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-09-10 16:14:26 +10:00
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_polybuild_split_at_cursor_move",
|
|
|
|
|
"Split at Cursor Move",
|
2023-07-05 20:03:41 +02:00
|
|
|
nullptr,
|
2017-10-25 15:42:08 +11:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_polybuild_split_at_cursor");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
2019-04-30 13:42:18 +10:00
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
2017-10-25 15:42:08 +11:00
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2019-08-27 16:19:25 +02:00
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_polybuild_transform_at_cursor_move",
|
|
|
|
|
"Transform at Cursor Move",
|
2023-07-05 20:03:41 +02:00
|
|
|
nullptr,
|
2019-08-27 16:19:25 +02:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_polybuild_transform_at_cursor");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
|
|
|
|
|
|
|
|
|
ot = WM_operatortype_append_macro("MESH_OT_polybuild_extrude_at_cursor_move",
|
|
|
|
|
"Extrude at Cursor Move",
|
2023-07-05 20:03:41 +02:00
|
|
|
nullptr,
|
2019-08-27 16:19:25 +02:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
|
|
|
|
WM_operatortype_macro_define(ot, "MESH_OT_polybuild_transform_at_cursor");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
|
|
|
|
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
2009-01-01 13:15:35 +00:00
|
|
|
}
|
|
|
|
|
|
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
|
|
|
{
|
2023-09-14 13:32:42 +10:00
|
|
|
wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Mesh", SPACE_EMPTY, RGN_TYPE_WINDOW);
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap->poll = ED_operator_editmesh;
|
2018-06-04 09:31:30 +02: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);
|
2019-02-10 16:08:25 -05:00
|
|
|
bevel_modal_keymap(keyconf);
|
2009-01-01 13:15:35 +00:00
|
|
|
}
|