Binding Editable Poly’s Bridge action to a hotkey

Binding Editable Poly’s Bridge action to a hotkey

Anonymous
Not applicable
18,147 Views
21 Replies
Message 1 of 22

Binding Editable Poly’s Bridge action to a hotkey

Anonymous
Not applicable
It appears that the Editable Poly's Bridge action does not work from a bound key. I have bound the Bridge action to a hot key in both 32-bit and 64-bit versions of 3ds Max 2010, neither hot keys would fire off the Bridge action.

Bridging two edges of an editable poly object with a polygon does work when using the button in the editable poly's interface. Nothing in the Max Help documentation points to any reason why the Bridge action will not work when bound to a hot key.

Has anyone seen any issues with actions bound to hot keys not working?
Accepted solutions (3)
18,148 Views
21 Replies
Replies (21)
Message 2 of 22

Steve_Curley
Mentor
Mentor
Doesn't seem to work as expected in 8 through 2010. Does need the Keyboard Shortcut Override Toggle or it does nothing at all.
The Bridge Settings one seems to work OK though.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 22

Anonymous
Not applicable
Binding the Bridge action or the Bridge Settings to any combination of keys has produced no results for me. The override toggle does not make any difference in making the Bridge action work from the bound key.

Yet, if I understand you correctly the Bridge Settings window does open up for you when you bind the action to a key? And you are using 3ds Max 2010?
0 Likes
Message 4 of 22

Steve_Curley
Mentor
Mentor
As I intimated, I tried it in multiple versions, including 2010.

Assigning a shortcut to "Bridge" does press the button (it turns yellow) but it does NOT perform the same action as manually clicking that button.

Assigning a shortcut to "Bridge Settings" brings up the dialog correctly.

Remember that the same shortcut combination can be assigned to more than one thing - it depends on what is "current", and on the state of the Override Toggle, which action is performed.
For example, an Editable Poly object and an Edit Poly (modifier) each have their own shortcuts which may, or may not, be the same for a given function. Setting one of them will not set the same shortcut for the same function in the other one.


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 22

Anonymous
Not applicable
This issue must be local to our machines here then.

Thanks for the information I will have to keep searching.
0 Likes
Message 6 of 22

StephenMF
Collaborator
Collaborator
I have been annoyed with this problem for a while too! Seeing this post made me take a second look at it.

When the shortcut key is pressed the button in edit edges is highlighted yellow. But the edges i have selected do not bridge like you would expect!?!?!?

BUT.
now the bridge command is activated so pressing first one edge and then another results in a bridge. 😕
the same as if you pressed the bridge button with your mouse, WITHOUT having any edges selected.

I had a script/macro setup that did bridge from before the bridge command was introduced, that worked with hotkeys I will try and dig it out and post it here.

Stephen
0 Likes
Message 7 of 22

Steve_Curley
Mentor
Mentor
Yes, I should have mentioned that. It does initiate the "click 2 edges/borders" mode the same as when clicked with the mouse - it does not respect any existing edge/border selection.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 8 of 22

StephenMF
Collaborator
Collaborator
Ok i dug out my old bridge procedure.

First install meshtools / CSPolytools
http://www.scriptspot.com/3ds-max/scripts/meshtools-3-with-cspolytools

Create a button or hotkey for CSPoly Tools' csMakePoly
This script creates a poly out of selected vertecies.

Then open the MAXScript Listener, and enable the macro recorder.

Create a poly object and delete a face so there are some edges to bridge. Select two edges to bridge.

Now clear all in the MAXScript listener.

Convert the edge selection to a vertex selection (see the result in the Listener)

press the csMakePoly to bridge the edges

switch from vertex level back to edges

Drag and drop the code in MAXScriptListener to a toolbar.

Now this new "script" is available in the customize user interface under the category drag and drop. And it can be assigned to a hotkey.

This is what my script looks like:


(
macros.run "Editable Polygon Object" "EPoly_Convert_Sel_To_Vertex"
macros.run "csPolyTools" "csMakePoly"
actionMan.executeAction 369982487 "40004"
subobjectLevel = 2
)



It is a little slow to execute, so i wonder if anyone could write a real script from scratch that worked faster.

One thing i have notticed this script can do better than the bridge that ships with max is that it can bridge two edges that are sharing a vertex like a set of edges forming a "V"

enjoy.
Stephen
0 Likes
Message 9 of 22

Anonymous
Not applicable
I've created a little macro with the help of the macrorecorder, nothing special. I have tested the macro, it should work with editpoly-objects as well as with editpoly-modifiers. Maybe you want to play around with it a bit. I don't know if it's what you're searching for, hope it helps :)


-- PolyBridge
-- by Andreas "real08121985" Meissner
-- 25.02.2010

