Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

workspaceControl [-actLikeMayaUIElement boolean] [-checksPlugins boolean] [-close] [-closeCommand script] [-collapse boolean] [-defineTemplate string] [-dockToControl string string] [-dockToMainWindow string boolean] [-dockToPanel string string boolean] [-duplicatable boolean] [-exists] [-floating boolean] [-height] [-heightProperty string] [-horizontal boolean] [-initCallback string] [-initialHeight int] [-initialWidth int] [-label string] [-layoutDirectionCallback string] [-loadImmediately boolean] [-minimumHeight int] [-minimumWidth int] [-raise] [-requiredControl string] [-requiredPlugin string] [-resizeHeight int] [-resizeWidth int] [-restore] [-retain boolean] [-stateString string] [-tabPosition string boolean] [-tabToControl string int] [-uiScript script] [-useTemplate string] [-visible boolean] [-visibleChangeCommand script] [-width] [-widthProperty string] [name]

workspaceControl is undoable, queryable, and editable.

Creates and manages the widget used to host windows in a layout that enables docking and stacking windows together.

Return value

stringFull path name to the control.

In query mode, return type is based on queried flag.

Flags

actLikeMayaUIElement, checksPlugins, close, closeCommand, collapse, defineTemplate, dockToControl, dockToMainWindow, dockToPanel, duplicatable, exists, floating, height, heightProperty, horizontal, initCallback, initialHeight, initialWidth, label, layoutDirectionCallback, loadImmediately, minimumHeight, minimumWidth, raise, requiredControl, requiredPlugin, resizeHeight, resizeWidth, restore, retain, stateString, tabPosition, tabToControl, uiScript, useTemplate, visible, visibleChangeCommand, width, widthProperty
Long name (short name) Argument types Properties
-actLikeMayaUIElement(-alm) boolean createqueryedit
Controls whether or not this workspace control acts like Maya UI Elements such as the Shelf and the Tool Box.
For example, this hides the tab bar and shows a toolbar grip on the end of the control to allow undocking.
-checksPlugins(-cp) boolean createedit
Sets whether the UI (as defined by the uiScript) checks the loaded state of one or more plug-ins in its code. The UI will not be loaded until the auto-loading of plug-ins is complete. Default value is false.
-close(-cl) edit
Closes the workspace control.
-closeCommand(-cc) script createedit
Command that gets executed when the workspace control is closed.
-collapse(-clp) boolean createqueryedit
Collapse or expand the tab widget parent of the workspace control.
-defineTemplate(-dt) string create
Puts the command in a mode where any other flags and arguments are parsed and added to the command template specified in the argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set as the current template.
-dockToControl(-dtc) string string createedit
Dock this workspace control next to the given control. The first argument is the control name, the second is dock position relative to the control (valid values are: "left", "right", "top", "bottom").
-dockToMainWindow(-dtm) string boolean createedit
Dock this workspace control into the main window. The first argument is the dock position along the sides of the main window (valid values are: "left", "right", "top", "bottom"), the second specifies whether the control should be tabbed into the first control found at the dock position.
-dockToPanel(-dtp) string string boolean createedit
Dock this workspace control into the workspace docking panel that the given workspace control is in. The first argument is the control name, the second is dock position along the sides of the panel (valid values are: "left", "right", "top", "bottom"), the third specifies whether the control should be tabbed into the first control found at the dock position.
-duplicatable(-dup) boolean createqueryedit
Controls whether or not this workspace control can be duplicated.
The default duplicate state is controlled by whether or not the panel is unique. Unique panels cannot be duplicated or copied. Workspace controls without a panel also cannot be duplicated, unless specifically set as such using this flag.
-exists(-ex) create
Returns whether the specified object exists or not. Other flags are ignored.
-floating(-fl) boolean createqueryedit
Whether the workspace control is floating.
-height(-h) query
Query only flag returning the current height of the control.
-heightProperty(-hp) string createqueryedit
Set height property of the workspace control. Valid values are:
  • fixed - Cannot be resized manually and will not be given any extra space while maximizing/dynamically resizing
  • preferred - Can be resized manually but will not be given any extra space while maximizing/dynamically resizing
  • free - Can be resized manually and will be given extra space while maximizing/dynamically resizing

Default: free In query mode returns the current height property of the workspace control.
-horizontal(-hr) boolean createqueryedit
Orientation of the control. This flag is true by default, which corresponds to a horizontally oriented widget.
Note: currently only "Toolbox" and "Shelf" support a vertical orientation.
-initCallback(-ic) string createqueryedit
Adds a mel command to be executed when the control is added to the layout. The command should be a mel proc and it will be called with the workspaceControl name as parameter. The mel command should take the form:

