Bug Report: menuItem -dragMenuCommand does not work as advertised
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The menuItem command has a flag -dragMenuCommand (-dmc), that the command docs describe as follows:
If the menu item is put on the shelf then this command will be invoked when the corresponding shelf object is clicked.
This suggests to me that if you don't want the regular -command contents to be put on the shelf button, then you can additionally specify this -dmc flag and it will put THAT code into the shelf button instead. This would be especially useful in Python where the -command might be a function object, rather than a string, and you do not want that on your shelfButton.
However, this does not seem to be the case (at least in the Maya versions I checked, 2022/23/24). If you use the -dmc flag, then the code you specify is executed IMMEDIATELY ON shelfButton creation (i.e. when you hold Shift/Ctrl and click the menuItem) and then the created shelfButton has an EMPTY command, so doesn't even take on the given -command OR -dragMenuCommand contents.
(Additionally, the comparible -dragDoubleClickCommand flag does appear to work exactly as expected, even though it's doc explanation is essentially identical to -dragMenuCommand).
Is there some trick to get this working? or is this indeed a bug?