macroScript mcrPolyBridge
category:"Editable Polygon Object"
tooltip:"PolyBridge"
(
on execute do (

-- CHECK only 1 object selected?
if selection.count == 1 do (

local bEditPolyObj = classof $ == Editable_Poly -- is baseobject an editpoly?
local bBaseObjSel = superclassof (modpanel.getCurrentObject()) != modifier -- is baseobject selected?

-- IF baseobject selected and baseobject is an editable poly THEN bridge edges of baseobject
if bBaseObjSel and bEditPolyObj then (

$.bridgeSelected = 1
$.EditablePoly.Bridge()

-- ELSE IF modifier selected DO TRY bdrige edges of selected modifier
) else if $.modifiers.count > 0 and not bBaseObjSel do (

local iSelMod = modPanel.getModifierIndex $ (modpanel.getCurrentObject()) -- selected modifier index
try $.modifiers.ButtonOp #BridgeEdge catch()
)
)
)
)
0 Likes
Message 10 of 22

Anonymous
Not applicable
First, it may be that you have specific issues. If bridge settings doesn't work, then something sounds wrong other than just the following :

The Bridge command via a keystroke/quad hit will not bridge previously selected edges like the button in the command panel does per se. It will bridge the selected items but you have to manually select one side, then the other. Why this is I can't say, likely just old code, or something that got shoved to the end of the list of things to adjust. It does work fine though just not exactly the same as the command panel hit.

If Bridge settings isn't even working for you .. I suppose this wont be much help, but hopefully it will clear things up for someone searching for this info.
0 Likes
Message 11 of 22

Anonymous
Not applicable
$.EditablePoly.Bridge ()

Select the above line, and with max open beside your browser, drag and drop it onto a toolbar in the max interface. This creates an instant macro button.
Go to Customize user interface, Main UI, All Commands, and press M to quickly get to all the commands starting with "M" in the list and then scroll down to the last numbered Macro.
Assign a shortcut, (mines Ctrl B)

Why on earth Bridge is completely missing from the keyboard list is beyond me. Bridge is a huge part of my work flow. Interestingly enough, if you press the "write Keyboard Chart..." button in customize user interface and look in the resulting txt file, Bridge IS in the list. Crazy Autodeskians!

Oh and feel free to delete the button you created on your toolbar in the first step. You only need to do that to quickly get your macro in the keyboard list in customize user interface.

Hope that helps 🙂

ps. this workflow requires you to select two edges first, then press your bridge shortcut to create the bridging poly.
Message 12 of 22

Anonymous
Not applicable
$.EditablePoly.Bridge ()

Select the above line, and with max open beside your browser, drag and drop it onto a toolbar in the max interface. This creates an instant macro button.
Go to Customize user interface, Main UI, All Commands, and press M to quickly get to all the commands starting with "M" in the list and then scroll down to the last numbered Macro.
Assign a shortcut, (mines Ctrl B)

Why on earth Bridge is completely missing from the keyboard list is beyond me. Bridge is a huge part of my work flow. Interestingly enough, if you press the "write Keyboard Chart..." button in customize user interface and look in the resulting txt file, Bridge IS in the list. Crazy Autodeskians!

Oh and feel free to delete the button you created on your toolbar in the first step. You only need to do that to quickly get your macro in the keyboard list in customize user interface.

Hope that helps 🙂

ps. this workflow requires you to select two edges first, then press your bridge shortcut to create the bridging poly.


This is great, but, I can't seem to get this to work with the 'keyboard shortcut override toggle' on. Is there a way to allow for this?
0 Likes
Message 13 of 22

Anonymous
Not applicable
Accepted solution

Sorry for necroposting, but why isn't there a "Bridge" option in the "Customize User Interface" window?

 

This unacceptable. 7 years later, using 3ds Max 2017 SP3, and this was not deemed worthy of a single "Bridge" entry in there? Seriously??

 

 

