Deprecated RCmenu Methods

 

   

Creating User Interfaces - Quick Navigation

Right-click menus were used in 3ds Max 2 and 3 in place of the QuadMenus introduced in 3ds Max 4.

The following methods were made obsolete by the QuadMenus system, but still exist in 3ds Max.

This page is provided as part of the history of MAXScript but does not reflect current features of 3ds Max!

The following methods let you register and unregister scripted right-click menus:

registerRightClickMenu <rcmenu>

Registers the specified right-click menu.

This method was made obsolete by the QuadMenu system in 3ds Max 4 and higher.

unRegisterRightClickMenu <rcmenu>

Unregisters the specified right-click menu

This method was made obsolete by the QuadMenu system in 3ds Max 4 and higher.

unRegisterAllRightClickMenus()

Unregisters all right-click menus.

This method was made obsolete by the QuadMenu system in 3ds Max 4 and higher.

The following script for 3ds Max 2 and 3 would add two items to the right-click menu: Cast Shadows and Receive Shadows. These items would be enabled only if one object is selected. If enabled, the items would be checked or unchecked based on the current state of the selected object. Choosing a menu item would flip the state of the corresponding object property.

SCRIPT FROM 3DS MAX 3:

rcmenu MyRCmenu
(
menuItem mi_cs "Cast Shadows" checked:false
menuItem mi_rs "Receive Shadows" checked:false
--
on MyRCmenu open do
(
local sel = (selection.count == 1)
-- Enable if only one object is selected
mi_cs.enabled = mi_rs.enabled = sel
-- Set check state of items
if sel do
(
mi_cs.checked = $.castShadows
mi_rs.checked = $.receiveShadows
)
)
-- set up event handlers for items
on mi_cs picked do $.castShadows = (not $.castShadows)
on mi_rs picked do$.receiveShadows = (not $.receiveShadows)
)
-- register the rcmenu
registerRightClickMenu MyRCmenu

You could register as many scripted right-click menus as you like. Each scripted right-click menu registered was appended to the right-click menu window. If a scripted right-click menu with the same name was registered twice, the old one was overwritten by the new one.

See Also