Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make scene param optional for NodeMaterial.ParseFromSnippetAsync #12592

Merged
merged 1 commit into from
May 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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