@babylonjs/node-editor 6.0.0 → 6.2.0

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.
@@ -50660,6 +50660,20 @@ class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
50660
50660
  const pointName = newDefaultInput.name;
50661
50661
  const emittedNodeData = newDefaultInput.data;
50662
50662
  pointA = emittedNodeData.getPortByName(pointName);
50663
+ if (!pointA) {
50664
+ for (let i = 0; i < emittedNodeData.outputs.length; i++) {
50665
+ const output = emittedNodeData.outputs[i];
50666
+ const outputData = output.data;
50667
+ const outputBlockType = outputData._blockType;
50668
+ if (outputBlockType === pointB.data._blockType) {
50669
+ pointA = output;
50670
+ break;
50671
+ }
50672
+ }
50673
+ if (!pointA) {
50674
+ return;
50675
+ }
50676
+ }
50663
50677
  if (!emittedNodeData.isInput) {
50664
50678
  nodeA = this.props.onEmitNewNode(emittedNodeData);
50665
50679
  }
@@ -53519,6 +53533,7 @@ __webpack_require__.r(__webpack_exports__);
53519
53533
 
53520
53534
 
53521
53535
 
53536
+
53522
53537
 
53523
53538
 
53524
53539
  class BlockTools {
@@ -53659,6 +53674,8 @@ class BlockTools {
53659
53674
  return new core_Materials_Node_Blocks_Fragment_discardBlock__WEBPACK_IMPORTED_MODULE_0__.GradientBlock("Gradient");
53660
53675
  case "FrontFacingBlock":
53661
53676
  return new core_Materials_Node_Blocks_Fragment_discardBlock__WEBPACK_IMPORTED_MODULE_0__.FrontFacingBlock("Front facing");
53677
+ case "MeshAttributeExistsBlock":
53678
+ return new core_Materials_Node_Blocks_Fragment_discardBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlock("Attribute exists");
53662
53679
  case "CosBlock": {
53663
53680
  const cosBlock = new core_Materials_Node_Blocks_Fragment_discardBlock__WEBPACK_IMPORTED_MODULE_0__.TrigonometryBlock("Cos");
53664
53681
  cosBlock.operation = core_Materials_Node_Blocks_Fragment_discardBlock__WEBPACK_IMPORTED_MODULE_0__.TrigonometryBlockOperations.Cos;
@@ -54420,6 +54437,7 @@ class NodeListComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
54420
54437
  "WorldNormalBlock",
54421
54438
  "WorldTangentBlock",
54422
54439
  "FrontFacingBlock",
54440
+ "MeshAttributeExistsBlock",
54423
54441
  ],
54424
54442
  Noises: ["RandomNumberBlock", "SimplexPerlin3DBlock", "WorleyNoise3DBlock", "CloudBlock", "VoronoiNoiseBlock"],
54425
54443
  Output_Nodes: ["VertexOutputBlock", "FragmentOutputBlock", "DiscardBlock", "ClipPlanesBlock", "FragDepthBlock"],
@@ -54683,6 +54701,7 @@ NodeListComponent._Tooltips = {
54683
54701
  BiPlanarBlock: "A node for reading a texture with biplanar mapping",
54684
54702
  MatrixDeterminantBlock: "Compute the determinant of a matrix",
54685
54703
  MatrixTransposeBlock: "Compute the transpose of a matrix",
54704
+ MeshAttributeExistsBlock: "Falls back to secondary input if specified attribute doesn't exists on the rendered mesh",
54686
54705
  };
54687
54706
 
54688
54707
 
@@ -57411,6 +57430,77 @@ class InputDisplayManager {
57411
57430
  }
57412
57431
 
57413
57432
 
57433
+ /***/ }),
57434
+
57435
+ /***/ "../../../tools/nodeEditor/dist/graphSystem/display/meshAttributeExistsDisplayManager.js":
57436
+ /*!***********************************************************************************************!*\
57437
+ !*** ../../../tools/nodeEditor/dist/graphSystem/display/meshAttributeExistsDisplayManager.js ***!
57438
+ \***********************************************************************************************/
57439
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
57440
+
57441
+ "use strict";
57442
+ __webpack_require__.r(__webpack_exports__);
57443
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
57444
+ /* harmony export */ "MeshAttributeExistsDisplayManager": () => (/* binding */ MeshAttributeExistsDisplayManager)
57445
+ /* harmony export */ });
57446
+ /* harmony import */ var core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Node/Blocks/meshAttributeExistsBlock */ "core/Misc/dataStorage");
57447
+ /* harmony import */ var core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__);
57448
+
57449
+ /**
57450
+ *
57451
+ */
57452
+ class MeshAttributeExistsDisplayManager {
57453
+ getHeaderClass(nodeData) {
57454
+ return "";
57455
+ }
57456
+ shouldDisplayPortLabels() {
57457
+ return true;
57458
+ }
57459
+ getHeaderText(nodeData) {
57460
+ const block = nodeData.data;
57461
+ let name = block.name;
57462
+ let attributeName;
57463
+ switch (block.attributeType) {
57464
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.VertexColor:
57465
+ attributeName = "Color";
57466
+ break;
57467
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.Normal:
57468
+ attributeName = "Normal";
57469
+ break;
57470
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.Tangent:
57471
+ attributeName = "Tangent";
57472
+ break;
57473
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.UV1:
57474
+ attributeName = "UV";
57475
+ break;
57476
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.UV2:
57477
+ attributeName = "UV2";
57478
+ break;
57479
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.UV3:
57480
+ attributeName = "UV3";
57481
+ break;
57482
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.UV4:
57483
+ attributeName = "UV4";
57484
+ break;
57485
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.UV5:
57486
+ attributeName = "UV5";
57487
+ break;
57488
+ case core_Materials_Node_Blocks_meshAttributeExistsBlock__WEBPACK_IMPORTED_MODULE_0__.MeshAttributeExistsBlockTypes.UV6:
57489
+ attributeName = "UV6";
57490
+ break;
57491
+ }
57492
+ if (attributeName) {
57493
+ name += ` (${attributeName})`;
57494
+ }
57495
+ return name;
57496
+ }
57497
+ getBackgroundColor(nodeData) {
57498
+ return "";
57499
+ }
57500
+ updatePreviewContent() { }
57501
+ }
57502
+
57503
+
57414
57504
  /***/ }),
