RSX Code Reference
    Preparing search index...

    Class GraphNode

    The GraphNode class represents a base-class of a node in a Graph. It contains GraphPin instances that can be connected to other nodes. The node can be enabled in a graph by calling Graph#addNode. The node can be disabled by calling Graph#removeNode.

    Typically, subclasses are required to add actual functionality to the graph, such as executing logic or processing data.

    Hierarchy (View Summary)

    Index
    • get customName(): string

      The custom name for the node.

      Returns string

      By default, names should be inferred from the GraphNodeReflection data. Only set this field if the name cannot or should not be inferred from reflection data.

    • set customName(value: string): void

      Parameters

      • value: string

      Returns void

    • get id(): UUID

      The ID.

      Returns UUID

    • get userData(): Map<string, any>

      A map suitable for storing custom user-defined data.

      Returns Map<string, any>

    • Removes all connections to this node.

      Returns void

    • Gets a pin that supports a connection to (or from) the otherPin.

      Parameters

      • otherPin: GraphPin

        The pin to find a compatible pin for.

      Returns GraphPin

      The first pin that matches the connection criteria.

      The orientation of the test depends on the type of the otherPin. The input pin denotes the type that must be supported by the output pin in the form

      	`outputPin isSubclassOf inputPin`
      
    • The internal field value used as automatic value storage for templated nodes.

      Parameters

      Returns any

    • Gets the value for the specified user data key. If the key does not exist the defaultValue will be returned instead. If no defaultValue is specified, undefined is returned.

      Type Parameters

      • T

      Parameters

      • node: GraphNode
      • key: string

        A key that uniquely identifies the property to be fetched.

      • OptionaldefaultValue: T

        The default value, to be returned in case the property is not defined.

      Returns T

      The user defined property or defaultValue if not defined.

    • Virtual

      Determines if the specified pin is valid for the given type.

      Parameters

      Returns boolean

    • Iterates all connections to pins of this node. First input pins are iterated over, then output pins.

      Returns Generator<GraphPin>

    • Virtual

      Invoked when the node was cloned, invoked after invoking GraphPin#onClone.

      Returns void

    • Called when the node has been instanced and is about to be added to a graph. This is a good place to initialize the default values for the node pins as it will then not be done during deserialization, which might otherwise discard newly instances values immediately.

      Returns void

    • Virtual

      Called when the Graph is being enabled or when the node is added to the graph via Graph#addNode />

      Returns void

    • Called before the node is removed from a graph.

      Returns void

    • Invoked when serialization begins by the owning Graph.

      Returns void

    • Removes the user data key.

      Parameters

      • key: string

      Returns void

    • Sets the user data key to the specified value.

      Type Parameters

      • T

      Parameters

      • key: string

        A key that uniquely identifies the property to be defined.

      • value: T

        The value to set the property to. The value type must support serialization.

      Returns void

    • Synchronizes the node pins with the reflection data by adding missing pins and removing superfluous pins on the node.

      Returns void

    • Returns a string representation of an object.

      Returns string

    • Virtual

      Ensures that the state of the node is valid.

      Parameters

      Returns GraphValidationStatus

      Implementing classes must call super. The method is typically called after deserialization or major edits to the graph. If validation fails, error information must be added to the validationStatus map.

    • Invokes the callback while prevent events to be dispatched.

      Parameters

      • callback: () => void

      Returns void

    An event when the node is dirtied.