Home Technical Talk

rebind ctrl-backspace?

AlecMoody
ngon master
Offline / Send Message
AlecMoody ngon master
I have been building a lowpoly from a detailed sub-d cage for the last few days and it really slows me down to have to pull my hands away to hit ctrl-backspace. Any way to rebind this to another key? I would use one of those third party tools that can bind a macro to any key but I dont want to lose the ability to type with that key in max (in this case the B key would be what I am using). Is there a function for this anywhere in the max UI commands? I tried everything that begins with "remove."

I have remove loop bound right now but there are times when its not what I want.

Replies

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    hmm i havent used max in a few years so i dont know the name of the action, but you could open the maxscript listener and hit the key to figure out what it's called to max.
  • BeatKitano
    Options
    Offline / Send Message
    BeatKitano polycounter lvl 16
    There is no way to rebind ctrl+backspace to another function (at least that I know of), backspace is not recognized as a valid keystroke in the binds.

    But you can assign that function to another key, just bind VertexRemove in the "Ribbon - Modeling" category.


    I'm using a custom macro for that:
    MacroScript Remover
    Category:"BTK Scripts"
    Tooltip:"Remover"
    (
    	
    
    if (selection.count == 1 ) then -- check if there's only one mesh selected
    (
    		curObj = $.baseobject
    case subobjectlevel of 
    (
    	
    	1: -- selection=vertex
    	(
    		macros.run "Ribbon - Modeling" "VertexRemove"
    	)
    		
    	2:-- selection=edge
    	(		
    		macros.run "Ribbon - Modeling" "EdgeRemove"
    	)
    	
    	4:-- selection=face
    	(	
    		lolface=polyop.getfaceselection curObj
    		polyop.deleteFaces	curObj lolface 
    	)
    
    )
    )
    )
    
  • [HP]
    Options
    Offline / Send Message
    [HP] polycounter lvl 13
    BeatKitano wrote: »
    But you can assign that function to another key, just bind VertexRemove in the "Ribbon - Modeling" category.

    Always wondered that, thanks. I've been meant to reassign this hotkey for years.
  • Sparx_25
    Options
    Offline / Send Message
    I have too this problem. I cant rebind "clean remove" function to another key. I dont like pressing CTRL + Backspace. "VertexRemove" doesnt do clean remove for me. It only remove edge but not associated vertecies. It seems that clean remove is missing in custom keyboard menu. Only solution to this I see in some good script but i cant do this things :( Someone pls help me with this.
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    macroscript CleanRemove
    category:"miauu"
    tooltip:"As default max Ctrl+Backspace"
    buttonText:"Clean Remove"
    (
        if selection.count ==1 and classof selection[1] == Editable_Poly then
        (
            local currObj = $
            if subobjectlevel==1 then
            (
                vertSel01 = polyop.getVertSelection currObj 
                currObj.EditablePoly.ConvertSelectionToBorder #Vertex #Edge
                currObj.Remove selLevel: #Edge
                vertsToRemove = for i in vertSel01 where (polyop.getEdgesUsingVert currObj i ).numberSet <= 2 collect i
                polyop.setVertSelection currObj vertsToRemove
                currObj.Remove selLevel: #Vertex
                redrawViews()
            )
            else
            (
                if subobjectlevel==2 or subobjectLevel==3 then
                (
                    edgeSel01 = polyop.getEdgeSelection currObj
                    edgeVerts = polyop.getVertsUsingEdge currObj edgeSel01
                    currObj.Remove selLevel:#Edge
                    vertsToRemove = for i in edgeVerts where (polyop.getEdgesUsingVert currObj i ).numberSet <= 2 collect i
                    polyop.setVertSelection currObj vertsToRemove
                    currObj.Remove selLevel: #Vertex
                    redrawViews()
                )
                else
                    messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
            )
        )
        else
            messagebox "The selected object is not an Editable Poly object" title:"miauu Script Error!!!"
    )
    
  • Sparx_25
    Options
    Offline / Send Message
    Finally script that actually works! :D Thank you miauu. This will help me a lot...
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    Sparx_25 wrote: »
    Finally script that actually works! :D Thank you miauu. This will help me a lot...
    :)
    Let me know if you want support for edit poly modifier. :)
  • Sparx_25
    Options
    Offline / Send Message
    miauu wrote: »
    :)
    Let me know if you want support for edit poly modifier. :)

    That would be great, because i will definatelly use both edit and editable poly :).
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    Tonight I will update the script with Edit_Poly support. :)
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    The support for Edit_Poly modifier is added. :)
    macroscript CleanRemove
    category:"miauu"
    tooltip:"As default max Ctrl+Backspace"
    buttonText:"Clean Remove"
    (
        if selection.count ==1 then
        (
            function GetEdgesUsingVertEPM curSel verts =
            (
                local edgeVerts = #()
                for i in verts do
                (
                    edgeVerts[1] = curSel.GetEdgeVertex i 1 node:$
                    edgeVerts[2] = curSel.GetEdgeVertex i 2 node:$
                )
                edgeVerts
            )
            local curObj = modPanel.getCurrentObject()
            if (classOf curObj) == Editable_Poly do
            (
                if subobjectlevel==1 then
                (
                    vertSel01 = polyop.getVertSelection curObj 
                    curObj.EditablePoly.ConvertSelectionToBorder #Vertex #Edge
                    curObj.Remove selLevel: #Edge
                    vertsToRemove = for i in vertSel01 where (polyop.getEdgesUsingVert curObj i ).numberSet <= 2 collect i
                    polyop.setVertSelection curObj vertsToRemove
                    curObj.Remove selLevel: #Vertex
                    redrawViews()
                )
                else
                (
                    if subobjectlevel==2 or subobjectLevel==3 then
                    (
                        edgeSel01 = polyop.getEdgeSelection curObj
                        edgeVerts = polyop.getVertsUsingEdge curObj edgeSel01
                        curObj.Remove selLevel:#Edge
                        vertsToRemove = for i in edgeVerts where (polyop.getEdgesUsingVert curObj i ).numberSet <= 2 collect i
                        polyop.setVertSelection curObj vertsToRemove
                        curObj.Remove selLevel: #Vertex
                        redrawViews()
                    )
                    else
                        messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
                )            
            )
            if (classOf curObj) == Edit_Poly do     
            (
                if subobjectlevel==1 then
                (
                    vertSel01 = curObj.getSelection #Vertex
                    curObj.ConvertSelectionToBorder #Vertex #Edge
                    curObj.buttonOp #RemoveEdge
                    vertsToRemove = for i in vertSel01 where (GetEdgesUsingVertEPM curObj #(i) ).count <= 2 collect i
                    curObj.setSelection #Vertex (vertsToRemove as bitarray)
                    curObj.buttonOp #RemoveVertex
                    redrawViews()
                )
                else
                (
                    if subobjectlevel==2 or subobjectLevel==3 then
                    (
                        edgeSel01 = curObj.getSelection #Edge
                        curObj.ConvertSelection #Edge #Vertex
                        curObj.buttonOp #RemoveEdge
                        edgeVerts = curObj.getSelection #Vertex
                        vertsToRemove = for i in edgeVerts where (GetEdgesUsingVertEPM curObj #(i) ).count <= 2 collect i
                        curObj.setSelection #Vertex (vertsToRemove as bitarray)
                        curObj.buttonOp #RemoveVertex
                        redrawViews()
                    )
                    else
                        messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
    
  • Sparx_25
    Options
    Offline / Send Message
    It doesnt work in edit poly, only removes edge, verticies are still there :(
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    It works for me. :)
    Watch the video:

    [ame]http://www.youtube.com/watch?v=5kRR14pMN0E[/ame]

    Can you send me the scene that is problematic for you. Note that I use max2009. :)
  • Sparx_25
    Options
    Offline / Send Message
    That is strange. Maybe its because I am using 2010. Basically I just started new clean scene, add some primitive like sphere, convert to editable poly - no problem with removing both edges and verticices. Add edit poly modifier - remove only edges.
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    I don't have max2010 to test this. Sorry.
  • Sparx_25
    Options
    Offline / Send Message
    miauu wrote: »
    I don't have max2010 to test this. Sorry.

    No problem miauu :), I will try my best to fix it for 2010 version.
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    May be I will hav the chance to use one friends notebook with installed max2010 for a few days, so I can try to fix the problem. :)
  • Sparx_25
    Options
    Offline / Send Message
    miauu wrote: »
    May be I will hav the chance to use one friends notebook with installed max2010 for a few days, so I can try to fix the problem. :)

    I really hope you solve it out. I tried some modifications on your script, but It doesnt work :(
  • miauu
    Options
    Offline / Send Message
    miauu polycounter lvl 14
    I just tested the script on max2011. Everything works fine. I don't know why on max2010 the Edit_Poly support is not working for you.
    Try this code:
    macroscript CleanRemove
    category:"miauu"
    tooltip:"As default max Ctrl+Backspace"
    buttonText:"Clean Remove"
    (
        if selection.count ==1 then
        (
            function GetEdgesUsingVertEPM curSel verts =
            (
                local edgeVerts = #()
                for i in verts do
                (
                    edgeVerts[1] = curSel.GetEdgeVertex i 1 node:$
                    edgeVerts[2] = curSel.GetEdgeVertex i 2 node:$
                )
                edgeVerts
            )
            local curObj = modPanel.getCurrentObject()
            if (classOf curObj) == Editable_Poly do
            (
                if subobjectlevel==1 then
                (
                    vertSel01 = polyop.getVertSelection curObj 
                    curObj.EditablePoly.ConvertSelectionToBorder #Vertex #Edge
                    curObj.Remove selLevel: #Edge
                    vertsToRemove = for i in vertSel01 where (polyop.getEdgesUsingVert curObj i ).numberSet <= 2 collect i
                    polyop.setVertSelection curObj vertsToRemove
                    curObj.Remove selLevel: #Vertex
                    redrawViews()
                )
                else
                (
                    if subobjectlevel==2 or subobjectLevel==3 then
                    (
                        edgeSel01 = polyop.getEdgeSelection curObj
                        edgeVerts = polyop.getVertsUsingEdge curObj edgeSel01
                        curObj.Remove selLevel:#Edge
                        vertsToRemove = for i in edgeVerts where (polyop.getEdgesUsingVert curObj i ).numberSet <= 2 collect i
                        polyop.setVertSelection curObj vertsToRemove
                        curObj.Remove selLevel: #Vertex
                        redrawViews()
                    )
                    else
                        messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
                )            
            )
            if (classOf curObj) == Edit_Poly do     
            (
                if subobjectlevel==1 then
                (
                    vertSel01 = curObj.getSelection #Vertex
                    curObj.ConvertSelectionToBorder #Vertex #Edge
                    curObj.buttonOp #RemoveEdge
                    vertsToRemove = for i in vertSel01 where (GetEdgesUsingVertEPM curObj #(i) ).count <= 2 collect i
                    curObj.setSelection #Vertex (vertsToRemove as bitarray)
                    curObj.buttonOp #RemoveVertex
                    redrawViews()
                )
                else
                (
                    if subobjectlevel==2 or subobjectLevel==3 then
                    (
                        edgeSel01 = curObj.getSelection #Edge
                        curObj.ConvertSelection #Edge #Vertex
                        curObj.buttonOp #RemoveEdge
                        edgeVerts = curObj.getSelection #Vertex
                        vertsToRemove = for i in edgeVerts where (GetEdgesUsingVertEPM curObj #(i) ).count <= 2 collect i
                        curObj.setSelection #Vertex (vertsToRemove as bitarray)
                        curObj.buttonOp #RemoveVertex
                        redrawViews()
                    )
                    else
                        messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
                )
            )
        )
    )
    
  • Dreamexpress
    Options
    Offline / Send Message
    You dont need to make a script, just rebind edge remove under ribon - modeling to a hotkey, then hold down ctrl and press it just like you do with ctrl backspace

    (correction: assign both the hotkey you want and ctrl plus the hotkey you want as shortcut too edge remove for me d , ctrl + d )
  • Sparx_25
    Options
    Offline / Send Message
    You dont need to make a script, just rebind edge remove under ribon - modeling to a hotkey, then hold down ctrl and press it just like you do with ctrl backspace

    (correction: assign both the hotkey you want and ctrl plus the hotkey you want as shortcut too edge remove for me d , ctrl + d )

    Yeah it works Dreamexpress. Heh, I tried to rebing edge remove in ribon-modeling category before to Y key, but it didnt work of course. But when I tried your method it works both in editable and edit poly. I only bind it to CTRL+Y. Thanks :)

    Thanks Miauu for your effort in helping me :thumbup:
  • tabacaru.mvlad
    You dont need to make a script, just rebind edge remove under ribon - modeling to a hotkey, then hold down ctrl and press it just like you do with ctrl backspace

    (correction: assign both the hotkey you want and ctrl plus the hotkey you want as shortcut too edge remove for me d , ctrl + d )

    Anyone know if assigning another shortcut to ctrl+backspace ( from ribbon-modelling) will the backspace button still work (delete edges without vertices) ? I ask because from a mistake I change the delete object shortcut ( which is delete ) and I couldn't assign it back, I have to reset all shortcut. Max it`s not supporting backspace or delete as shortcut, if u change them you couldn't put them back.
  • XibaD
    Options
    Offline / Send Message
    XibaD polycounter lvl 9
    I'm bumping this thread to post an update to miauu's script, made by the man himself recently. It works with edges, vertices, multiple selections in editable poly and edit poly.

    Thank you miauu!
    --******************************************************************************************************
    -- Created: 16-07-2011
    -- Last Updated: 08-06-2016
    -- Version: 1.00
    --
    -- Author : Kostadin Kotev / miau_u@yahoo.com / http://miauumaxscript.blogspot.bg/
    -- Version: 3ds max 2009 (10) (should work in older versions too!)
    --
    -- Discription: DESCRIPTION
    -- Usage: RUN IT
    --
    -- Wishlist:
    --
    --******************************************************************************************************
    -- MODIFY THIS AT YOUR OWN RISK

    macroscript CleanRemove
    category:"miauu"
    tooltip:"As default max Ctrl+Backspace"
    buttonText:"Clean Remove"
    (
    local bitFlag = (bit.set 0 27 true)
    local poSetVertFlags = polyop.setVertFlags
    local poGetVertsByFlag = polyop.getVertsByFlag
    local poGetEdgeSelection = polyop.getEdgeSelection

    if selection.count ==1 then
    (
    function GetVertsByFlagEPM obj flag =
    (
    local vertsBA = #{}
    vertsBA = poGetVertsByFlag obj flag
    -- return
    vertsBA
    )
    function SetVertsByFlagEPM obj vertsBA flag =
    (
    if vertsBA == undefined do
    poSetVertFlags obj vertsBA flag undoable:true
    )

    function GetEdgesUsingVertEPM curSel verts =
    (
    local edgeVerts = #()
    for i in verts do
    (
    edgeVerts[1] = curSel.GetEdgeVertex i 1 node:$
    edgeVerts[2] = curSel.GetEdgeVertex i 2 node:$
    )
    edgeVerts
    )
    local curObj = modPanel.getCurrentObject()
    if (classOf curObj) == Editable_Poly do
    (
    if subobjectlevel==1 then
    (
    vertSel01 = polyop.getVertSelection curObj
    curObj.EditablePoly.ConvertSelectionToBorder #Vertex #Edge
    curObj.Remove selLevel: #Edge
    vertsToRemove = for i in vertSel01 where (polyop.getEdgesUsingVert curObj i ).numberSet <= 2 collect i
    polyop.setVertSelection curObj vertsToRemove
    curObj.Remove selLevel: #Vertex
    redrawViews()
    )
    else
    (
    if subobjectlevel==2 or subobjectLevel==3 then
    (
    edgeSel01 = polyop.getEdgeSelection curObj
    edgeVerts = polyop.getVertsUsingEdge curObj edgeSel01
    SetVertsByFlagEPM curObj edgeVerts bitFlag
    curObj.Remove selLevel:#Edge
    edgeVertsBA = GetVertsByFlagEPM curObj bitFlag
    vertsToRemove = for i in edgeVertsBA where (polyop.getEdgesUsingVert curObj i ).numberSet <= 2 collect i
    polyop.setVertSelection curObj vertsToRemove
    curObj.Remove selLevel: #Vertex
    redrawViews()
    )
    else
    messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
    )
    )
    if (classOf curObj) == Edit_Poly do
    (
    if subobjectlevel==1 then
    (
    vertSel01 = curObj.getSelection #Vertex
    curObj.ConvertSelectionToBorder #Vertex #Edge
    curObj.buttonOp #RemoveEdge
    vertsToRemove = for i in vertSel01 where (GetEdgesUsingVertEPM curObj #(i) ).count <= 2 collect i
    curObj.SetSelection #Vertex #{} node:(selection[1])
    curObj.Select #Vertex (vertsToRemove as bitarray)
    curObj.buttonOp #RemoveVertex
    redrawViews()
    )
    else
    (
    if subobjectlevel==2 or subobjectLevel==3 then
    (
    edgeSel01 = curObj.getSelection #Edge
    curObj.ConvertSelection #Edge #Vertex
    curObj.buttonOp #RemoveEdge
    edgeVerts = curObj.getSelection #Vertex
    vertsToRemove = for i in edgeVerts where (GetEdgesUsingVertEPM curObj #(i) ).count <= 2 collect i
    subobjectlevel = 1
    curObj.SetSelection #Vertex #{} node:(selection[1])
    curObj.Select #Vertex (vertsToRemove as bitarray)
    curObj.buttonOp #RemoveVertex
    curObj.commit()
    subobjectlevel==2
    redrawViews()
    )
    else
    messagebox "Go to Vertex or Edge sub-object level" title:"miauu Script Error!!!"
    )
    )
    )
    )




  • Mant1k0re
    Options
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    I had totally given up on this, thanks for the necrobump!
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Hey guys,

    This is definitly where keyhydra can be of some help. As it can, do all of this. www.onikanabo.com/keyhydra.

    You be able to assign tools on 'space', 'del', backspace' while still keeping the original behaviour. Exemple : keeping 'space' for lock selection, but pressing 'twice' the space key will do 'extrude' or whatever you want as you can assign whatever you want inside the shortcut editor

    Availability of the trial should be next week

    Massimo
  • huffer
    Options
    Offline / Send Message
    huffer interpolator
    Miauu's script doesn't work for me, binding a key and Ctrl + key for VertexRemove works, however, I'd like to have it reversed, pressing the key should do what Ctrl + Key does. Right now I use the Uniremover script which works well.
  • OlivierMcClish
    Options
    Offline / Send Message
    OlivierMcClish polycounter lvl 3

    Hey everyone couple years later!

    I tried the miauu script but it's seams not working in max 2022. Is someone as somewhat figure it out yet?

    Thx!

  • Neox
    Options
    Online / Send Message
    Neox godlike master sticky

    isn't it just "Remove (Poly)" ?

    tested it in max 2011 and max 2020. just tested on a few loops, or verts. same result als ctrl+backspace. or not?


    i guess @perprerp would know?

  • Kanni3d
    Options
    Offline / Send Message
    Kanni3d ngon master

    Yep, it's just "Remove", can be bound to anything - dunno where this confusion stemmed from, but it's brought up often lol.

Sign In or Register to comment.