Function NodeMaterialParseFromSnippetAsync
-
NodeMaterialParseFromSnippetAsync(
this: void | typeof NodeMaterial,
snippetId: string,
scene?: Scene,
rootUrl?: string,
nodeMaterial?: NodeMaterial,
skipBuild?: boolean,
waitForTextureReadyness?: boolean,
urlRewriter?: (url: string) => string,
options?: Partial<INodeMaterialOptions>,
): Promise<NodeMaterial>Parameters
- this: void | typeof NodeMaterial
- snippetId: string
defines the snippet to load
- scene: Scene = ...
defines the hosting scene
- rootUrl: string = ""
defines the root URL to use to load textures and relative dependencies
OptionalnodeMaterial: NodeMaterialdefines a node material to update (instead of creating a new one)
- skipBuild: boolean = false
defines whether to build the node material
- waitForTextureReadyness: boolean = false
defines whether to wait for texture readiness resolving the promise (default: false)
OptionalurlRewriter: (url: string) => stringdefines a function used to rewrite urls
Optionaloptions: Partial<INodeMaterialOptions>defines options to be used with the node material
Returns Promise<NodeMaterial>
a promise that will resolve to the new node material
Creates a node material from a snippet saved by the node material editor