Constructor
new L3D.Graph(o)
Create a new Graph.
o |
Object | options to configure the Graph with. |
Extends
Properties
- Overrides:
If the node is set as bypass, it will not be computed but instead will return data from the first compatible input.
- Overrides:
If the node is disabled, it will not be computed.
- Overrides:
If the node is enabled, it will be computed normally.
- Overrides:
The graph this node belongs to.
- Overrides:
The unique identifier of the object. Changing a node's ID can have unintended consequences.
- Overrides:
The list of inputs for the node.
- Overrides:
Is the engine currently playing the scene?
- Overrides:
The name of the object.
- Overrides:
The node's x position in the graph.
- Overrides:
The node's y position in the graph.
The list of nodes in the graph.
- Overrides:
The type of the node, as registered in the GraphManager.
- Overrides:
The number of inputs for the node.
- Overrides:
The number of outputs for the node.
- Overrides:
Fired when the object has been modified.
- Overrides:
Fired when the object's name changes.
- Overrides:
The list of outputs for the node.
If true, the nodes in the graph are read-only and can only be edited with referenceEdits.
- Overrides:
The scene the graph belongs to.
- Overrides:
Flags and other data for the node.
- Overrides:
If true, the node will be invalidated before every update, forcing the nodes outputs to be recomputed.
- Overrides:
The title of the node
Methods
addInput(name, defaultValue, type, options) → nullable NodeInput
- Overrides:
Add an input property to the node.
name |
* | String name, or NodeInput to directly add. |
defaultValue |
* | |
type |
* | If type is an Object, then it is the options, and the type is implied from the default value. If type is null, it is implied from the default value. Otherwise, if type is a string, it is an explicit declaration of the input's type. |
options |
Object | Optional configuration for the input. Possible options are: {bool} isColor The Editor should tread this property as a color. {bool} noLabel The Editor should not display the label for this property. {String} label The label the Editor should use instead of the name. {bool} noConnections The property does not allow connections. It will not be displayed on the node graph node. {bool} isInt The number property should be treated as an integer. {number} min The minimum value of the property. {number} max The maximum value of the property. {number} precision The number of decimal places the Editor shows. {number} step The increment value to use for the number spinner in the Editor. {bool} disabled The Editor control should be shown as disabled. {Map,Array} enum The property should be treated as an enum by the Editor, and these are the strings (and associated values, if a Map) to allow the user to choose from. |
addNode(node)
Add a node to the graph
node |
GraphNode | The node to add |
addOutput(name, type, options) → nullable NodeOutput
- Overrides:
Add an output to the node.
name |
String | The name of the output. This must be unique within the node. |
type |
String | The data type of the output. If type is null, it is dynamic. If type is an Object, it is the options and type is considered dynamic. |
options |
Object | Optional configuration for the output. Possible options are: {bool} noLabel Don't display the label for the output. {bool} noConnections Don't display a label or a connector for this output. |
attachCanvas(canvas)
Associate an Editor canvas with the graph, so that any changes to the graph can be communicated to the Editor.
canvas |
GraphView | The editor graph view. |
change()
Called when something visually changed. This will notify the editor.
clear()
Delete all nodes from the graph.
clearError()
- Overrides:
Remove any error messages from the node.
clone(options) → Object
- Overrides:
Creates a clone of this object.
options |
Object | Options for the clone method. |
- Object
collapse(force)
- Overrides:
Collapse the node to make it smaller on the canvas.
force |
bool |
configure(info)
- Overrides:
Configure the graph from serialized JSON data
info |
Object |
connectionChanged()
- Overrides:
Called when an input has been connected or disconnected.
createSceneObjects(scene)
Call the createSceneObjects method for all nodes.
scene |
Scene |
detachCanvas(The)
Detach a canvas from the graph.
The |
GraphView | editor graph view. |
findNodeById(id) → nullable GraphNode
Find a node given it's ID. This will also search sub-graphs.
id |
String |
getDynamicType() → String
- Overrides:
Get the type of a dynamic output
- String
getInput(name) → nullable NodeInput
- Overrides:
Find the input with the given name.
name |
String |
getOutput(name) → nullable NodeOutput
- Overrides:
Fidn the output with the given name.
name |
String |
getPropertyInfo(path) → Object
- Overrides:
Get information about a particular property of this object.
path |
String |
- Object
getTypeFromData(data) → String
- Overrides:
Get the implicit property type for a given data.
data |
* |
- String
initialize(options)
- Overrides:
Called by the constructor for the node implementation to add any inputs, outputs, and other initialization it wants to do.
options |
Object |
initializeAudioNode(options)
- Overrides:
Configure the node as an AudioNode, using object MixIns instead of class inheritance.
options |
Object |
initializeBehaviorNode(options)
- Overrides:
Configure the node as an BehaviorNode, using object MixIns instead of class inheritance.
options |
Object |
initializeConstraintNode(options)
- Overrides:
Configure the node as a ConstraintNode, using object MixIns instead of class inheritance.
options |
Object |
initializeGeometryNode(options)
- Overrides:
Configure the node as a GeometryNode, using object MixIns instead of class inheritance.
options |
Object |
initializeImageCompositeNode(options)
- Overrides:
Configure the node as an ImageFilterNode, using object MixIns instead of class inheritance.
options |
Object |
initializeImageFilterNode(options)
- Overrides:
Configure the node as an ImageFilterNode, using object MixIns instead of class inheritance.
options |
Object |
initializeImageNode(options)
- Overrides:
Configure the node as an ImageNode, using object MixIns instead of class inheritance.
options |
Object |
initializeParticleNode(options)
- Overrides:
Configure the node as an ParticleNode, using object MixIns instead of class inheritance.
options |
Object |
initializeSceneNode(options)
- Overrides:
Configure the node as a SceneNode, using object MixIns instead of class inheritance.
options |
Object |
initializeTransformNode(options)
- Overrides:
Configure the node with transformation properties.
options |
Object |
mouseMove(e)
Called by the InputManger when the mouse moves.
e |
Event | The MouseEvent from the browser |
removeNode()
Remove the node from the graph
removeOutput(name)
- Overrides:
Remove an output from the node.
name |
String |
renameInput(input, newName)
- Overrides:
Rename an input property.
input |
NodeInput | |
newName |
String |
renameOutput(output, newName)
- Overrides:
Rename an output property.
output |
NodeOutput | |
newName |
String |
sendActionToCanvas(action, params)
Call a method on the canvases rendering this graph.
action |
String | The name of the method. |
params |
Array | Optional arguments to call the function with. |
sendActionToNodes(action, params)
Call a method on all nodes in this graph.
action |
String | The name of the method |
params |
Array | Optional arguments to call the function with. |
serialize() → Object
- Overrides:
Serialize the graph to a JSON structure.
- Object
The serialized graph
setDependency(input, output)
- Overrides:
Define an explicit dependency between an input and an output, so that when an input is changed, it only dirties specific outputs in the case when the node has multiple outputs.
input |
NodeInput | NodeOutput | Can be a NodeInput or NodeOutput |
output |
NodeOutput |
setDirty(from, fromShaderUniform)
- Overrides:
Mark the node as dirty.
from |
NodeInput | The input that caused the node to be dirty. |
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. |
setError(message)
- Overrides:
Set an error message for the node.
message |
String |
setModified()
- Overrides:
Fires the objects onModified signal.
setNodePosition(x, y)
- Overrides:
Set the node's position in the graph.
x |
number | |
y |
number |
timeChanged()
- Overrides:
Called before an update when timeDependent is true.
toJSON() → Object
- Overrides:
Serialize the object to a JSON structure
- Object
The serialized version of the object.
updateMaterial(material)
- Overrides:
Called to allow shader nodes to update uniform values for the material
material |
Material |
validateInputs()
- Overrides:
Called to ensure the node has valid input connections.