API

Class NodeGeometry

Defines a node based geometry

Index
attachedBlocks: NodeGeometryBlock[] = []

Gets an array of blocks that needs to be serialized even if they are not yet connected

comment: string

A free comment about the geometry

editorData: any = null

Gets or sets data used by visual editor

name: string

The name of the geometry

onBuildObservable: Observable<NodeGeometry> = ...

Observable raised when the geometry is built

outputBlock: Nullable<GeometryOutputBlock> = null

Gets or sets the GeometryOutputBlock used to gather the final geometry data

snippetId: string

Snippet ID if the material was created from the snippet server

EditorURL: string = ...

Define the Url to load node editor script

SnippetUrl: string = Constants.SnippetUrl

Define the Url to load snippets

  • Build the final geometry. Please note that the geometry MAY not be ready until the onBuildObservable is raised.

    Parameters

    • verbose: boolean = false

      defines if the build should log activity

    • updateBuildId: boolean = true

      defines if the internal build Id should be updated (default is true)

    • autoConfigure: boolean = false

      defines if the autoConfigure method should be called when initializing blocks (default is false)

    Returns void

  • Clear the current graph and load a new one from a serialization object

    Parameters

    • source: any

      defines the JSON representation of the geometry

    • merge: boolean = false

      defines whether or not the source must be merged or replace the current content

    Returns void

  • Creates a node geometry from a snippet saved by the node geometry editor

    Parameters

    • snippetId: string

      defines the snippet to load

    • OptionalnodeGeometry: NodeGeometry

      defines a node geometry to update (instead of creating a new one)

    • skipBuild: boolean = false

      defines whether to build the node geometry

    Returns Promise<NodeGeometry>

    a promise that will resolve to the new node geometry