Editor Data

A reference guide for editor data common properties and types.

Common Properties

displayname

A human-readable description of the property. displayname is used by all field types, except button (which uses label).

Defaults to "" if not explicitly specified.

property

Binds property assignments to node[property]. This property is always required for fields that are assignable. property is not used for fields that exist solely for display purposes (e.g. sectionTitle).

type

Type determines the kind of field that is generated by EditorData and is always required. A list of valid types is shown below.

Types

This section describes the different types of input fields supported by Editor Data.

button

Buttons are used to call methods on a VWF node. The presentation of these buttons is equivalent to HTML button elements. Buttons do not use the displayname property.

Properties

label

Virtually equivalent to displayname and is used in the exact same way. If label is omitted, method is displayed in its place.

method

The name of the method to call. (Required)

Example

1
2
3
4
5
6
7
{
    "fetchData": {
        "type": "button",
        "label": "Fetch Live Data",
        "method": "fetchData"
    }
}

check

check is visually and functionally identical to HTML checkbox input fields.

Return type: boolean

Properties

No additional properties.

Example

1
2
3
4
5
6
7
{
    "light": {
        "type": "check",
        "property": "lightState",
        "displayname": "Turn light on?",
    }
}

choice

The choice property type is used to make a selection from a dropdown menu. choice is visually and functionally identical to HTML select elements.

Return type: String

Properties

values

An array of selectable items intended to appear within the generated drop-down menu. (Array) (Required)

labels

An array of human-readable names that correspond to each value in the values array. (Array)

Example

1
2
3
4
5
6
7
8
9
{
    "emitterType": {
        "type": "choice",
        "property": "emitterType",
        "displayname": "Emitter Type",
        "labels": ["Box", "Sphere", "Point"],
        "values": ["box", "sphere", "point"]
    }
}

color

The color type generates a color picker.

Return type: RGBA Array

Properties

No additional properties.

Example

1
2
3
4
5
6
7
{
    "specular": {
        "type": "color",
        "property": "specularColor",
        "displayname": "Specular",
    }
}

label

Displays a line of text.

Properties

No additional properties.

example

1
2
3
4
5
6
{
    "someLabel": {
        "type": "label",
        "displayname": "Just a label"
    }
}

map

The map type is an image picker. The URL of the image is assigned to the bound property.

Return type: String

Properties

No additional properties.

Example

1
2
3
4
5
6
7
{
    "image": {
        "type": "map",
        "property": "imageURL",
        "displayname": "Choose Image"
    }
}

nodeid

Quickly assign an arbitrary node’s id.

Return type: String

Properties

No additional properties.

Example

1
2
3
4
5
6
7
{
    "someTarget": {
        "type": "nodeid",
        "property": "target",
        "displayname": "Look at"
    }
}

prompt

Properties

No additional properties.

Example

1
2
3
4
5
6
7
{
    "userId": {
        "type": "prompt",
        "property": "user",
        "displayname": "Enter your username"
    }
}

slider

Properties of type slider are represented as a slider alongside a number HTML input field.

Return type: number

Properties

min

The lower bound of the slider. This setting has no effect on manual entries by the user into an input box. (number) (Required)

max

The upper bound of the slider. This setting has no effect on manual entries by the user into an input box. (number) (Required)

step

Minimum increment value for both the slider and the number input field. Defaults to 1 if not specified. (number)

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "height": {
        "type": "slider",
        "property": "objectHeight",
        "displayname": "Height",
        "min": 1,
        "max": 10,
        "step": 1
    }
}

rangeslider

Properties

min

The lower bound of the slider. This setting has no effect on manual entries by the user into an input box. (number) (Required)

max

The upper bound of the slider. This setting has no effect on manual entries by the user into an input box. (number) (Required)

step

Minimum increment value for both the slider and the number input field. Defaults to 1 if not specified. (number)

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "spin": {
        "type": "rangeslider",
        "property": ["minSpin", "minSpin", "maxSpin"],
        "displayname": "Spin: (min - max)",
        "min": -20,
        "max": 20,
        "step": 0.1
    }
}

sectionTitle

(String)

Properties

No additional properties.

Example

1
2
3
4
5
6
{
    "section": {
        "type": "sectionTitle",
        "displayname": "Start of a new section"
    }
}

text

Properties

No additional properties.

Example

1
2
3
4
5
6
7
{
    "name": {
        "type": "text",
        "property": "name",
        "displayname": "What is your name?",
    }
}

vector

Properties

step

(Optional)

Example

1
2
3
4
5
6
7
8
{
    "spawnPoint": {
        "type": "vector",
        "property": "spawnPoint",
        "displayname": "Spawn Location",
        "step": 0.1
    }
}

rangevector

Properties

step

(Optional)

Example

1
2
3
4
5
6
7
8
{
    "acceleration": {
        "type": "rangevector",
        "property": ["minAcceleration", "maxAcceleration"],
        "displayname": "Acceleration",
        "step": 0.001
    }
}