Customize Right Click Menu on Material Node

Customize Right Click Menu on Material Node

mitchell.lotierzoJ5X6W
Participant Participant
904 Views
8 Replies
Message 1 of 9

Customize Right Click Menu on Material Node

mitchell.lotierzoJ5X6W
Participant
Participant

Anyone know if you can customize this menu detailed here? The menu doesn't show up in the 'Customize User Interface' dialog and I can't seem to find an entry for it using 'menuMan' in MAXScript.

 

Any help would be greatly appreciated!

0 Likes
Accepted solutions (1)
905 Views
8 Replies
Replies (8)
Message 2 of 9

denisT.MaxDoctor
Advisor
Advisor
fn dumpItem item tab:"" out: =
(
	t = item.gettitle()
	format (tab + "%\n") t to:out
	if not i.getIsSeparator() do
	(
		s = i.getSubMenu()
		if s != undefined do
		(
			dumpMenu s tab:(tab + "\t") out:out
		)
	)
)
fn dumpMenu menu tab:"" out: =
(
	t = menu.gettitle()
	format (tab + "%\n") t to:out
	for k=1 to menu.numitems() do
	(
		i = menu.getitem k
		dumpItem i tab:(tab + "\t") out:out
	)
)

fn menuInspector menu: tab:"" out: = 
(
	for k=1 to menuMan.nummenus() do
	(
		m = menuMan.getmenu k
		dumpMenu m tab:(tab + "\t") out:out
	)
)

/*
out = newScript()
menuInspector out:out
*/

 

try this "inspector", uncomment the comments, run, and then use a simple search...

 

Unfortunately for you, the menu you are looking for goes through a different system (not the Menu Manager) and cannot be extended with pure MXS. The Slate Material Editor has its own set of RC menus.

 

 

0 Likes
Message 3 of 9

mitchell.lotierzoJ5X6W
Participant
Participant

@denisT.MaxDoctor Thanks for this! So, do you know how I would go about extending those menus? Should I be looking into the C++ SDK or?

0 Likes
Message 4 of 9

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@mitchell.lotierzoJ5X6W wrote:

@denisT.MaxDoctor Thanks for this! So, do you know how I would go about extending those menus? Should I be looking into the C++ SDK or?


Since you don't have the resources for the Slate Editor, the only chance I see is to catch the popup menu with a dialog monitor and add items on the fly. You can do it with C++  or C# (which might be easier). The MAX SDK must be used to call the methods you wish to add. Adding "custom menus" does not require the SDK.

0 Likes
Message 5 of 9

denisT.MaxDoctor
Advisor
Advisor

just curious what methods you want to add to those menus?

0 Likes
Message 6 of 9

Serejah
Advocate
Advocate

@mitchell.lotierzoJ5X6W  написал (-а):

@denisT.MaxDoctor Thanks for this! So, do you know how I would go about extending those menus? Should I be looking into the C++ SDK or?


you can use this thread as a starting point

https://forums.cgsociety.org/t/can-mxs-add-custom-menus-to-eg-maxscript-editor/2056944

 

As you can see it is possible to add, but it is a pain to continuously monitor that some sme context menu just opened and the hardest part is to monitor if user actually clicked some of your custom menu items

ofp0GGa8HI.gif

0 Likes
Message 7 of 9

denisT.MaxDoctor
Advisor
Advisor

how is about to add a new (custom) item to the specified submenu😉

0 Likes
Message 8 of 9

Serejah
Advocate
Advocate

@denisT.MaxDoctor  написал (-а):

how is about to add a new (custom) item to the specified submenu😉


hmm.. I just tried that and each time submenu pops up it adds another item, so the submenu stays the same for currently opened parent-menu. So we need to check whether custom items were already added to a submenu with such a handle.

I didn't play much with menu customization, but can't see any good window message to catch up click/mouseup/keyup event on particular item

Do you have any ideas, Denis?

YZTTPt1N8n.gif

0 Likes
Message 9 of 9

denisT.MaxDoctor
Advisor
Advisor

@Serejah wrote:

@denisT.MaxDoctor  написал (-а):

how is about to add a new (custom) item to the specified submenu😉


I didn't play much with menu customization, but can't see any good window message to catch up click/mouseup/keyup event on particular item

Do you have any ideas, Denis?

 


it has to send at least MN_SELECTITEM := 0x1E5, and MN_BUTTONUP := 0x1EF

0 Likes