< Previous | Contents | Next >

Inputs and Outputs

Next to the MainInput and MainOutputs there are other Inputs and Outputs. If Inputs are not hidden they can be represented as an Input control in the properties view. Still the underlying DataType might be the same. For example a Number DataType might be accessible through a slider control, a Checkbox, a DropdownList, a Multibutton etc.

To query the underlying DataType of an Input, use inp:GetAttrs(“INPS_DataType”).

To query the underlying DataType of an Output use outp:GetAttrs(“OUTS_DataType”).

A control allows users to change the corresponding value of the underlying DataType in the properties view. An optional preview control allows to change the value directly in the Viewer.

In scripting the value on an Input can be changed directly with an assignment, by using an index that represents a specific time or by using tool:SetInput(“InputName”, value, [time]).

Specifying the time only makes sense the input is animated as shown later. Only simple DataTypes like integers, float, and strings are supported.


image


image

Merge1.Angle = 10

-- Sets Angle to 10

Merge1.Angle[5] = 20

-- Sets Angle to 20 on frame 5

Merge1:SetInput(“Angle”, 20, 5)

-- Same as above

Consider the following example:




image

print(Merge1.Angle)

-- Gets the Angle input handle

print(Merge1.Angle[TIME_UNDEFINED])

-- Gets the Angle value

print(Merge1.Angle[5])

-- Gets Angle on frame 5

-- Same as above

Merge1:GetInput(“Angle”, 5)

To get a value of a given Input use:

Please note that you cannot use Merge1.Angle to retrieve a value as this will return the Input handle.