global proc callbackName(string $workspaceControlName)

If "save" is appended to the command name, it will be called during the layout save.

global proc callbackNameSave(string $workspaceControlName)

-initialHeight(-ih) int createedit
The initial height of the workspace control when first shown.
-initialWidth(-iw) int createedit
The initial width of the workspace control when first shown.
-label(-l) string createqueryedit
The label text. The default label is the name of the workspace control.
-layoutDirectionCallback(-ldc) string createqueryedit
Set a mel procedure to be called when the control changes orientation. The procedure is called with argument 1 for horizontal and 0 for vertical.
-loadImmediately(-li) boolean createedit
Sets whether the UI (as defined by the uiScript) will be built immediately on workspace control creation (true) or delayed until the control is actually shown (false). Default value is false.
-minimumHeight(-mh) int createqueryedit
Sets the minimum height of control to the given value.
  • If given value is 0 (False), minimum height is set to 0.
  • If given value is 1 (True), minimum height is set to initial height.
  • If given value is greater than 1, minimum height is set to the given value.
In query mode returns current minimum height of the control.
-minimumWidth(-mw) int createqueryedit
Sets the minimum width of control to the given value. This flag parameter was changed from bool to int in 2018 and old settings are still respected according to the following.
  • If given value is 0 (False), minimum width is set to 0.
  • If given value is 1 (True), minimum width is set to initial width.
  • If given value is greater than 1, minimum width is set to the given value.
In query mode returns current minimum width of the control.
-raise(-r) queryedit
Raises a workspace control to the top and makes it active. In Query mode, this flag will return whether the workspace control is active or not. Note that this flag won't raise a control if is minimized or collapsed. Use the flag -rs/restore instead.
-requiredControl(-rc) string createeditmultiuse
The name of a workspace control that needs to be open in order for this workspace control to properly function. This workspace control will not be created if the required control is not open, and will be closed when the required control is closed.
-requiredPlugin(-rp) string createeditmultiuse
The name of a plug-in that needs to be loaded in order to build the workspace control UI.
-resizeHeight(-rsh) int edit
Resizes a floating workspace control's height to the given value.
-resizeWidth(-rsw) int edit
Resizes a floating workspace control's width to the given value.
-restore(-rs) createedit
Restores the control according to the following rules:
  • If collapsed then the control will be expanded
  • If hidden then the control will be shown
  • If minimized then the control will be restored
  • If the control is an inactive tab into a tab group then it will become the active tab
-retain(-rt) boolean create
Sets whether the workspace control is retained (i.e. only hidden) or deleted when closed. Default value is true.
-stateString(-ss) string createqueryedit
String containing the state of the control. Can be used with the initCallback flag.
-tabPosition(-tp) string boolean createqueryedit
Changes the tab position. The possible values are: "north", "east" and "west". The boolean value, if set to true, changes the tab positions of all the controls in the parent widget. If it is not set, only the current control will get its position changed. A control can have a different orientation than the tab widget. If the control tab position is different from the tab widget's one, the tab position will be changed when the control becomes the only control in the tab widget. On query, only the control's tab position will be returned, not the tab widget's position. They may differ.
-tabToControl(-ttc) string int createedit
Tab this workspace control into the given control. The first argument is the control name, the second is the index position within the containing tab widget (invalid values mean append).
-uiScript(-ui) script createedit
The specified script will be invoked to build the UI of the workspaceControl. This is a required flag.
-useTemplate(-ut) string create
Forces the command to use a command template other than the current one.
-visible(-vis) boolean createqueryedit
The visible state of the workspace control. A control is created visible by default. If the control is created as not visible, the control will be created in a closed state. To make it appear, edit the control to set the flags floating or the flag visible to true. Use -r/raise flag to get the active status of a control as this flag will return true when the control is minimized or collapsed.
-visibleChangeCommand(-vcc) script createedit
Command that gets executed when visible state of the workspace control changes.
-width(-w) query
Query only flag returning the current width of the control.
-widthProperty(-wp) string createqueryedit
Set width property of the workspace control. Valid values are:
  • fixed - Cannot be resized manually and will not be given any extra space while maximizing/dynamically resizing
  • preferred - Can be resized manually but will not be given any extra space while maximizing/dynamically resizing
  • free - Can be resized manually and will be given extra space while maximizing/dynamically resizing

Default: free In query mode returns the current width property of the workspace control.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

global proc createCustomWorkspaceControlUI()
{
	columnLayout;
	button;
	button;
	button;
}

workspaceControl -retain false -floating true -uiScript "createCustomWorkspaceControlUI();" myCustomWorkspaceControl;