@babylonjs/core 5.17.0 → 5.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -452,9 +452,10 @@ export declare class NodeMaterial extends PushMaterial {
452
452
  * @param scene defines the hosting scene
453
453
  * @param rootUrl defines the root URL for nested url in the node material
454
454
  * @param skipBuild defines whether to build the node material
455
+ * @param targetMaterial defines a material to use instead of creating a new one
455
456
  * @returns a promise that will resolve to the new node material
456
457
  */
457
- static ParseFromFileAsync(name: string, url: string, scene: Scene, rootUrl?: string, skipBuild?: boolean): Promise<NodeMaterial>;
458
+ static ParseFromFileAsync(name: string, url: string, scene: Scene, rootUrl?: string, skipBuild?: boolean, targetMaterial?: NodeMaterial): Promise<NodeMaterial>;
458
459
  /**
459
460
  * Creates a node material from a snippet saved by the node material editor
460
461
  * @param snippetId defines the snippet to load
@@ -1326,7 +1326,7 @@ var NodeMaterial = /** @class */ (function (_super) {
1326
1326
  if (rootUrl === void 0) { rootUrl = ""; }
1327
1327
  return __awaiter(this, void 0, void 0, function () {
1328
1328
  return __generator(this, function (_a) {
1329
- return [2 /*return*/, NodeMaterial.ParseFromFileAsync(url, rootUrl, this.getScene())];
1329
+ return [2 /*return*/, NodeMaterial.ParseFromFileAsync("", url, this.getScene(), rootUrl, true, this)];
1330
1330
  });
1331
1331
  });
1332
1332
  };
@@ -1602,9 +1602,10 @@ var NodeMaterial = /** @class */ (function (_super) {
1602
1602
  * @param scene defines the hosting scene
1603
1603
  * @param rootUrl defines the root URL for nested url in the node material
1604
1604
  * @param skipBuild defines whether to build the node material
1605
+ * @param targetMaterial defines a material to use instead of creating a new one
1605
1606
  * @returns a promise that will resolve to the new node material
1606
1607
  */
1607
- NodeMaterial.ParseFromFileAsync = function (name, url, scene, rootUrl, skipBuild) {
1608
+ NodeMaterial.ParseFromFileAsync = function (name, url, scene, rootUrl, skipBuild, targetMaterial) {
1608
1609
  if (rootUrl === void 0) { rootUrl = ""; }
1609
1610
  if (skipBuild === void 0) { skipBuild = false; }
1610
1611
  return __awaiter(this, void 0, void 0, function () {
@@ -1612,7 +1613,7 @@ var NodeMaterial = /** @class */ (function (_super) {
1612
1613
  return __generator(this, function (_a) {
1613
1614
  switch (_a.label) {
1614
1615
  case 0:
1615
- material = new NodeMaterial(name, scene);
1616
+ material = targetMaterial !== null && targetMaterial !== void 0 ? targetMaterial : new NodeMaterial(name, scene);
1616
1617
  return [4 /*yield*/, scene._loadFileAsync(url)];
1617
1618
  case 1:
1618
1619
  data = _a.sent();