Notifications
Clear all

[Closed] Custom Quad menu for specific class

I’ve extended the helper/point class and I’d like to have a custom quad menu for it. (and not showing any of the defaults). I’ve been digging in the docs but I can seem to find a way to get this working. Is it even possible?

4 Replies

I am not sure that this will work, but did you tried to create a macros for your extended primitives. Then you can create custom Quad Menu using these macros.

That is the plan, but the problem is I can’t make a ‘condition’ quad, or make entries that are disabled when they don’t make sense. They are in there by default for some options, when doing an edit-spline for example there is a different menu active compared to when you have an edit poly selected. I need to find away to create these context other then using the menuMan.setViewportRightClickMenu in select/deselect event on my nodes but that sounds a bit iffy

I think you simply need to use the “on isEnabled do” or “on isVisible do” handlers, from the help here:

on isEnabled do <expr>

If <expr> returns false and the macroscript item is in a menu or quad menu, the macroscript item will not appear in the menu or quad menu. If the macroscript is a toolbar button, the button will be disabled. The do is optional for this event handler. If this event handler is not specified, the item will be enabled.

on isVisible do <expr>

If <expr> returns false and the macroscript item is in a menu or quad menu, the macroscript item will not appear in the menu or quad menu. If the macroscript is a toolbar button, this handler has no affect. The do is optional for this event handler. If this event handler is not specified, the item will be visible.

-Eric

Thx! learned something new again!