Class NodeParticleSystemSet
Properties
attached Blocks
Gets an array of blocks that needs to be serialized even if they are not yet connected
comment
A free comment about the set
editor Data
Gets or sets data used by visual editor
name
The name of the set
on Build Observable
Observable raised when the particle set is built
snippet Id
Snippet ID if the material was created from the snippet server
StaticEditor URL
Define the Url to load node editor script
StaticSnippet Url
Define the Url to load snippets
Accessors
input Blocks
-
Gets the list of input blocks attached to this material
Returns ParticleInputBlock[]
an array of InputBlocks
system Blocks
-
Gets the system blocks
Returns SystemBlock[]
Methods
build Async
-
Builds the particle system set from the defined blocks.
Parameters
- scene: Scene
defines the hosting scene
- verbose: boolean = false
defines whether to log detailed information during the build process (false by default)
Returns Promise<ParticleSystemSet>
a promise that resolves to the built particle system set
- scene: Scene
clear
-
Clear the current node particle set
Returns void
clone
-
Makes a duplicate of the current particle system set.
Parameters
- name: string
defines the name to use for the new particle system set
Returns NodeParticleSystemSet
the cloned particle system set
- name: string
dispose
-
Disposes the resources
Returns void
edit Async
-
Launch the node particle editor
Parameters
Optionalconfig: INodeParticleEditorOptionsDefine the configuration of the editor
Returns Promise<void>
a promise fulfilled when the node editor is visible
get Block By Name
-
Get a block by its name
Parameters
- name: string
defines the name of the block to retrieve
Returns NodeParticleBlock | null
the required block or null if not found
- name: string
get Block By Predicate
-
Get a block using a predicate
Parameters
- predicate: (block: NodeParticleBlock) => boolean
defines the predicate used to find the good candidate
Returns NodeParticleBlock | null
the required block or null if not found
- predicate: (block: NodeParticleBlock) => boolean
get Class Name
-
Gets the current class name of the node particle set e.g. "NodeParticleSystemSet"
Returns string
the class name
get Input Block By Predicate
-
getInputBlockByPredicate(
predicate: (block: ParticleInputBlock) => boolean,
): Nullable<ParticleInputBlock>Get an input block using a predicate
Parameters
- predicate: (block: ParticleInputBlock) => boolean
defines the predicate used to find the good candidate
Returns Nullable<ParticleInputBlock>
the required input block or null if not found
- predicate: (block: ParticleInputBlock) => boolean
parse Serialized Object
-
Clear the current graph and load a new one from a serialization object
Parameters
- source: any
defines the JSON representation of the particle set
- merge: boolean = false
defines whether or not the source must be merged or replace the current content
Returns void
- source: any
remove Block
-
Remove a block from the current system set
Parameters
- block: NodeParticleBlock
defines the block to remove
Returns void
- block: NodeParticleBlock
serialize
-
Serializes this node particle set in a JSON representation
Parameters
OptionalselectedBlocks: NodeParticleBlock[]defines the list of blocks to save (if null the whole node particle set will be saved)
Returns any
the serialized particle system set object
set To Default
-
Clear the current set and restore it to a default state
Returns void
StaticCreate Default
-
Creates a new node particle set set to default basic configuration
Parameters
- name: string
defines the name of the particle set
Returns NodeParticleSystemSet
a new NodeParticleSystemSet
- name: string
StaticParse
-
Creates a node particle set from parsed data
Parameters
- source: any
defines the JSON representation of the particle set
Returns NodeParticleSystemSet
a new node particle set
- source: any
StaticParse From File Async
-
ParseFromFileAsync(
name: string,
url: string,
nodeParticleSet?: NodeParticleSystemSet,
): Promise<NodeParticleSystemSet>Creates a node particle set from a snippet saved in a remote file
Parameters
- name: string
defines the name of the node particle set to create
- url: string
defines the url to load from
OptionalnodeParticleSet: NodeParticleSystemSetdefines a node particle set to update (instead of creating a new one)
Returns Promise<NodeParticleSystemSet>
a promise that will resolve to the new node particle set
- name: string
StaticParse From Snippet Async
-
ParseFromSnippetAsync(
snippetId: string,
nodeParticleSet?: NodeParticleSystemSet,
): Promise<NodeParticleSystemSet>Creates a node particle set from a snippet saved by the node particle editor
Parameters
- snippetId: string
defines the snippet to load
OptionalnodeParticleSet: NodeParticleSystemSetdefines a node particle set to update (instead of creating a new one)
Returns Promise<NodeParticleSystemSet>
a promise that will resolve to the new node particle set
- snippetId: string
Defines a set of particle systems defined as a node graph. NPE: #K6F1ZB#1 PG: #ZT509U#1