pymel.core.windows.hotBox¶
- hotBox(*args, **kwargs)¶
This command controls parameters related to the hotBox menubar palette. When the command is invoked with no flags, the hotBox is popped up. In query mode, return type is based on queried flag.
Flags:
Long Name / Short Name Argument Types Properties PaneOnlyMenus / po bool Sets a row of menus to be the only visible row. PaneToggleMenus / pt bool Sets the visibilty of a row of menus to on or off. animationOnlyMenus / ao bool animationToggleMenus / at bool clothOnlyMenus / clo bool clothToggleMenus / clt bool commonOnlyMenus / co bool commonToggleMenus / ct bool customMenuSetsToggleMenus / cst bool displayCenterOnly / dco bool Three different display styles are defined for the hotBox. It can be fully displayed (dh), display only the marking menu zones (dzo) or no display (dco) which means that the entire screen can be used to access the marking menus defined in the center zone. displayHotbox / dh bool displayStyle / ds bool Returns a string that identifies the flag used to set the current display style. The results can be dh, dzo, or dco, depending on which style the hotBox is using at the moment. displayZonesOnly / dzo bool dynamicsOnlyMenus / do bool dynamicsToggleMenus / dt bool liveOnlyMenus / lo bool liveToggleMenus / lt bool menuSetOnly / mso unicode menuSetToggle / mst unicode, bool modelingOnlyMenus / mdo bool modelingToggleMenus / mdt bool noClickCommand / ncc script The command to be executed if the hotBox is engaged and then disengaged within noClickDelay time units. noClickDelay / ncd float If the hotBox is engaged and then disengaged within this time interval, then the noClickCommand is executed. The time interval is in seconds. The default value is 0.1. noClickPosition / ncp bool If a -noClickCommand has been specified then this flag will cause the X and Y screen coordinates of the mouse pointer to be appended as arguments to that command. The coordinates used are those of the pointer at the time when the hotbox command was initiated. noKeyPress / nkp bool Normally the hotbox is popped by a pressing a keyboard key. Use the nkpflag to pop the hotbox from a device other than the keyboard (still use the rlflag to unpop the hotbox). polygonsOnlyMenus / plo bool polygonsToggleMenus / plt bool position / pos int, int Specify the screen position the hotbox should be centered at next time it is displayed. The default is the cursor position. release / rl bool Action to be called on the release of the key which invoked the hotbox renderingOnlyMenus / ro bool renderingToggleMenus / rt bool riggingOnlyMenus / rgo bool riggingToggleMenus / rgt bool rmbPopups / rmb bool Enables/Disables a popup menu of the current function set. This popup menu appear when the right mouse button is pressed in the center zone of the hotbox. showAllToggleMenus / a bool Sets the visibility of all menus to on or off. When queried, will only return true if all menu rows are visible. surfacesOnlyMenus / so bool surfacesToggleMenus / st bool transparenyLevel / tr int The percentage of transparency, from 0 to 100. Currently, only the values 0, 25, 50, 75 and 100 are supported. Any other values will be rounded off to the nearest supported value. updateMenus / um bool Reloads the hotBox menus from the main menubar. This flag is used when the menus in the main menubar are modified, and the hotBox menus need to be refreshed. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.hotBox
Example:
import pymel.core as pm # Bind the hotBox to the spacebar. # pm.nameCommand( 'NameComPop_hotBox', annotation='Pop Hotbox', command='hotBox' ) # Result: u'NameComPop_hotBox' # pm.hotkey( k=' ', name='NameComPop_hotBox' ) # Give the hotBox a 'noClickCommand' which displays the screen position at # which the hotBox was requested. Note that 'showPos' function is passed # to the 'noClickCommand' flag as a function, not as a string. This is necessary # to allow Maya to pass the coordinates to it properly. # def showPos(x, y): print("hotBox requested at (%d, %d)" % (x, y)) pm.hotBox(noClickCommand=showPos, noClickPosition=True)