Skip to content

Commit

Permalink
Make scene param optional for NodeMaterial.ParseFromSnippetAsync (#12592
Browse files Browse the repository at this point in the history
)

Make scene param optional for NodeMaterial.ParseFromSnippetAsync

Forum: https://forum.babylonjs.com/t/make-scene-param-optional-for-nodematerial-parsefromsnippetasync/30747
  • Loading branch information
BlakeOne authored May 27, 2022
1 parent 74dfd2e commit e60f59f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/dev/core/src/Materials/Node/nodeMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,13 @@ export class NodeMaterial extends PushMaterial {
* @param skipBuild defines whether to build the node material
* @returns a promise that will resolve to the new node material
*/
public static ParseFromSnippetAsync(snippetId: string, scene: Scene, rootUrl: string = "", nodeMaterial?: NodeMaterial, skipBuild: boolean = false): Promise<NodeMaterial> {
public static ParseFromSnippetAsync(
snippetId: string,
scene: Scene = EngineStore.LastCreatedScene!,
rootUrl: string = "",
nodeMaterial?: NodeMaterial,
skipBuild: boolean = false
): Promise<NodeMaterial> {
if (snippetId === "_BLANK") {
return Promise.resolve(this.CreateDefault("blank", scene));
}
Expand Down

0 comments on commit e60f59f

Please sign in to comment.