Remove the "open/edit/edit popup/delete" context from right click on maya shelf buttons?

Is there any way to to remove the “open/edit/edit popup/delete” context when right clicking on a Maya shelf button?
It takes so much space on top of the actual function buttons.

I can’t seem to find any options or flags, alto i don’t remember these options to be there a few maya version ago…?(or maybe is me not remembering correctly…>?)

If not possible, do you happen to know of a simple “custom shelf like UI?” script i could have a play with?
(perhaps that uses json files to load buttons etc…)

1 Like

the shelfButton command has a -noDefaultPopup(-ndp) flag which removes that default menu. You could add that to a custom shelf button on creation, or simply add that flag (with no parameters) to your existing shelves

1 Like

Thank you! I swear I had tried that before but… this time worked!

At first did not work(the shelf was invalid, no matter what) , but i tried placing the flag in the middle ,between few others in the button mel, and i found that after -enable 1 , did the trick… :smile:

    shelfButton
        -enableCommandRepeat 1
        -flexibleWidthType 3
        -flexibleWidthValue 32
        -enable 1
        -noDefaultPopup 

Actually, after playing with it a little more, i realised that the it removes “every” right click menu pop up, not only the “defaultPopup” …hence is not really what im after unfortunately, since i want to retain right click items i have in there, but now they are buried under a bunch of “open, edit , delete ,etc” buttons…" which is a bit weird.
Imo, this should’ve been a Maya shelf global option, to show and hide, “quick edit” ability for shelfs.

Yeah, you’re not wrong. I would like to find the solution to your exact problem (I’ve accidentally deleted one too many shelf buttons)

Unfortunately I don’t think Maya exposes these menu items in the default command other than that flag. It might take some hacky Qt code to remove them and retain your custom right click menu.

1 Like

Yea, was afraid it might been the case, thanks for checking tho!
I am on a similar boat…might as well just do a custom QT ui , at least there might be less risk of “accidental delete of buttons” and or “corrupted shelf.mel file” .

This could use some love from the Autodesk peeps really…

LOL because I can already imagine why you would want to do this :smiley: