uiBuilder Help

1: Overview

2: Getting Started

3: Creating Butons

4: Working with your UI

5: Setup multiple interfaces

6: Menu Bar

7: Controls



1: Overview

This script builds an interface that can select controls of your rig. This means you can hide all your control curves in the viewport and animate almost directly with the geometry.

The uiBuilder will only work with Maya 2014 or higher.


2: Getting started

Execute the “uiBuilder.mel” in Maya. The easiest way to do this is to simply drag and drop the file into the viewport. In the uiBuilder window, choose “File → New” and set the name and location for your UI. Click “Save” and your UI file will open.

Next, you should set the title and background image, by using “Modify → Set Title” and “Modify → Set background Image”.

Open your rig in Maya. The rig file should not be imported or referenced, so that all objects have their “real” names, without any namespace or prefix.


3: Creating Buttons

Place the button with the sliders at the top and right in the uiBuilder. The button in the top right corner mirrors the position. The button can also be placed with Middle Mouse Drag. Hold Shift to constrain the movement in one direction. Hold Ctrl to also set the button size while dragging.

Click the button in the uiBuilder to toggle the previewbuttons visibility in your UI.

There are 4 options for the buttons: Tool, Size, Color, and Label.

Tool will change the the tool whenever the button is clicked to either “Move”, “Rotate” or “Scale”. If you choose “none” the tool will not change when the button is clicked. You can also disable the tool changing in the interface by deactivating the “change tool” checkbox in your interface.

Size will resize your button. There are 3 preset sizes but you can also choose a custom size with the width and height fields next to the preset buttons.

Use the colorslider to change the color of your button or pick one of the three presets. By rightclicking the preset buttons you can save the current slider-color as a preset.

To display a label on the button simply type it into the label textfield.

Select one or more objects in your scene that should be selectable with the button. Click the big “create” button in the lower left corner to finish the button creation. Your UI will update and show the new button. It should already be working now. The UI-preview-button is hidden, to display it click the preview button in the uiBuilder again.


4: Working with your UI

When you’re done adding buttons, close the uiBuilder for you don’t need it anymore. Hide your control curves in the viewport and use the buttons in the Interface to select them. You can shift-click a button to toggle selections, ctrl-click to subtract selections and shift-ctrl-click to add selections just as you would in the viewport.

By right-clicking a button a small menu opens. You can set Keyframes for translate, rotate and sale, or for all keyable attributes of the objects connected to the button. This will only set Keys for this buttons objects, not any shift-selected objects. To Key all selected objects just use the normal shortcuts as always :)

When working with references the buttons won’t work on their own. In that case type the namespace into the namespace field and everything will work again.

To use the Interface on another computer just make sure that the background image is in the right folder.


5: Setup multiple interfaces

If you create two (or more) interfaces and try to use both files at the same time each Window will close the other. To use multiple windows you need to change the title in the “Modify” menu and prefix in the “Advanced” tab. To change the Title simply click “Modify → Set Title” and enter a unique Title. To change the Prefix activate the checkbox “change Prefix” in the “Advanced” tab. A small window will open. If this isn’t the first time you work with a new window just click “OK” and go ahead (In this case the textfield should automatically set itself to the correct prefix). If it is the first time you work on an extra Interface click “setup file for new prefix” in this window. This will again open a little window. Here you can search and replace the whole source text of your UI file. Just replace the old prefix (default is “XXX_”) with a prefix of your choice.


6: Menu Bar


  • File → New

Create a new UI file. Warning: If you navigate to an existing script file here, its content will be completely overwritten with an empty UI.


  • File → Open

Open an existing UI File created with the uiBuilder. The prefix, button name and background image should automatically update. If not a warning will appear. In this case please set the textfileds manually ind the “Advanced” and “File Management” Tabs.


  • File – Close

Close the uiBuilder.


  • Edit – Undo

Undo the last change in the UI file. This will not undo any changes in the uiBuilder! Only three undo steps are available.


  • Edit – Redo

Redo the last change in the UI file. Only Available after undo.


  • Edit – Auto Clear Label