57415
57505
 
57416
57506
  /***/ "../../../tools/nodeEditor/dist/graphSystem/display/outputDisplayManager.js":
@@ -59359,6 +59449,8 @@ __webpack_require__.r(__webpack_exports__);
59359
59449
  /* harmony import */ var _display_imageSourceDisplayManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./display/imageSourceDisplayManager */ "../../../tools/nodeEditor/dist/graphSystem/display/imageSourceDisplayManager.js");
59360
59450
  /* harmony import */ var _display_elbowDisplayManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./display/elbowDisplayManager */ "../../../tools/nodeEditor/dist/graphSystem/display/elbowDisplayManager.js");
59361
59451
  /* harmony import */ var shared_ui_components_nodeGraphSystem_displayLedger__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! shared-ui-components/nodeGraphSystem/displayLedger */ "../../../dev/sharedUiComponents/dist/nodeGraphSystem/displayLedger.js");
59452
+ /* harmony import */ var _display_meshAttributeExistsDisplayManager__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./display/meshAttributeExistsDisplayManager */ "../../../tools/nodeEditor/dist/graphSystem/display/meshAttributeExistsDisplayManager.js");
59453
+
59362
59454
 
59363
59455
 
59364
59456
 
@@ -59397,6 +59489,7 @@ const RegisterToDisplayManagers = () => {
59397
59489
  shared_ui_components_nodeGraphSystem_displayLedger__WEBPACK_IMPORTED_MODULE_12__.DisplayLedger.RegisteredControls.SubSurfaceBlock = _display_pbrDisplayManager__WEBPACK_IMPORTED_MODULE_8__.PBRDisplayManager;
59398
59490
  shared_ui_components_nodeGraphSystem_displayLedger__WEBPACK_IMPORTED_MODULE_12__.DisplayLedger.RegisteredControls.ImageSourceBlock = _display_imageSourceDisplayManager__WEBPACK_IMPORTED_MODULE_10__.ImageSourceDisplayManager;
59399
59491
  shared_ui_components_nodeGraphSystem_displayLedger__WEBPACK_IMPORTED_MODULE_12__.DisplayLedger.RegisteredControls.ElbowBlock = _display_elbowDisplayManager__WEBPACK_IMPORTED_MODULE_11__.ElbowDisplayManager;
59492
+ shared_ui_components_nodeGraphSystem_displayLedger__WEBPACK_IMPORTED_MODULE_12__.DisplayLedger.RegisteredControls.MeshAttributeExistsBlock = _display_meshAttributeExistsDisplayManager__WEBPACK_IMPORTED_MODULE_13__.MeshAttributeExistsDisplayManager;
59400
59493
  };
59401
59494
 
59402
59495