Correction: Right now there are THREE pseudo-"Bridge" options in there: two "Edge Bridge" options (one with a floating caddy, and one that uses the previously used caddy settings) and a "Poly Bridge", that works only on polygons. Three entries instead of having a single one that works on both edges and polygons (like what the "Bridge" button from the right panel does). What the hell. And rather than binding one of them to something like Ctrl+B and the other one to Shift+B (which is pathetic, imo, not even sure if they'll even work with the Keyboard Shortcut Override Toggle turned on), my solution was this:

 

Step 1. Create the following file: "C:\Users\[your_username]\AppData\Local\Autodesk\3dsMax\2017 - 64bit\ENU\usermacros\DragAndDrop-Bridge.mcr", with the following content:

 

macroScript Bridge
	category:"DragAndDrop"
	toolTip:""
(
	$.EditablePoly.Bridge ()
)

 

Step 2: Boom! Instant "Bridge" option in the Customize User Interface window. How fricken hard was that?

 

Now I can map it to the "B" key (previously set to "Bottom" view, which nobody ever uses anyway):

 

OxPEEct

 

 

Note: Tested on Windows 10 Pro x64 and it works wonderfully. I just had to create an account and waste half an hour to type this, since this thread was in the top 5 entries when googling this issue. Disappoint, son.

Message 14 of 22

Swordslayer
Advisor
Advisor
Accepted solution

@Anonymous wrote:
Step 1. Create the following file: "C:\Users\[your_username]\AppData\Local\Autodesk\3dsMax\2017 - 64bit\ENU\usermacros\DragAndDrop-Bridge.mcr", with the following content:

 

macroScript Bridge
	category:"DragAndDrop"
	toolTip:""
(
	$.EditablePoly.Bridge ()
)
...

 

Note: Tested on Windows 10 Pro x64 and it works wonderfully. I just had to create an account and waste half an hour to type this, since this thread was in the top 5 entries when googling this issue. Disappoint, son.


There's already a slightly better version of it in one of the posts from 2010, although the forum migration rendered he code unreadable, here it is unescaped:

 

-- PolyBridge
-- by Andreas "real08121985" Meissner
-- 25.02.2010

macroScript mcrPolyBridge
category:"Editable Polygon Object"
tooltip:"PolyBridge"
(
	on execute do
	(
		-- CHECK only 1 object selected?
		if selection.count == 1 do
		(
			local bEditPolyObj = classof $ == Editable_Poly -- is baseobject an editpoly?
			local bBaseObjSel = superclassof (modpanel.getCurrentObject()) != modifier -- is baseobject selected?

			-- IF baseobject selected and baseobject is an editable poly THEN bridge edges of baseobject
			if bBaseObjSel and bEditPolyObj then
			(
				$.bridgeSelected = 1
				$.EditablePoly.Bridge()
			)
			-- ELSE IF modifier selected DO TRY bdrige edges of selected modifier
			else if $.modifiers.count > 0 and not bBaseObjSel do
			(
				local iSelMod = modPanel.getModifierIndex $ (modpanel.getCurrentObject()) -- selected modifier index
				try $.modifiers.ButtonOp #BridgeEdge catch()
			)
		)
	)
)

Although I'd do it in a slightly different way:

 

macroScript mcrPolyBridge
category:"Editable Polygon Object"
tooltip:"PolyBridge"
(
	local obj = modPanel.getCurrentObject()

	case classOf obj of
	(
		Editable_Poly :
		(
			obj.bridgeSelected = 1
			if subObjectLevel == 2 or subObjectLevel == 3 do obj.Bridge()
		)
		Edit_Poly : 
		(
			if subObjectLevel == 2 then obj.ButtonOp #BridgeEdge
			else if subObjectLevel == 3 then obj.ButtonOp #BridgeBorder
			obj.Commit()
		)
	)
)

That said, there was no prior explanation on how to assign shortcuts to macroscripts, so good job there.

Message 15 of 22

Anonymous
Not applicable
macroScript Bridge
	category:"DragAndDrop"
	toolTip:""
(
	$.bridgeSelected = 1
	$.EditablePoly.Bridge ()
)

This works just fine. I used the MAXScript Listener (F11) to grab it. The one from my previous post didn't work on border edges (e.g. when trying to cap a cylinder).

0 Likes
Message 17 of 22

Anonymous
Not applicable
Accepted solution

You're right...

 

Edited your variant to include polygons (for "punching holes", as seen here: link).

 

 

 

macroScript Bridge
	category:"DragAndDrop"
	toolTip:""
(
	local obj = modPanel.getCurrentObject()

	case classOf obj of
	(
		Editable_Poly :
		(
			obj.bridgeSelected = 1
			if subObjectLevel == 2 or subObjectLevel == 3 or subObjectLevel == 4 do obj.Bridge()
		)
		Edit_Poly : 
		(
			if subObjectLevel == 2 then obj.ButtonOp #BridgeEdge
			else if subObjectLevel == 3 then obj.ButtonOp #BridgeBorder
			else if subObjectLevel == 4 then obj.ButtonOp #BridgePolygon
			obj.Commit()
		)
	)
)

 

Thanks.

 

Message 18 of 22

fael097
Advocate
Advocate

for some reason this doesn't work for me. I mean, if I drag this as as button to my toolbar, it works, but if I assign a shortcut to it, instead of bridging two edges instantly, it simply activates bridge mode, and I have to click the two edges in order to bridge them.

 

any fix for this? I'm on max 2017

0 Likes
Message 19 of 22

Swordslayer
Advisor
Advisor

@fael097 wrote:

for some reason this doesn't work for me. I mean, if I drag this as as button to my toolbar, it works, but if I assign a shortcut to it, instead of bridging two edges instantly, it simply activates bridge mode, and I have to click the two edges in order to bridge them.

 

any fix for this? I'm on max 2017


Are you sure you assigned the shortcut to the right command? And what did you drag to the toolbar? All the code snippets here are already macroscripts, dragging to toolbar creates macroscript from code snippet, maybe try evaluating the code instead (CTRL+E in Script Editor).

0 Likes
Message 20 of 22

Anonymous
Not applicable

thanks

0 Likes