Selecting MPxLocatorNodes in 2016


#21

By .mod files, I’m assuming you’re referring to Maya’s module system.

You can put your plug-ins in the plug-ins folder so it’ll automatically be appended to the MAYA_PLUG_IN_PATH. Same goes for scripts and MAYA_SCRIPT_PATH.

If you want to get menus to load, you want to have a look at MFnPlugin::registerUI which you can use to register script callbacks that are invoked when the plug-in is loaded/unloaded which I’m assuming is sufficient to get your menus to load/unload with the plug-in.

Hope that helps.

As far as the selection mask stuff goes, I’m not aware of any solution for the locator. You could kind of fake it by overriding closestPoint and useClosestPointForSelection and always just return the rayPt so that it’s always closer than any other object for single-click selection. But it doesn’t get that selection priority that you would expect when you marquee select like it does with joints.


#22

Weird. There are tons of selection priorities, used for all kinds of objects, including locators, curves, etc. and an API to register your own. They must be integrated in the API beyond just shapes… I guess just using the locator priority might be good enough, since that’s above geometry. Not sure about MPxTransform (that’s closer to joints than locators or shapes, but it’s missing from the Python API 2, so I haven’t tried it here…)

I guess registering UI in the plugin is better than having to add a script call to do it. It means the menu won’t show up until the module is loaded (so the user has to manually turn it on the first time), where doing it with a script means the menu item can always show up and just load the plugin when it’s used, but the former is probably a better tradeoff.


#23

In dont know but it seems AD changed something about selectPriority, because I noticed lately that these settings get reset whenever I create a new or open an existing scene.