Defining Shader UI Controls with SPDL

By default, parameters are assigned controls based on their type (specified by the type keyword in the Parameter section).

Type | Default control
Boolean |
String |
Float, Integer |

You can also display bitmaps in the property page.

In the Defaults section, you can explicitly specify one of the following UI controls for parameters:

• Color Sliders

• Boolean Parameters

• Radio Buttons

• Check Boxes

• Combo Boxes

• Number Controls

• Matrix

• Vector (3D)

| FCurve and GridData type parameters are not supported for SPDL properties; however, you can specify an input connection from a Custom Property as an alternative to having its own parameters.

Color Sliders

Parameters of type color use the color widget control on the property page.

    PropertySet <propertyset_name>
    {
       Parameter <parameter_name> input
       {
           Name = <parameter_name>;
           Guid = "{24810490-56FF-11D2-BF23-00A0C982CE5D}";
           type = color;
           value = 1.0 1.0 1.0 0.0;
       }
    }

    Defaults
    {
       color
       {
           UIType = "RGBA",4;
       }
    }
    END

| For information about how the Custom Property API creates color controls, see RGB Color Control and RGBA Color Control.

Boolean Parameters

Parameters of type VT_BOOL are automatically given a check box:

    PropertySet <propertyset_name>
    {
       Parameter <parameter_name> input
       {
           ...
           type = boolean;
           ...
       }

| The Custom Property API uses Check Box controls to represent boolean values.

Radio Buttons

Lists of options where only one is selectable (exclusive) correspond to radio button controls:

The syntax for specifying a set of radio buttons is:

    Defaults
    {
       <parameter_name>
       {
           UIType = "Radio";
           UIAttr = Exclusive;
           Items
           {
              "Item 1" = 0
              "Item 2" = 1
              "Item 3" = 2
           }
    }

| In this example the UIType line is optional because when you specify a list of items without UIType and the UIAttr is set to Exclusive you get radio buttons instead of check boxes.

| For information about how the Custom Property API creates radio button controls, see Radio Buttons.

Check Boxes

Lists of options where more than one is selectable correspond to check box controls:

The syntax for specifying a set of check boxes is:

    Defaults
    {
       <parameter_name>
       {
           UIType = "Check";
           Items
           {
              "Item 1" = 0
              "Item 2" = 1
              "Item 3" = 2
           }
       }
    }

| In this example the UIType line is optional because when you specify a list of items without UIType and the UIAttr does not contain the Exclusive value, you get check boxes (the default list control).

| The Custom Property API uses Bitfield controls to represent masks of integers, which is probably closer to the SPDL check box control than Check Boxes which represent boolean values.

Combo Boxes

Lists of options displayed in a drop-down box (usually suited to long lists) correspond to combo box controls:

The syntax for defining a combo box is:

    Defaults
    {
       <parameter_name>
       {
           UIType = "Combo";
           Items
           {
              "Item 1" = 0
              "Item 2" = 1
              "Item 3" = 2
           }
       }

| For information about how the Custom Property API creates combo box controls, see Combo/Drop-Down Box.

Number Controls

Numeric parameters (integers, floats, doubles, etc.) correspond to a standard numeric slider:

The number control supports several attributes to control its appearance and behavior:

Attribute Name | Description
Log | True to use logarithmic number control. Default is False
SyncSlider | True to update the number control while the slider moves. Default is True.
NumbEdit | True to hide display only the number control (no slider). Default is False
Sign | True to display + and - signs for negative and positive values. Default is False
Decimals | Number of decimal places to display or 0 for integer values. Default is 3

The syntax for defining a number control is:

    Defaults
    {
       <parameter_name>
       {
           UIType = "Number"
           {
              Log = True;
              SyncSlider = True;
              NumbEdit = True;
              Sign = True;
              Decimals = 5;
           }
       }

| For information about numeric controls in the Custom Property API, see Numeric Controls.

Matrix

Matrix parameters are available only with SPDL files (there is no equivalent control for Custom Properties).

If you want to embed the SRTTexture widget in the layout instead of the mini-kinestate default (translation, rotation and scaling sliders for each of the X, Y and Z axes), use this syntax: "UIType = "SRTTexture.SRTTexture.1";"

    Defaults
    {
       <parameter_name>
       {
           UIType = "SRTTexture.SRTTexture.1";
       }
    }

| The Custom Property API does not support the Matrix control.

Vector (3D)

Vector parameters are available only with SPDL files (there is no equivalent control for Custom Properties). By default, this type of parameter will appear as three numeric sliders (X, Y and Z) in the UI:

If you want the vector parameter to appear as a single control, use this syntax: "UIType = "vector";"

    Defaults
    {
       <parameter_name>
       {
           UIType = "vector";
           UIRange = 0.0 to 1.0 by 0.001;
       }
    }

| The Custom Property API does not support the Vector control.

Displaying Bitmaps

You can attach a UI custom control to a parameter to display a bitmap using a path where the bitmap file path name can be either an absolute or relative path (relative to the spdl directory).

The only type of bitmap files supported is the BMP image file. The path name must use "/" rather than "\". The bitmap file name must include the file name extension.

    UIType = "BitmapWidget"
    {
       path = "Pictures/b.bmp";
    }

The bitmap will be displayed in the parameter value field.

| The parameter value is not accessible through the property page, but you can get and set it through scripting.

| For information about how the Custom Property API manages bitmap widgets, see Bitmap Widget.

Autodesk Softimage v7.5