Documentation - Maxscript

< Back to main maxscript documentation

UI_Panel : Helper


The UI_Panel is a system that allows the creation and display of different custom user interface controls (UI Controls) that can be used to manipulate different elements in scene, specially useful for character rigging.

It has pickers that can be used to select objects. It has sliders, spinners, 2d sliders and 2d spinners that can be used to animate parameters in the scene. It has action buttons that execute customized commands. It has toggle buttons to turn off and on parameters in the scene. And it also has other type of UI controls like images, groups, and group selections.

All these different kind of UI Controls can be created in the UI Panel manager dialog window, where the user can define their position and size interactively. The controls will be stored in the UIPanel helper, and there can be several different UIPanels in the scene, each one can be accessed in different tabs in the UI Panel manager after being opened there before.


Methods

OpenUIPanelManager()

Opens the UI Panel Manager.

UIPanel()

Creates an UIPanel in the scene.


UI_Panel Properties

<UI_Panel>.size WorldUnits

Get/set the size of the display of the UI Panel helper.

<UI_Panel>.uiControls MaxObject Array

This array contains the list of UI Controls in the UI Panel.

<UI_Panel>.scroll Point2

Used internally.


UI_Panel Methods

<void> <UI_Panel>.OpenInManager()

Opens this UI Panel in the UI Panel Manager.

<void> <UI_Panel>.CloseInManager()

Closes this UI Panel in the UI Panel Manager.

<integer> <UI_Panel>.NumControls()

Returns the number of UI Controls in the UI Panel.

<maxObject array> <UI_Panel>.AddSelectedNodes <point2>pos [select:<boolean>]

Adds the selected nodes in the scene to the UI Panel as UI Pickers. The UI Pickers will be returned as an array.

<maxObject> <UI_Panel>.AddGroupSelection <point2>pos [select:<boolean>]

Creates a group selection UI Control with the selected UI Control of this UI Panel.

<maxObject> <UI_Panel>.AddGroup <point2>pos [select:<boolean>]

Creates a group UI Control around the selected UI Controls of this UI Panel.

<maxObject> <UI_Panel>.AddControl <enum>type <point2>pos [select:<boolean>]

Adds a UI Control of the specified type to this UI Panel. The type parameter can be one of the following:

#Group
#GroupSelect
#Image
#Picker
#Toggle
#Action
#HorizontalSlider
#VerticalSlider
#DiagonalSlider
#2DSlider
#HorizontalSpinner
#VerticalSpinner
#DiagonalSpinner
#2DSpinner

<maxObject> <UI_Panel>.GetControlType <index>index

Returns the type of the specified UI Control.

<void> <UI_Panel>.DeleteSelectedControls()

Deletes the selected UI Controls in this UI Panel.

<void> <UI_Panel>.DeleteControl <index>index

Deletes the specified UI Control in this UI Panel.

<void> <UI_Panel>.SelectControls <integer array>indices <boolean>clearSel

Select the specified UI Controls in this UI Panel.

<void> <UI_Panel>.DeselectControls <integer array>indices

Deselect the specified UI Controls in this UI Panel.

<void> <UI_Panel>.CallActions <integer array>indices

Executes the action script of the specified UI Controls in this UI Panel.

<void> <UI_Panel>.OpenSelectedActionDlg()

Opens the "Set Script" dialog of the selected UI Action in this UI Panel.

<integer> <UI_Panel>.GetSelectedControlsCount()

Returns the number of selected UI Controls in this UI Panel.

<void> <UI_Panel>.TransformSelectedControls <enum>transform_type

Transform the selected UI Controls (Alignment, Mirror, Arrange). The transform type can be one of the following:

#AlignHorizontal
#AlignVertical
#MatchSize
#MatchWidth
#MatchHeight
#LayoutHorizontal
#LayoutVertical
#MirrorHorizontal
#MirrorVertical
#MirrorHorizontalLocal
#MirrorVerticalLocal
#BringToFront
#SendToBack


<integer> <UI_Panel>.DuplicateSelectedControls()