Clear the “label” textfield (Basic Tab) after the a new button is created.


  • Edit – Auto Clear Comment

Clear the “comment” textfield (Advanced Tab) after the a new button is created.


  • Modify – Set Background Image

Choose a background image for the UI. If the image is in one of Mayas default image paths, it will be saved with a relative path, so the UI can be used on other computers. To see Mayas default image paths execute: getenv “XBMLANGPATH”


  • Modify – Set Title

Choose a title for the UI Window. If the UI file is used as Dock Control (see: Modify → Use UI As Dock Control), this title will also be the tab title when the UI is docked into the main Maya window. If you use multiple UIs at once, each should have a unique title! For multiple Interfaces, also check “prefix” in the “Advanced” Tab.


  • Modify – Place Namespace Field

Place the textfield “Namespace” at the current Positon of the Previewbutton.


  • Modify – Place Tool Checkbox

Place the checkbox “change tools” at the current Positon of the Previewbutton.


  • Modify – Place Both

Place the textfield “Namespace” at the current Positon of the Previewbutton and the checkbox “change tools” right below it.


  • Modify – Set Default Namespace

Set the default namespace in the textfield “Namespace” to its current content.


  • Modify – Set Tool Box Default

Set the default Value for the checkbox “change tools” to its current Value.


  • Modify – Use UI As Dock Control

Change the window type of the interface to “dockControl”. This allows to dock the Interface into the left or right side of the main Maya window (like the channelbox).


  • Modify – Use UI As Window

Change the window Type of the interface to a normal window. This is the default for new UIs.


  • Layout – Keep Docked

Keep the UI inside the uiBuilder after it is reloaded (for example: when a new button is created).


  • Layout – Dock UI

Dock the UI into the uiBuilder window.


  • Layout – Undock UI

Undock the UI from the uiBuilder and show it as normal window


  • Layout – Hide Previewbutton

Keep the previewbutton un the UI hidden after reload. The button will still be visible in the uiBuilder window. The previewbuttons visibility can always be toggled by clicking the button in the uiBuilder.


  • Basic Tab – Tool

Choose a tool for the new button. This is selected when the button is clicked and the checkbox “change tools” is enabled. If the tool is set to “none”, the current tool will not be changed when the button is clicked, even when the checkbox “change tools” is enabled.


  • Basic Tab – Size

Change the size of the new button. Either use one of the three presets or enter width and height in pixels. The button size can also be changed with CTRL + Middle Mouse Drag in the UI or the uibuilder preview.


  • Basic Tab – Color

Set the Color for the new button. Either use one of the three presets of choose a color with the colorslider. Colors from the colorslider can be assigned to the preset buttons Right Click on the preset button.


  • Basic Tab – Label

Set the label for the new button. If you want to create multiple buttons with the same label, you should disable “Auto Clear Label Field” in the “Edit” menu.


  • Advanced Tab – Prefix

Set a prefix for all buttons. This should only be changed when you need to use multiple UIs at once. To change the prefix, enable the the checkbox “change Prefix”. A window appears. Choose “setup File For New Prefix” and enter the old and new prefix.


  • Advanced Tab – Name

The name for the button in the script file. This is updated automatically. Change the name only if errors appear that tell you to. To edit an exiting button, enter the button name into the textfield above the edit button. To see the name of an existing button hover the mouse over it, the name will appear as annotation.


  • Advanced Tab – Comment

If you are familiar with MEL you may want to edit the Interface further after you finished your work with the uiBuilder. In that case it’s a good idea to add some comments into the code for clarity.

To add a comment activate it with the checkbox next to “comments”. The textfield is now editable. Type a comment for the button you create in that field. No special characters (such as //) are required. The comment will be added into the script when you create the button.

If you edit a button the comment will be added at the line where the button is edited.

Deactivate the checkbox and no comment will be added. There’s no need to empty the textfield.

By checking “empty line” an empty line will be added into the code before the comment and button are written.


  • File Management Tab – Script File

The current UI file. Same as “File → Open”, just clicking “OK” will reload the Interface.


  • File Management Tab – Image File

The background image of the UI. Same es “Modify → Set Background Image”.