| 
									
										
										
										
											2011-02-23 10:52:22 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2009-01-01 13:15:35 +00:00
										 |  |  |  * 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. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-18 08:08:12 +11:00
										 |  |  | /** \file
 | 
					
						
							|  |  |  |  * \ingroup edmesh | 
					
						
							| 
									
										
										
										
											2011-02-27 20:29:51 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "DNA_scene_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"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 17:55:27 +00:00
										 |  |  | #include "ED_mesh.h"
 | 
					
						
							| 
									
										
										
										
											2009-07-08 16:17:47 +00:00
										 |  |  | #include "ED_screen.h"
 | 
					
						
							| 
									
										
										
										
											2009-01-01 13:15:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02: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) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_select_all); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_interior_faces); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_more); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_less); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_non_manifold); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_linked); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_linked_pick); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_random); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_ungrouped); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_hide); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_reveal); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_face_by_sides); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_loose); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_mirror); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_normals_make_consistent); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_merge); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_subdivide); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_subdivide_edgering); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_unsubdivide); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_faces_select_linked_flat); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_edges_select_sharp); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_primitive_plane_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_primitive_cube_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_primitive_circle_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_primitive_cylinder_add); | 
					
						
							|  |  |  |   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); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_primitive_cube_add_gizmo); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_duplicate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_remove_doubles); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_spin); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_screw); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_extrude_region); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_extrude_context); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_extrude_faces_indiv); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_extrude_edges_indiv); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_extrude_verts_indiv); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_split); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_extrude_repeat); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_edge_rotate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_shortest_path_select); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_loop_to_region); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_region_to_loop); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_axis); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_uvs_rotate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_uvs_reverse); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_colors_rotate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_colors_reverse); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_fill); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_fill_grid); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_fill_holes); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_beautify_fill); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_quads_convert_to_tris); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_tris_convert_to_quads); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_decimate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dissolve_verts); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dissolve_edges); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dissolve_faces); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dissolve_mode); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dissolve_limited); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dissolve_degenerate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_delete_edgeloop); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_faces_shade_smooth); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_faces_shade_flat); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_sort_elements); | 
					
						
							| 
									
										
										
										
											2012-12-20 07:57:26 +00:00
										 |  |  | #ifdef WITH_FREESTYLE
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02: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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_delete); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_delete_loose); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_edge_collapse); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_separate); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_dupli_extrude_cursor); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_loop_select); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_edge_face_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_shortest_path_pick); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_similar); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_similar_region); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_mode); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_loop_multi_select); | 
					
						
							|  |  |  |   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
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_mark_freestyle_edge); | 
					
						
							| 
									
										
										
										
											2012-12-20 07:57:26 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_vertices_smooth); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_vertices_smooth_laplacian); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_flip_normals); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_rip); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_rip_edge); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_blend_from_shape); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_shape_propagate_to_all); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /* 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
										 |  |  | 
 | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
											  
											
												Sculpt Vertex Colors: Initial implementation
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
  - SCULPT_UNDO_COLOR for undo support in sculpt mode
  - SCULPT_UPDATE_COLOR and PBVH flags and rendering
  - Sculpt Color API functions
  - Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
  - Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
  - Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
  - Remesher reprojection in the Voxel Remehser
  - Paint Brush and Smear Brush with color smoothing in alt-smooth mode
  - Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
  - Color Filter
  - Color picker (uses S shortcut, replaces smooth)
  - Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
											
										 
											2020-06-22 20:05:28 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_sculpt_vertex_color_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_sculpt_vertex_color_remove); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_customdata_mask_clear); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_customdata_skin_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_customdata_skin_clear); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_customdata_custom_splitnormals_add); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_customdata_custom_splitnormals_clear); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_edgering_select); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_loopcut); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_solidify); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_select_nth); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_vert_connect); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_vert_connect_path); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_vert_connect_concave); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_vert_connect_nonplanar); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_face_make_planar); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_knife_tool); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_knife_project); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_bevel); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_bridge_edge_loops); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_inset); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_offset_edge_loops); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_intersect); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_intersect_boolean); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_face_split_by_edges); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_poke); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_wireframe); | 
					
						
							|  |  |  |   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
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02: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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   WM_operatortype_append(MESH_OT_bisect); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_symmetrize); | 
					
						
							|  |  |  |   WM_operatortype_append(MESH_OT_symmetry_snap); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   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
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   Object *obedit = CTX_data_edit_object(C); | 
					
						
							|  |  |  |   if (obedit && obedit->type == OB_MESH) { | 
					
						
							|  |  |  |     BMEditMesh *em = BKE_editmesh_from_object(obedit); | 
					
						
							|  |  |  |     if (em && em->selectmode & SCE_SELECT_FACE) { | 
					
						
							|  |  |  |       return 1; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   return 0; | 
					
						
							| 
									
										
										
										
											2009-11-17 20:40:39 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											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) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   wmOperatorType *ot; | 
					
						
							|  |  |  |   wmOperatorTypeMacro *otmacro; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", | 
					
						
							|  |  |  |                                     "Loop Cut and Slide", | 
					
						
							|  |  |  |                                     "Cut mesh loop and slide it", | 
					
						
							|  |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   WM_operatortype_macro_define(ot, "MESH_OT_loopcut"); | 
					
						
							|  |  |  |   WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   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); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", | 
					
						
							|  |  |  |                                     "Add Duplicate", | 
					
						
							|  |  |  |                                     "Duplicate mesh and move", | 
					
						
							|  |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   WM_operatortype_macro_define(ot, "MESH_OT_duplicate"); | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_rip_move", | 
					
						
							|  |  |  |                                     "Rip", | 
					
						
							|  |  |  |                                     "Rip polygons and move the result", | 
					
						
							|  |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip"); | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_rip_edge_move", | 
					
						
							|  |  |  |                                     "Extend Vertices", | 
					
						
							|  |  |  |                                     "Extend vertices and move the result", | 
					
						
							|  |  |  |                                     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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", | 
					
						
							|  |  |  |                                     "Extrude Region and Move", | 
					
						
							|  |  |  |                                     "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_translate"); | 
					
						
							| 
									
										
										
										
											2019-04-30 13:42:18 +10:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +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", | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   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", | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   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", | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", | 
					
						
							|  |  |  |                                     "Extrude Only Edges and Move", | 
					
						
							|  |  |  |                                     "Extrude edges and move result", | 
					
						
							|  |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", | 
					
						
							|  |  |  |                                     "Extrude Only Vertices and Move", | 
					
						
							|  |  |  |                                     "Extrude vertices and move result", | 
					
						
							|  |  |  |                                     OPTYPE_UNDO | OPTYPE_REGISTER); | 
					
						
							|  |  |  |   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); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "mirror", false); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   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"); | 
					
						
							| 
									
										
										
										
											2019-04-30 13:42:18 +10:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   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"); | 
					
						
							| 
									
										
										
										
											2019-04-30 13:42:18 +10:00
										 |  |  |   RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02: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", | 
					
						
							|  |  |  |                                     "", | 
					
						
							|  |  |  |                                     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", | 
					
						
							|  |  |  |                                     "", | 
					
						
							|  |  |  |                                     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
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* 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
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Mesh", 0, 0); | 
					
						
							|  |  |  |   keymap->poll = ED_operator_editmesh; | 
					
						
							| 
									
										
										
										
											2018-06-04 09:31:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |   knifetool_modal_keymap(keyconf); | 
					
						
							|  |  |  |   point_normals_modal_keymap(keyconf); | 
					
						
							|  |  |  |   bevel_modal_keymap(keyconf); | 
					
						
							| 
									
										
										
										
											2009-01-01 13:15:35 +00:00
										 |  |  | } |