Duplicate the selected UI Controls in this UI Panel.

<integer> <UI_Panel>.DuplicateSelectedControls()

Duplicate the selected UI Controls in this UI Panel.

<void> <UI_Panel>.SetControlsPositionSize <integer array>indices <float array>xPositions <float array>yPositions <float array>xSizes <float array>ySizes
<void> <UI_Panel>.SecondaryAction <integer array>indices
<void> <UI_Panel>.SetControlsValues <integer array>indices <float array>values1 <float array>Values2
<void> <UI_Panel>.SetSelectedControlsParam <integer array>indices <value>paramValue
<void> <UI_Panel>.SetSelectedControlsToDefault()
<void> <UI_Panel>.GetControlsIDs <&integer array>IDs
<void> <UI_Panel>.GetControlsParams <&integer array>indices <&integer array>paramIDs <&string array>values
<void> <UI_Panel>.GetAnimatedParams <&integer array>indices <&integer array>paramIDs <&string array>values
<void> <UI_Panel>.GetChangedParams <&integer array>indices <&integer array>paramIDs <&string array>values
<void> <UI_Panel>.GetSelectedControlsParam <integer>paramID <&integer>count <&boolean>different
<integer> <UI_Panel>.SetControlSelection()
<integer> <UI_Panel>.ShowSelectedInTrackView()

These methods are used internally.


UIControl Properties

The UIControl can be accessed with the .uiControls array in the UI Panel.

These properties are accessible to all the types of UI Controls (UIGroup, UIGroupSelect, UIImage, UIPicker, UIToggle, UIAction, UISlider, UI2DSlider, UISpinner, UI2DSpinner)

<UIControl>.label String
<UIControl>.color Color
<UIControl>.position Point2
<UIControl>.size Point2
<UIControl>.selected Boolean

UIGroup Properties

There are no additional properties accessible for UIGroup controls.

UIGroupSelect Properties

<UIGroupSelect>.controls_to_select MaxObject array

UIImage Properties

<UIImage>.image Filename

UIPicker Properties

<UIPicker>.node Node

UIToggle Properties

<UIToggle>.state Boolean

UISlider Properties

<UISlider>.type Index
<UISlider>.value Float
<UISlider>.value_min Float
<UISlider>.value_max Float
<UISlider>.joystick_radius Float
<UISlider>.display_label Boolean
<UISlider>.display_value Boolean
<UISlider>.default Float

UI2DSlider Properties

<UI2DSlider>.x_value Float
<UI2DSlider>.y_value Float
<UI2DSlider>.x_value_min Float
<UI2DSlider>.x_value_max Float
<UI2DSlider>.y_value_min Float
<UI2DSlider>.y_value_max Float
<UI2DSlider>.joystick_radius Float
<UI2DSlider>.display_label Boolean
<UI2DSlider>.display_value Boolean
<UI2DSlider>.x_default Float
<UI2DSlider>.y_default Float

UISpinner Properties

<UISpinner>.type Index
<UISpinner>.value Float
<UISpinner>.scale Float
<UISpinner>.display_label Boolean
<UISpinner>.display_value Boolean
<UISpinner>.default Float

UI2DSpinner Properties

<UI2DSpinner>.x_value Float
<UI2DSpinner>.y_value Float
<UI2DSpinner>.x_scale Float
<UI2DSpinner>.y_scale Float
<UI2DSpinner>.display_label Boolean
<UI2DSpinner>.display_value Boolean
<UI2DSpinner>.x_default Float
<UI2DSpinner>.y_default Float

UIAction Properties

<UIAction>.script String
<UIAction>.variables String Array
<UIAction>.references MaxObject Array
<UIAction>.constants String Array
<UIAction>.sub_anim_nums Integer
<UIAction>.description String

UIAction Methods

<void> <UIAction>.RunScript()

Executes the script stored in this UIAction.

<boolean> <UIAction>.AddConstant <string>name <string>value

Adds a constant variable to the UIAction. Corresponds to the "Create" and"Assign Constant" buttons in the Set script dialog. A constant variable returns the value of the MAXScript expression assigned to it. The expression can be any valid MAXScript expression that evaluates to a value.

