Options
All
  • Public
  • Public/Protected
  • All
Menu

Defines a node based geometry

see

demo at https://playground.babylonjs.com#PYY6XE#69

Hierarchy

  • NodeGeometry

Index

Constructors

  • Creates a new geometry

    Parameters

    • name: string

      defines the name of the geometry

    Returns NodeGeometry

Properties

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

Gets or sets data used by visual editor

see

https://nge.babylonjs.com

name: string

The name of the geometry

onBuildObservable: Observable<NodeGeometry>

Observable raised when the geometry is built

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

Define the Url to load snippets

Accessors

  • get buildExecutionTime(): number
  • Gets the time spent to build this block (in ms)

    Returns number

Methods

  • build(verbose?: boolean, updateBuildId?: boolean, autoConfigure?: boolean): void
  • Build the final geometry

    Parameters

    • Optional verbose: boolean

      defines if the build should log activity

    • Optional updateBuildId: boolean

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

    • Optional autoConfigure: boolean

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

    Returns void

  • clear(): void
  • Clear the current geometry

    Returns void

  • Makes a duplicate of the current geometry.

    Parameters

    • name: string

      defines the name to use for the new geometry

    Returns NodeGeometry

  • Creates a mesh from the geometry blocks

    Parameters

    • name: string

      defines the name of the mesh

    • Optional scene: Nullable<Scene>

      The scene the mesh is scoped to

    Returns Nullable<Mesh>

    The new mesh

  • dispose(): void
  • Disposes the ressources

    Returns void

  • Launch the node geometry editor

    Parameters

    Returns Promise<void>

    a promise fulfilled when the node editor is visible

  • generateCode(): string
  • Generate a string containing the code declaration required to create an equivalent of this geometry

    Returns string

    a string

  • Get a block by its name

    Parameters

    • name: string

      defines the name of the block to retrieve

    Returns null | NodeGeometryBlock

    the required block or null if not found

  • Get a block using a predicate

    Parameters

    Returns null | NodeGeometryBlock

    the required block or null if not found

  • getClassName(): string
  • Gets the current class name of the geometry e.g. "NodeGeometry"

    Returns string

    the class name

  • Gets the list of input blocks attached to this material

    Returns GeometryInputBlock[]

    an array of InputBlocks

  • parseSerializedObject(source: any, merge?: boolean): void
  • Clear the current graph and load a new one from a serialization object

    Parameters

    • source: any

      defines the JSON representation of the geometry

    • Optional merge: boolean

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

    Returns void

  • Remove a block from the current geometry

    Parameters

    Returns void

  • Serializes this geometry in a JSON representation

    Parameters

    • Optional saveMeshData: boolean

      defines a boolean indicating that mesh data must be saved as well

    • Optional selectedBlocks: NodeGeometryBlock[]

      defines the list of blocks to save (if null the whole geometry will be saved)

    Returns any

    the serialized geometry object

  • setToDefault(): void
  • Clear the current geometry and set it to a default state

    Returns void

  • Creates a mesh from the geometry blocks

    Parameters

    • mesh: Mesh

      the mesh to update

    Returns false | Mesh

    True if successfully updated

  • Creates a new node geometry set to default basic configuration

    Parameters

    • name: string

      defines the name of the geometry

    Returns NodeGeometry

    a new NodeGeometry

  • Creates a node geometry from parsed geometry data

    Parameters

    • source: any

      defines the JSON representation of the geometry

    Returns NodeGeometry

    a new node geometry

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

    Parameters

    • snippetId: string

      defines the snippet to load

    • Optional nodeGeometry: NodeGeometry

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

    • Optional skipBuild: boolean

      defines whether to build the node geometry

    Returns Promise<NodeGeometry>

    a promise that will resolve to the new node geometry

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static property
  • Static method

Settings

Theme