[3ds Max MAXScript] Unable to assign new quad menu to right-click entry

maxscript

#1

Hey guys, I posted this over at TheArea and Polycount, but so far no luck. Thought I’d try here. I am using MAXScript to create a new quad menu for some tools and assign it to a right-click context action.

I have been using this Autodesk documentation page to build this: https://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_1374EDCA_CC8B_4B43_81A5_6ED98DBE01D3_htm

The first steps of creating it and modifying a setting works; but I’ve had no luck trying to assign it to a new right-click setting. I’ve left in the returns here to help demonstrate the issue.

newQuad = menuMan.createQuadMenu "newMenu" "quad1" "quad2" 
"quad3" "quad4"
<MixinInterface:quadMenu>
menuMan.setShowAllQuads newQuad true
OK
menuMan.setViewportRightClickMenu #shiftAndControlPressed 
newQuad
true

Despite returning true the new quad menu has no right-click context assigned to it.

I had found some very old documentation saying that the name of the quadMenu needed to be passed (in this case ‘newMenu’), but this returns an error.

Is there something I’m missing here?

Thanks


#2

How do you know it doesn’t have a right-click context? Is it because it doesn’t show up? The code sample you posted only goes so far as to make a quad menu with four quadrants. It doesn’t add any sub menus or action items to any of those quadrants, though. With no menu content there’s nothing to draw, so it very well could be that Max is either not drawing it or considering it empty/invalid and ignoring it.


#3

Ah okay… I’m new to any menu stuff, I’ve just been taking it one-step at a time. I assumed that if I was able to successfully alter things like ‘Show All Quads’ then I would be able to set the keyboard shortcut for this as well. I can manually after the creation. Perhaps you’re right and if it’s empty it will get ignored when changed via script. I’ll have a play tonight and report back. Cheers!