The first argument is the name of the constant variable.
The second argument is the expression to be assigned to the variable.

Returns true on success, false on failure.

<boolean> <UIAction>.SetConstant <value>which <string>value

Sets the constant variable value.

The first argument is either the name of the variable as string, or the index of the variable as integer.
The second argument is the MAXScript expression providing the value.

<string> <UIAction>.GetConstant <value>which

Returns the value of the expression assigned to the constant variable specified by name or index.

<boolean> <UIAction>.AddTarget <string>name <value>target [owner:<maxObject>]

Adds a target variable to the UIAction. Corresponds to the "Create" and "Assign Track" buttons in the Set script dialog.

The first argument is the name of the target variable.
The second argument is the Track value to be assigned to the target variable.
The optional Owner: keyword argument can be used to define the owner of the Track.

Returns true on success, false on failure.

<boolean> <UIAction>.SetTarget <value>which <value>target [owner:<maxObject>]

Sets a target variable specified by name or index in the first argument to the target (subAnimtrack) value specified by the second argument. Corresponds to the "Assign Track" buttons in the Set script dialog.

The optional Owner: keyword argument can be used to define the owner of the subAnim track.

Returns true on success, false on failure.

<value> <UIAction>.GetTarget <value>which [asObject:<boolean>]

Returns the reference target stored in the target variable specified by name or index in the first argument.

If the optional asObject: keyword argument is supplied and is true, the return value will be converted from a subAnim to a MAXObject.

<void> <UIAction>.PickTarget()

Opens the track view pick target dialog box.

<boolean> <UIAction>.AddObject <string>name <value>object

Adds an object variable to the UIAction. Corresponds to the "Create" and "Assign Controller" buttons in the Set script dialog.

The first argument is the name of the object variable.

The second argument is the Controller to be assigned to the object variable.

Returns true on success, false on failure.

<boolean> <UIAction>.SetObject <value>which <value>object

Sets the object variable specified by name or index in the first argument to the controller object value specified by the second argument.

Returns true on success, false on failure.

<value> <UIAction>.GetObject <value>which

Returns the reference target stored in the target variable specified by name or index in the first argument.

If the optional asObject: keyword argument is supplied and is true, the return value will be converted from a subAnim to a MAXObject.

<void> <UIAction>.PickObject()

Opens the track view pick object dialog box.

<boolean> <UIAction>.AddNode <string>name <value>node

Adds a node variable to the UIAction. Corresponds to the "Create" and "Add Node" buttons in the Set Script dialog.

A node variable contains a reference to a scene node. Since the reference is name-independent, changing the name of the node stored in the variable does not affect the functioning of the UIAction.

The first argument is the name of the node variable.
The second argument is the scene node to be assigned to the variable.

Returns true on success, false on failure.

<boolean> <UIAction>.SetNode <value>which <value>node

Sets a given node variable to the specified scene node value. Returns true on success, false on failure.

<node> <UIAction>.GetNode <value>which

Returns the scene node value stored in the specified node variable.

<void> <UIAction>.PickNode()

Opens the track view pick node dialog box.

<boolean> <UIAction>.DeleteVariable <value>which

Deletes the user-defined variable specified by name or index.

Returns true on success, false on failure.

<boolean> <UIAction>.NumVariables()

Returns the number of variables defined in the UIAction.

<boolean> <UIAction>.variableExists <string>name

Returns true if the given variable name exists in the UIAction, false if it does not exist.

<string> <UIAction>.GetName <index>index

Returns the name of the indexed variable.

<boolean> <UIAction>.RenameVariable <value>which <string>name

Renames the variable specified by name or index in the first argument to the name specified by the second argument.

Returns true on success, false on failure.

<index> <UIAction>.GetIndex <string>name

Returns the index of the variable specified by name.

<index> <UIAction>.GetDescription <value>which

Used internally.

<void> <UIAction>.OpenDlg()

Opens the UIAction set script dialog box.



< Back to main maxscript documentation