delete hotkey

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
theshrike
Posts: 0
Joined: Fri Jan 22, 2010 7:27 am

delete hotkey

Post by theshrike » Sun Jun 27, 2010 10:27 pm

When you hit delete, you usually get a menu prompting to select 'vertices' 'edges' 'faces' etc. I.e. it takes 2 clicks to execute the function

It would be nice to make this common operation *one* click, i.e. pressing delete does so *immiediately*.

Is it possible to do this through its scripting - i.e. can you attach a script to a hotkey.
I notice it does tell you the appropriate script command. bpy.ops.mesh.delete(type='POLY')

the ideal for me would be something context sensitive, i.e. select a poly it deletes the poly, select an edge it deletes the edge.. you already gave that information via your mode and selection, so this there shouldn't be need to specify it again :)

its just one click but reducing the number of presses & clicks for the most common operations has a big impact on workflow.

What would be *perfect* is if selecting vertices or edges & hitting delete would run "dissolve" operation (fudged with quads/tris rather than using ngons) -
i.e. select an Edge, hit Delete and it just redoes the tris/quads around it to eliminate that edge.. gives you more commands through fewer hotkeys/menu selections. could a script be written to do that or would that have to be added as change to the sourcecode..

Nikprodanov
Posts: 0
Joined: Fri Feb 13, 2009 8:54 pm

Post by Nikprodanov » Mon Jun 28, 2010 3:18 pm

For 2.5x, right? Actually, the reason the menu pops up is because the Delete key is mapped to all Delete functions (Vertex, Edge, Face, all...). If, for example you map Vertex to one key, and Face to another one, no menu will pop up when you press them. You can combine them in a Ctrl/Shift/Alt+Delete fashion for each type.

On the other hand, if you want context sensitivity, you can make your own operator in Python and put it as an Addon. Something like:

Code: Select all

mode = context.tool_settings.mesh_selection_mode
if mode[0] == True and mode[1] == False and mode[2] == False:
			bpy.ops.mesh.delete(type='VERT') 

theshrike
Posts: 0
Joined: Fri Jan 22, 2010 7:27 am

Post by theshrike » Mon Jun 28, 2010 11:48 pm

Nikprodanov wrote:For 2.5x, right? Actually, the reason the menu pops up is because the Delete key is mapped to all Delete functions (Vertex, Edge, Face, all...). If, for example you map Vertex to one key, and Face to another one, no menu will pop up when you press them. You can combine them in a Ctrl/Shift/Alt+Delete fashion for each type.

On the other hand, if you want context sensitivity, you can make your own operator in Python and put it as an Addon. Something like:

Code: Select all

mode = context.tool_settings.mesh_selection_mode
if mode[0] == True and mode[1] == False and mode[2] == False:
			bpy.ops.mesh.delete(type='VERT') 
ok that works, thanks
what got me before is the right click remap option on the menu appeared to remap all the types too.
i dont mind having say 'delete' for just polys and 'x' for the menu..

Is there a method in python to check number of selected vertices?
i'd like it to make 'F' do fill edge/face if 2,3,4 are selected, or the same as shift-F if more are selected..

Nikprodanov
Posts: 0
Joined: Fri Feb 13, 2009 8:54 pm

Post by Nikprodanov » Tue Jun 29, 2010 10:00 am

There should be, but i can't tell you much about it, you'll need to ask in the Python forum. Also, you better use the full keymap editor in the user preferences. The rightclick-change shortcut option on the menu doesn't allow you to set extra parameters like VERT/EDGE/FACE.

Post Reply