Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bohdon/maya-rmbmenuhook
a util for hooking into and extending the right mouse button marking menus in Maya
https://github.com/bohdon/maya-rmbmenuhook
Last synced: 3 months ago
JSON representation
a util for hooking into and extending the right mouse button marking menus in Maya
- Host: GitHub
- URL: https://github.com/bohdon/maya-rmbmenuhook
- Owner: bohdon
- License: mit
- Created: 2017-05-21T22:05:29.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2021-08-13T03:02:55.000Z (almost 3 years ago)
- Last Synced: 2024-01-18T23:29:56.868Z (6 months ago)
- Language: Python
- Size: 30.3 KB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vfx - maya-rmbmenuhook
README
# Maya RMB Marking Menu Hook
A very specific util for hooking into and extending the right mouse button marking menus in Maya.
Adding marking menus using hotkeys for most button combinations is easy, but the right mouse button (unmodified) is inextensible in vanilla Maya. This project makes it easy to conditionally add menus that can replace the RMB default marking menus.
## Basic Example
A simple example would be adding a menu that displays `Switch to IK` or `Switch to FK` if an IKFK animation control is selected.
```python
import pymel.core as pm
import rmbmenuhookdef isIKFKControl(object):
...class IKFKSwitchMenu(rmbmenuhook.Menu):
def shouldBuild(self):
# self.object is the name of the object that is selected or under the mouse cursor
return isIKFKControl(self.object)
def build(self):
# self.menu is the parent marking menu that menuItems should be attached to
pm.setParent(self.menu, m=True)
pm.menuItem(l='Switch to IK', rp='W')
pm.menuItem(l='Switch to FK', rp='E')# register the menu by name, so it can be unregistered by name, and give it a priority
rmbmenuhook.registerMenu('IKFKSwitchMenu', IKFKSwitchMenu, 1)
```## Installation
Download the [latest release](https://github.com/bohdon/maya-rmbmenuhook/releases/latest) and unzip the contents into your `~/Documents/maya/modules` folder.
Add the following to `userSetup.py`:
```python
# enable RMB Marking Menu Hook
import rmbmenuhook
rmbmenuhook.enable()
```## Version 1.0.2 (2017-10-21)
- Adds 2018 mel overrides## Version 1.0.1 (2017-05-26)
- Updates 2015 mel overrides## Version 1.0.0 (2017-05-21)
- Adds 2017 mel overrides
- Adds registering and unregistering menus as a replacement for finding subclasses