mgear-dev / shifter

Modular Rigging System
MIT License
8 stars 10 forks source link

Menu: Ctrl+Shift results in broken shelf items #86

Closed ivogrig closed 4 years ago

ivogrig commented 4 years ago

Hi,

Problem: Maya has a feature where holding Ctrl+Shift while selecting a menu item adds a shelf-icon instead of running it. Currently this does not work with shifter as the shelf command will only hold a memory-pointer to a python function object. My solution is to pass the command argument as a string rather than a function. A welcome side effect is that the corresponding modules are not imported at startup (might save some time).

I hope this makes sense, let me know if not.

Cheers, Ivo

miquelcampos commented 4 years ago

Oh! nice! I didn't know you can pass the command as str. Thanks btw: do you know if using strings command, the Maya middle click to repeat the last action on the menu will work? This is something I always wanted to research since never worked in mGear menu :P

ivogrig commented 4 years ago

I just tried. Yes, it appears to work for the commands that I modified. You mean middle clicking on the top menu like this, don't you? image

ivogrig commented 4 years ago

If there were icon-files available, we could also pass them as image argument to be used when creating the shelf icon. I did that for our internal menu, it can also conveniently use SVG files.

miquelcampos commented 4 years ago

yes, middle-click on the top menu.
to be more specific. With the previous implementation, the middle click was kind of working but only trigger the first command of the sub-menu for example image if I click in settings by going to the menu. If I use middle-click next time. It will open the guide manager. that was the issue

ivogrig commented 4 years ago

Yes, on my end it properly remembers and opens the Settings dialog every time

miquelcampos commented 4 years ago

about the icon files, we are vendoring this library https://feathericons.com/ But are too generic. I would like to have nice icons/logo for the tools. indeed there is this ticket open https://github.com/mgear-dev/mgear_dist/issues/12

miquelcampos commented 4 years ago

Thanks for this I will check and merge all ASAP :) Please keep it coming if you have more good ideas :D

miquelcampos commented 4 years ago

I am adding the same format to all the modules ;)