Documentation: User Interface Customization

User Interface Customization

You can customize your user interface – that is: you can build your own menus and attach functions to controller buttons in any way you like. This is possible with the MARUI UI LayoutEditor.

The following video gives a quick introduction on how to use the UI Layout Editor:
https://www.youtube.com/watch?v=TbP-HMLx–w&index=31&list=PLYt4XosVlCmWKxhYrVzBwu8yEXVGm3jwg

You can open the UI Layout Editor by pressing the icon in the MARUI shelf tab in the Maya shelf:
ShelfIcon UI Layouts

.

.

.

Widget Mappings

In the first tab, the UI Layout Editor allows mapping widgets to controller buttons. “Widgets” in MARUI are any kind of function or menu, such as “Create a new object” or an “Animation Menu”.

Widgets

In the top part you can find a list of all the widgets available in MARUI.
Here are a few common widgets that are available by default in MARUI:
Trigger : The default trigger action for whatever tool is selected.
Move : The 3D move tool (translation).
Rotate : The 3D rotation tool.
Scale : The 3D scale tool.
EditPivot : The tool to change the location of the rotation/scale pivot of an object.
Omni : The 6DOF “Omni” tool that allows moving, rotating, and scaling objects at the same time.
– QuickDrag: The 6DOF “QuickDrag” tool that allows moving objects without having to select them first.
EPCurve : The EP Curve Tool from the NURBS Menu
PencilCurve : The Pencil Curve Tool from the NURBS Menu
PolyDraw : The Polygon Draw Tool from the Polygon Menu
– POVCamera : The ((POVCameraTool|POV Camera Tool) from the Lighting / Rendering Menu
– Snapping_ToUnits : Activate snapping to Maya units, as in the Modeling Menu
Snapping_ToPoints : Activate snapping to points, as in the Modeling Menu
Snapping_ToCurves : Activate snapping to curves, as in the Modeling Menu
– Menu_Tool
: The tool menu to choose the current tool.
Menu_Mode : The mode menu to chose the component mode (Vertex, Edge, Object, …).
HotBox : The Maya HotBox (aka spacebar menu).
Navi : Navigation, whichever was selected in the settings.
Shift : The Shift button.
Alt : The “Alt” button that switches the UI layout to it’s alternative button mapping (see Alt )
Of course, you can create your own widgets and then find them in this list as well. How to create your own widgets will be explained in detail below.

Layouts

Layouts allow you to swich quickly between different sets of widget/button mappings. For example, you can have one layout for modeling, and then quickly switch to a different “Animation” layout and back. MARUI allows you to define an unlimited number of layouts.
Each layout is identified through its name, so all layout names must be unique. You can also edit the default layouts (Modeling, Animation, and Lighting/Rendering) provided by default.

Click on the name of a layout in the list to select it, or type a name in the text box and click Create to create a new layout.
All layouts that you create will be added to the UI Layouts Menu menu for easy access.
If you wish re rename a layout, select it, type in the new name into the text box, and click the “Rename” button.
To delete a layout, select it and press the “Delete” button.

Mapping Widgets to Controller Buttons

In the image below, you have several tabs that show an image of the
Oculus Touch Controller, HTC Vive Controller, WindowsMR controller, and LeapMotion actions respectively.
Each image shows the buttons available on that controller and the MARUI Widget currently mapped to that button.
To change a mapping, select the desired widget from the list of widgets above and then click on the button of the controller to which you want to map it.
To un-map any widget, select the “[NONE]” widget from the list of available widgets, and assign it to the respective button.

Alt

In the top left corner of the image is a checkbox for the “Alt”-Key.
This is meant to be used in connection to the “Alt” Key widget.
The “Alt” Key widget allows you to add additional functions to your controller buttons, similar to how the Alt key on your keyboard allows defining and accessing hotkeys.
You will have to map the MARUI “Alt” key widget to one of your controller buttons to utilize this feature.

Then, while you are pressing the button on the controller to which you attached the Alt key widget, an alternative set of functions becomes available.
To define this alternative set of functions, check the “Alt” checkbox in the UI Layout Editor.
Then you can define the button/widget mappings that will be available when pressing the Alt key.

.

.

.

Custom Menus

In the second tab of the UI Layout Editor, you can create and edit your own menus:

The top part of the editor lists all the created menus.
To create a new menu, type in a name into the text field and press the “Create” button. It will then appear in the list above.
It will also appear in the list of widgets on the first tab of the UI Layout Editor, where you can map the new menu to any controller button. (See above).
Below the menu name, you can set an icon that will appear on the controller button to which the new menu is mapped. This can be either an image file on your hard disk or a Maya icon name (see Maya’s Shelf Editor for a list of available icons within Maya)

The lower part of the Custom Menu tab lists the menu element items.
To add a new item to your menu, type in a name (which will also be displayed as a Tooltip when hovering over the menu item), choose an icon (again, this can be an image file on your hard disk or a Maya icon name), enter the MEL or Python command you wish to associate with the menu item and press the “Create” button at the bottom of the editor. Alternatively to using a command, you can also set a different menu from the list to as a sub-menu that will open when you select this menu item.

By default, all menu items are automatically arranged in a circle. But if you which to change the position and scale of any menu item, you can fill in the “x”, “y”, “w”, and “h” numeric fields to override the position and width/height of each icon.

.

.

.

Custom Command Widgets

In the “Custom Command Widgets” tab, you can create widgets that directly respond to a button press on your controller. For example, you could implement a widget that duplicates the selected objects when you move them, or that fast-forwards the current time as you move the controller.

The top part of the editor lists all created command widgets.
To create a new command widget, type in a name in the “Name” field and press the “Create” button at the bottom of the editor. Then the new widget will be displayed in the list, and also in the list of widgets in the “Widget Mappings” tab where you can assign it to a controller button.
You can also choose an icon that will be displayed on the controller button to which the widget is assigned. (This can be an image file on your hard disk or a Maya icon name).
Command widgets offer four events, to each of which you can assign an action in the form of a MEL or Python command:
On Click: This event will occur if you briefly press and release the button to which the widget is attached.
On drag start: This event will occur if you hold down the button and start moving the controller.
While dragging: This event will occur while you are holding the button. The rate of execution depends on the speed of your VR system, but will usually be around 10 times per second.
On drag stop: This event will occur when you have been dragging and then release the button to which the widget is attached.

.

.

.

Custom Gesture Widgets

Gesture widgets are similar to Menu Widgets, but instead of displaying icons in a menu, you can execute any action with a small motion of the controller. For example you can create a widget that duplicates an object when you “wave” the controller from side to side or sets a new keyframe when you draw a small triangle.

The top part of the editor lists all the gesture widgets that were created.
To create a new gesture widget, enter a name in the “Name” field and press the “Create Widget” button. Then the new widget will be displayed in the list, and also in the list of widgets in the “Widget Mappings” tab where you can assign it to a controller button.
You can also choose an icon that will be displayed on the controller button to which the widget is assigned. (This can be an image file on your hard disk or a Maya icon name).
The lower part of the editor lists all the gestures known to the widget.
To create a new gesture, write a name in the “Gesture Name” field and the command (MEL or Python) to execute in the “Command” field and press “Create New Gesture”.
In order for MARUI to understand your gesture, it requires a number of example performances. Select a gesture from the list and press the “Record sample performances” button. The button will change it’s color to indicate that you are in recording mode. Then, press the controller button to which you have assigned this gesture widget, perform the gesture and release the button again. This will be recorded as one sample. For good results, you should perform the gesture at least 20 times at different speeds and directions.
For more details and guidelines on how to make efficient reliable gesture commands, please see the article on Gesture Recognition.
When you have recorded enough gestures, press the “Record sample” button again to stop recording mode, and press the “Learn gestures from recorded samples” button to start the training process. The button will change color to indicate that MARUI is now trying to learn how to understand your gesture. The recognition performance will be continuously updated throughout the process. When you are satisfied with the probability (percentage of correct identifications) you can press the “Learn gestures from recorded samples” button again to end the learning process. After learning is completed, you can use the new gesture widget by pressing the button to which you have attached it.

You can export and import gestures to files by pressing the “Export” and “Import” buttons.

.

.

.

Icons for Custom Menus, Custom Widgets, and Custom Gesture Widgets

When defining Custom Menus, Custom Widgets, or Custom Gesture Widgets as described above, you can define the icon that the widget will have in the layout. This can be one of the following:
(1) an image file on your hard drive (browse or insert the path to the image)
(2) the name of a Maya icon (you can find the names of all Maya icons in Maya’s “Shelf Editor”, by clicking on the “Browse Maya Icons” button next to the “Icon Name” field)
(3) the name of a Marui icon, as listed below:

icon_tool_select, icon_tool_move, icon_tool_rotate, icon_tool_scale, icon_tool_pivot, icon_tool_omni, icon_tool_quickdrag, icon_tool_other, icon_tool_options, icon_tool_options_dialog, icon_tool_options_softselect, icon_tool_options_symmetry, icon_tool_options_symmetry_x, icon_tool_options_symmetry_y, icon_tool_options_symmetry_z, icon_mode_vertex, icon_mode_edge, icon_mode_face, icon_mode_multi, icon_mode_localrotationaxis, icon_mode_nurbscomponents, icon_mode_curvepoint, icon_mode_editpoint, icon_mode_isoparm, icon_mode_hull, icon_mode_object, icon_rigging, icon_rigging_createjoints, icon_rigging_paintskinweights, icon_anim, icon_anim_playback_fwd, icon_anim_playback_bwd, icon_anim_playback_stop, icon_anim_prevframe, icon_anim_nextframe, icon_anim_prevkey, icon_anim_nextkey, icon_anim_setkey, icon_anim_delkey , icon_anim_togglebreakdown, icon_anim_autokey, icon_anim_ghosting, icon_anim_animeditor, icon_anim_eulerfilter, icon_anim_cutkey, icon_anim_copykey, icon_anim_pastekey, icon_anim_hik, icon_anim_playbackoptions, icon_anim_motionpathtool, icon_animeditor_keymove, icon_animeditor_keyscale, icon_animeditor_keydelete, icon_palette_nextbtn, icon_palette_prevbtn, icon_close, icon_minus, icon_next, icon_back, icon_undo, icon_redo, icon_duplicate, icon_repeatlast, icon_increasemanipsize, icon_decreasemanipsize, icon_shift, icon_shift_lock, icon_alt, icon_alt_lock , icon_ctrl, icon_ctrl_lock, icon_speech, icon_shelf, icon_hotbox, icon_viewcube, icon_levelscene, icon_ar, icon_save, icon_save_increment, icon_load, icon_povcamera, icon_camview, icon_groom, icon_zoom, icon_lock , icon_opacity, icon_key, icon_questionmark, icon_eyeside, icon_nav, icon_nav_disabled, icon_nav_grabair, icon_nav_tumble, icon_nav_joystick, icon_nav_teleport, icon_marui, icon_maruimenu, icon_time, icon_lightingrendering, icon_lightingrendering_materialnew, icon_lightingrendering_materialset, icon_snap, icon_snaptounits, icon_snaptopoints, icon_snaptocurves, icon_snaptomesh, icon_snaptojoints, icon_snaptozero, icon_snaptozero_x, icon_snaptozero_y, icon_snaptozero_z, icon_uilayouts, icon_cursoroffset, icon_interactionmode_eyeray, icon_interactionmode_proximity, icon_interactionmode_laserpointer, icon_box_checked, icon_box_unchecked, icon_box_option, icon_tutorial_help, icon_tutorial_skip, icon_tutorial_back, icon_tutorial_end, icon_tutorial_restart, icon_display, icon_display_setview, icon_display_setview_wholescene, icon_display_setview_selected, icon_display_setview_realup, icon_display_setview_realscale, icon_display_setview_groundfloor, icon_display_setview_translation, icon_display_setview_rotation, icon_display_setview_savepoints, icon_display_setview_savepoints_save, icon_display_setview_savepoints_load, icon_display_setview_savepoints_dialog, icon_display_setview_lock, icon_display_shading, icon_display_xray, icon_display_xray_joints, icon_display_xray_activecomponents, icon_display_lighting, icon_display_lookthroughselected, icon_display_hideobjects, icon_display_hideobjects_selected, icon_display_hideobjects_unselected, icon_display_hideobjects_unhidelast, icon_display_hideobjects_unhideall, icon_display_smoothness, icon_display_smoothness_off, icon_display_smoothness_wireframe, icon_display_smoothness_on, icon_display_smoothness_increase, icon_display_smoothness_decrease, icon_display_isolateselect, icon_selection , icon_selection_all, icon_selection_clear, icon_selection_invert, icon_selection_parent, icon_selection_child, icon_selection_grow, icon_selection_shrink, icon_selection_convert_toverts, icon_selection_convert_toedges, icon_selection_convert_tofaces, icon_selection_convert_tocontainedfaces, icon_selection_convert_toshell, icon_selection_convert_toshellborder, icon_selection_convert, icon_selection_extend_toedgering, icon_selection_extend_toedgeloop, icon_selection_extend_tofacepathlongitude, icon_selection_extend_tofacepathlatitude, icon_selection_extend, icon_object, icon_object_freezetransformations, icon_object_centerpivot, icon_object_groupandparent, icon_object_duplicate, icon_object_duplicatespecial, icon_object_delete, icon_window, icon_window_outliner, icon_window_layereditor, icon_windows_arrange, icon_windows_arrange_save, icon_windows_arrange_load, icon_nurbs, icon_nurbs_createcurve, icon_nurbs_editcurvetools, icon_nurbs_curveoperations, icon_nurbs_createsurface, icon_nurbs_surfaceoperations, icon_polygon, icon_polygon_create, icon_polygon_tools, icon_polygon_operations, icon_polygon_mesh, icon_polygon_normals, icon_transform, icon_transform_pivotswitch, icon_transform_rotate, icon_transform_rotate_x, icon_transform_rotate_y, icon_transform_rotate_z, icon_transform_rotate_p225, icon_transform_rotate_m225, icon_transform_rotate_p45, icon_transform_rotate_m45, icon_transform_rotate_p90, icon_transform_rotate_m90, icon_transform_rotate_180, icon_transform_align, icon_transform_align_x, icon_transform_align_y, icon_transform_align_z, icon_transform_flip, icon_transform_flip_x, icon_transform_flip_y, icon_transform_flip_z, icon_submenu_return, iconoverlay_options, icon_mic_mute, icon_fps_0, icon_fps_1, icon_fps_12, icon_fps_25, icon_fps_infinite, icon_mocap, icon_mocap_record, icon_mocap_attach_left, icon_mocap_attach_right, icon_gesture, icon_freezetracking, icon_present

If no icon is specified, the name of the custom widget or menu will be turned into an icon.

.

.

.

Saving, loading, and resetting UI layouts

At the bottom of the UI Layout Editor window you will find buttons to safe and load your UI layouts.
MARUI stores the UI layouts (along with your custom widgets) as a MEL script named “MARUI_UI_layouts.mel” in your Maya “prefs” folder.
This folder is usually located at
C:\Users\<your name>\Documents\maya\<maya version>\prefs
for example, for a user named “John” and Maya version 2018, this folder would be:
C:\Users\John\Documents\maya\2018\prefs

Upon loading the MARUI plug-in, it will try to find an existing ui layouts file and load it.
Thus your UI layouts (including your custom widgets) will be automatically restored every time you load MARUI.

If you want to reset your UI layouts to the MARUI defaults, find the “MARUI_UI_layouts.mel” file in your Maya prefs/ folder and delete it.