Class NodeGeometry
Hierarchy
- NodeGeometry
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Creates a new geometry
Parameters
name: string
defines the name of the geometry
Returns NodeGeometry
Properties
attached BlocksSearch playground for attachedBlocks
Gets an array of blocks that needs to be serialized even if they are not yet connected
commentSearch playground for comment
A free comment about the geometry
editor DataSearch playground for editorData
Gets or sets data used by visual editor
nameSearch playground for name
The name of the geometry
on Build ObservableSearch playground for onBuildObservable
Observable raised when the geometry is built
output BlockSearch playground for outputBlock
Gets or sets the GeometryOutputBlock used to gather the final geometry data
snippet IdSearch playground for snippetId
Snippet ID if the material was created from the snippet server
Static EditorURLSearch playground for EditorURL
Define the Url to load node editor script
Static Snippet UrlSearch playground for SnippetUrl
Define the Url to load snippets
Accessors
build Execution Time
Gets the time spent to build this block (in ms)
Returns number
Methods
buildSearch playground for build
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
clearSearch playground for clear
Clear the current geometry
Returns void
cloneSearch playground for clone
Makes a duplicate of the current geometry.
Parameters
name: string
defines the name to use for the new geometry
Returns NodeGeometry
create MeshSearch playground for createMesh
disposeSearch playground for dispose
Disposes the ressources
Returns void
editSearch playground for edit
Launch the node geometry editor
Parameters
Optional config: INodeGeometryEditorOptions
Define the configuration of the editor
Returns Promise<void>
a promise fulfilled when the node editor is visible
generate CodeSearch playground for generateCode
Generate a string containing the code declaration required to create an equivalent of this geometry
Returns string
a string
get Block By NameSearch playground for getBlockByName
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 Block By PredicateSearch playground for getBlockByPredicate
Get a block using a predicate
Parameters
predicate: ((block: NodeGeometryBlock) => boolean)
defines the predicate used to find the good candidate
Parameters
block: NodeGeometryBlock
Returns boolean
Returns null | NodeGeometryBlock
the required block or null if not found
get Class NameSearch playground for getClassName
Gets the current class name of the geometry e.g. "NodeGeometry"
Returns string
the class name
get Input BlocksSearch playground for getInputBlocks
Gets the list of input blocks attached to this material
Returns GeometryInputBlock[]
an array of InputBlocks
parse Serialized ObjectSearch playground for parseSerializedObject
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 BlockSearch playground for removeBlock
Remove a block from the current geometry
Parameters
block: NodeGeometryBlock
defines the block to remove
Returns void
serializeSearch playground for serialize
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
set To DefaultSearch playground for setToDefault
Clear the current geometry and set it to a default state
Returns void
update MeshSearch playground for updateMesh
Static Create DefaultSearch playground for CreateDefault
Creates a new node geometry set to default basic configuration
Parameters
name: string
defines the name of the geometry
Returns NodeGeometry
a new NodeGeometry
Static ParseSearch playground for Parse
Creates a node geometry from parsed geometry data
Parameters
source: any
defines the JSON representation of the geometry
Returns NodeGeometry
a new node geometry
Static Parse From Snippet AsyncSearch playground for ParseFromSnippetAsync
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
Defines a node based geometry
demo at https://playground.babylonjs.com#PYY6XE#69