NodeInput

An input property of a node.

Constructor

new L3D.NodeInput(name, type, defaultValue, node, o)

Parameters
name String

The name of the input, must be unique within the node.

type String

The type of the input.

defaultValue *

The default value of the input.

node GraphNode

The node this input belongs to.

o Object

Optional configuration for the input.

Properties

connection *

The NodeOutput, or array of NodeOutputs, this input is connected from, if any.

connectionCount int

The number of connections to this input.

data *

The data stored by this input

dataSource Object

A dataSource is used to dynamically provide the data of the input via dataSource.getInput and dataSource.setInput methods.

defaultValue *

The initial value of the input, used to restore the data if the input is disconnected.

fullType String

The type of the input without trying to resolve dynamic types.

hasArrayConnection bool

Does this input have multiple connections?

hasConnection bool

Does this input have a connection

id String

The unique identifier of the input.

isBuiltin bool

If true, the input is part of the node class. If false, it was dynamically added to the node.

name String

The name of the input, which must be unique within the node.

type String

The type of the input. Dynamic types "*" will attempt to be resolved by the type of data connected to it.

Methods

canConnectFrom(output) → bool

Determines if this node can be connected from the given output.

Parameters
output NodeOutput
Returns
bool

configure(info)

Configure the node with the given data.

Parameters
info Object

connectFrom(output, index)

Connect to this input from a given output.

Parameters
output NodeOutput
index int

The specific index of an array to connect to.

disconnect(from)

Disconnect any connections to this input.

Parameters
from NodeOutput

Optional output to disconnect from. If null, then all connections will be disconnected.

get(context) → *

Get the value of the input.

Parameters
context *
Returns
*

getConnection(index) → nullable NodeOutput

Returns the output this input is connected from. If it's an array connection, then it returns the connection at the given index.

Parameters
index int
Returns
NodeOutput

isConnectedTo(from, index) → bool

Check to see if this input is connected to the given output.

Parameters
from NodeOutput

The NodeOutput to check.

index int

If set, check for a connection with a specific array index

Returns
bool

True if this input is connected to the given output.

set(value)

Set the value of the input.

Parameters
value *

setDirty(fromShaderUniform)

Marking the input as dirty will dirty the node and propogate the dirty state up the graph.

Parameters
fromShaderUniform bool

If the dirty propagation was originated from a shader uniform output. This is used by Material nodes to avoid invalidating shader data unnecessarily causing shaders to be regenerated when a uniform value changes.