@babylonjs/node-editor 5.1.0 → 5.4.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.
|
@@ -64876,7 +64876,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64876
64876
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
64877
64877
|
/* harmony export */ "TextureDisplayManager": () => (/* binding */ TextureDisplayManager)
|
|
64878
64878
|
/* harmony export */ });
|
|
64879
|
-
/* harmony import */ var core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Node/Blocks/
|
|
64879
|
+
/* harmony import */ var core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Materials/Node/Blocks/PBR/reflectionBlock */ "core/Misc/dataStorage");
|
|
64880
64880
|
/* harmony import */ var core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__);
|
|
64881
64881
|
/* harmony import */ var _sharedComponents_textureLineComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../sharedComponents/textureLineComponent */ "../../../tools/nodeEditor/dist/sharedComponents/textureLineComponent.js");
|
|
64882
64882
|
|
|
@@ -64884,6 +64884,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64884
64884
|
|
|
64885
64885
|
|
|
64886
64886
|
|
|
64887
|
+
|
|
64887
64888
|
class TextureDisplayManager {
|
|
64888
64889
|
getHeaderClass() {
|
|
64889
64890
|
return "";
|
|
@@ -64904,7 +64905,7 @@ class TextureDisplayManager {
|
|
|
64904
64905
|
if (block instanceof core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__.TextureBlock) {
|
|
64905
64906
|
contentArea.classList.add("regular-texture-block");
|
|
64906
64907
|
}
|
|
64907
|
-
if (block instanceof core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__.ReflectionBlock) {
|
|
64908
|
+
if (block instanceof core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__.ReflectionTextureBlock || block instanceof core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__.ReflectionBlock) {
|
|
64908
64909
|
contentArea.classList.add("reflection-block");
|
|
64909
64910
|
}
|
|
64910
64911
|
if (block instanceof core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__.CurrentScreenBlock || block instanceof core_Materials_Node_Blocks_Dual_textureBlock__WEBPACK_IMPORTED_MODULE_0__.ParticleTextureBlock) {
|
|
@@ -65199,7 +65200,7 @@ class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
|
65199
65200
|
this._frameIsMoving = false;
|
|
65200
65201
|
this._isLoading = false;
|
|
65201
65202
|
props.globalState.onSelectionChangedObservable.add((options) => {
|
|
65202
|
-
const { selection, forceKeepSelection } = options || {};
|
|
65203
|
+
const { selection, forceKeepSelection, marqueeSelection = false } = options || {};
|
|
65203
65204
|
if (!selection) {
|
|
65204
65205
|
this._selectedNodes = [];
|
|
65205
65206
|
this._selectedLink = null;
|
|
@@ -65213,41 +65214,6 @@ class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
|
65213
65214
|
this._selectedLink = selection;
|
|
65214
65215
|
this._selectedPort = null;
|
|
65215
65216
|
}
|
|
65216
|
-
else if (selection instanceof _graphFrame__WEBPACK_IMPORTED_MODULE_7__.GraphFrame && !this._selectedNodes.length) {
|
|
65217
|
-
if (selection.isCollapsed) {
|
|
65218
|
-
if (this._ctrlKeyIsPressed || forceKeepSelection) {
|
|
65219
|
-
if (this._selectedFrames.indexOf(selection) === -1) {
|
|
65220
|
-
this._selectedFrames.push(selection);
|
|
65221
|
-
}
|
|
65222
|
-
}
|
|
65223
|
-
else {
|
|
65224
|
-
this._selectedFrames = [selection];
|
|
65225
|
-
this._selectedNodes = [];
|
|
65226
|
-
this._selectedLink = null;
|
|
65227
|
-
this._selectedPort = null;
|
|
65228
|
-
}
|
|
65229
|
-
}
|
|
65230
|
-
else {
|
|
65231
|
-
this._selectedNodes = [];
|
|
65232
|
-
this._selectedFrames = [selection];
|
|
65233
|
-
this._selectedLink = null;
|
|
65234
|
-
this._selectedPort = null;
|
|
65235
|
-
}
|
|
65236
|
-
}
|
|
65237
|
-
else if (selection instanceof _graphNode__WEBPACK_IMPORTED_MODULE_3__.GraphNode) {
|
|
65238
|
-
if (this._ctrlKeyIsPressed || forceKeepSelection) {
|
|
65239
|
-
if (this._selectedNodes.indexOf(selection) === -1) {
|
|
65240
|
-
this._selectedNodes.push(selection);
|
|
65241
|
-
this._selectedFrames = [];
|
|
65242
|
-
}
|
|
65243
|
-
}
|
|
65244
|
-
else {
|
|
65245
|
-
this._selectedNodes = [selection];
|
|
65246
|
-
this._selectedFrames = [];
|
|
65247
|
-
this._selectedLink = null;
|
|
65248
|
-
this._selectedPort = null;
|
|
65249
|
-
}
|
|
65250
|
-
}
|
|
65251
65217
|
else if (selection instanceof _nodePort__WEBPACK_IMPORTED_MODULE_6__.NodePort) {
|
|
65252
65218
|
this._selectedNodes = [];
|
|
65253
65219
|
this._selectedFrames = [];
|
|
@@ -65260,6 +65226,57 @@ class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
|
65260
65226
|
this._selectedLink = null;
|
|
65261
65227
|
this._selectedPort = selection.port;
|
|
65262
65228
|
}
|
|
65229
|
+
else if (selection instanceof _graphNode__WEBPACK_IMPORTED_MODULE_3__.GraphNode || selection instanceof _graphFrame__WEBPACK_IMPORTED_MODULE_7__.GraphFrame) {
|
|
65230
|
+
// If in marquee selection mode, always prioritize selecting nodes. Otherwise, always prioritize selecting the type of
|
|
65231
|
+
// the selected element
|
|
65232
|
+
if (marqueeSelection) {
|
|
65233
|
+
if (selection instanceof _graphFrame__WEBPACK_IMPORTED_MODULE_7__.GraphFrame && !this._selectedFrames.includes(selection)) {
|
|
65234
|
+
this._selectedFrames.push(selection);
|
|
65235
|
+
}
|
|
65236
|
+
else if (selection instanceof _graphNode__WEBPACK_IMPORTED_MODULE_3__.GraphNode && !this._selectedNodes.includes(selection)) {
|
|
65237
|
+
this._selectedNodes.push(selection);
|
|
65238
|
+
}
|
|
65239
|
+
if (this._selectedFrameAndNodesConflict(this.selectedFrames, this.selectedNodes)) {
|
|
65240
|
+
const framesToRemove = new Set();
|
|
65241
|
+
for (const selectedNode of this._selectedNodes) {
|
|
65242
|
+
for (const selectedFrame of this._selectedFrames) {
|
|
65243
|
+
if (selectedFrame.nodes.includes(selectedNode)) {
|
|
65244
|
+
framesToRemove.add(selectedFrame);
|
|
65245
|
+
}
|
|
65246
|
+
}
|
|
65247
|
+
}
|
|
65248
|
+
this._selectedFrames = this._selectedFrames.filter((f) => !framesToRemove.has(f));
|
|
65249
|
+
}
|
|
65250
|
+
}
|
|
65251
|
+
else {
|
|
65252
|
+
if (selection instanceof _graphFrame__WEBPACK_IMPORTED_MODULE_7__.GraphFrame) {
|
|
65253
|
+
if (this._ctrlKeyIsPressed || forceKeepSelection) {
|
|
65254
|
+
if (!this._selectedFrameAndNodesConflict([selection], this._selectedNodes) && !this._selectedFrames.includes(selection)) {
|
|
65255
|
+
this._selectedFrames.push(selection);
|
|
65256
|
+
}
|
|
65257
|
+
}
|
|
65258
|
+
else {
|
|
65259
|
+
this._selectedFrames = [selection];
|
|
65260
|
+
this._selectedNodes = [];
|
|
65261
|
+
this._selectedLink = null;
|
|
65262
|
+
this._selectedPort = null;
|
|
65263
|
+
}
|
|
65264
|
+
}
|
|
65265
|
+
else if (selection instanceof _graphNode__WEBPACK_IMPORTED_MODULE_3__.GraphNode) {
|
|
65266
|
+
if (this._ctrlKeyIsPressed || forceKeepSelection) {
|
|
65267
|
+
if (!this._selectedFrameAndNodesConflict(this._selectedFrames, [selection]) && !this._selectedNodes.includes(selection)) {
|
|
65268
|
+
this._selectedNodes.push(selection);
|
|
65269
|
+
}
|
|
65270
|
+
}
|
|
65271
|
+
else {
|
|
65272
|
+
this._selectedFrames = [];
|
|
65273
|
+
this._selectedNodes = [selection];
|
|
65274
|
+
this._selectedLink = null;
|
|
65275
|
+
this._selectedPort = null;
|
|
65276
|
+
}
|
|
65277
|
+
}
|
|
65278
|
+
}
|
|
65279
|
+
}
|
|
65263
65280
|
}
|
|
65264
65281
|
});
|
|
65265
65282
|
props.globalState.onCandidatePortSelectedObservable.add((port) => {
|
|
@@ -65363,6 +65380,17 @@ class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
|
65363
65380
|
get frameContainer() {
|
|
65364
65381
|
return this._frameContainer;
|
|
65365
65382
|
}
|
|
65383
|
+
// There is a selection conflict between nodes and frames if any selected node is inside any selected frame
|
|
65384
|
+
_selectedFrameAndNodesConflict(frameSelection, nodeSelection) {
|
|
65385
|
+
for (const frame of frameSelection) {
|
|
65386
|
+
for (const node of nodeSelection) {
|
|
65387
|
+
if (frame.nodes.includes(node)) {
|
|
65388
|
+
return true;
|
|
65389
|
+
}
|
|
65390
|
+
}
|
|
65391
|
+
}
|
|
65392
|
+
return false;
|
|
65393
|
+
}
|
|
65366
65394
|
getGridPosition(position, useCeil = false) {
|
|
65367
65395
|
const gridSize = this.gridSize;
|
|
65368
65396
|
if (gridSize === 0) {
|
|
@@ -66581,7 +66609,7 @@ class GraphFrame {
|
|
|
66581
66609
|
const rect2 = this.element.getBoundingClientRect();
|
|
66582
66610
|
const overlap = !(rect1.right < rect2.left || rect1.left > rect2.right || rect1.bottom < rect2.top || rect1.top > rect2.bottom);
|
|
66583
66611
|
if (overlap) {
|
|
66584
|
-
canvas.globalState.onSelectionChangedObservable.notifyObservers({ selection: this, forceKeepSelection: true });
|
|
66612
|
+
canvas.globalState.onSelectionChangedObservable.notifyObservers({ selection: this, forceKeepSelection: true, marqueeSelection: true });
|
|
66585
66613
|
}
|
|
66586
66614
|
});
|
|
66587
66615
|
this._onGraphNodeRemovalObserver = canvas.globalState.onGraphNodeRemovalObservable.add((node) => {
|
|
@@ -67416,7 +67444,7 @@ class GraphNode {
|
|
|
67416
67444
|
this._onSelectionBoxMovedObserver = this._globalState.onSelectionBoxMoved.add((rect1) => {
|
|
67417
67445
|
const rect2 = this._visual.getBoundingClientRect();
|
|
67418
67446
|
const overlap = !(rect1.right < rect2.left || rect1.left > rect2.right || rect1.bottom < rect2.top || rect1.top > rect2.bottom);
|
|
67419
|
-
this.
|
|
67447
|
+
this.setIsSelected(overlap, true);
|
|
67420
67448
|
});
|
|
67421
67449
|
this._onFrameCreatedObserver = this._globalState.onFrameCreatedObservable.add((frame) => {
|
|
67422
67450
|
if (this._ownerCanvas.frames.some((f) => f.nodes.indexOf(this) !== -1)) {
|
|
@@ -67514,6 +67542,9 @@ class GraphNode {
|
|
|
67514
67542
|
this._enclosingFrameId = value;
|
|
67515
67543
|
}
|
|
67516
67544
|
set isSelected(value) {
|
|
67545
|
+
this.setIsSelected(value, false);
|
|
67546
|
+
}
|
|
67547
|
+
setIsSelected(value, marqueeSelection) {
|
|
67517
67548
|
if (this._isSelected === value) {
|
|
67518
67549
|
return;
|
|
67519
67550
|
}
|
|
@@ -67526,7 +67557,7 @@ class GraphNode {
|
|
|
67526
67557
|
}
|
|
67527
67558
|
}
|
|
67528
67559
|
else {
|
|
67529
|
-
this._globalState.onSelectionChangedObservable.notifyObservers({ selection: this });
|
|
67560
|
+
this._globalState.onSelectionChangedObservable.notifyObservers({ selection: this, marqueeSelection });
|
|
67530
67561
|
}
|
|
67531
67562
|
}
|
|
67532
67563
|
isOverlappingFrame(frame) {
|
|
@@ -67622,7 +67653,7 @@ class GraphNode {
|
|
|
67622
67653
|
this._globalState.onSelectionChangedObservable.notifyObservers({ selection: this });
|
|
67623
67654
|
}
|
|
67624
67655
|
else if (evt.ctrlKey) {
|
|
67625
|
-
this.
|
|
67656
|
+
this.setIsSelected(false, false);
|
|
67626
67657
|
}
|
|
67627
67658
|
evt.stopPropagation();
|
|
67628
67659
|
for (const selectedNode of this._ownerCanvas.selectedNodes) {
|
|
@@ -67775,10 +67806,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67775
67806
|
/* harmony export */ "NodeLink": () => (/* binding */ NodeLink)
|
|
67776
67807
|
/* harmony export */ });
|
|
67777
67808
|
/* harmony import */ var _graphCanvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graphCanvas */ "../../../tools/nodeEditor/dist/diagram/graphCanvas.js");
|
|
67778
|
-
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/
|
|
67809
|
+
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes */ "core/Misc/dataStorage");
|
|
67779
67810
|
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
|
|
67780
67811
|
|
|
67781
67812
|
|
|
67813
|
+
|
|
67782
67814
|
class NodeLink {
|
|
67783
67815
|
constructor(graphCanvas, portA, nodeA, portB, nodeB) {
|
|
67784
67816
|
this._isVisible = true;
|
|
@@ -67872,13 +67904,16 @@ class NodeLink {
|
|
|
67872
67904
|
}
|
|
67873
67905
|
onClick(evt) {
|
|
67874
67906
|
if (evt.altKey) {
|
|
67907
|
+
const nodeA = this._nodeA;
|
|
67908
|
+
const pointA = this._portA.connectionPoint;
|
|
67909
|
+
const nodeB = this._nodeB;
|
|
67910
|
+
const pointB = this._portB.connectionPoint;
|
|
67911
|
+
if (pointA.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.NodeMaterialBlockConnectionPointTypes.Object || pointB.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.NodeMaterialBlockConnectionPointTypes.Object) {
|
|
67912
|
+
return; // We do not support Elbow on complex types
|
|
67913
|
+
}
|
|
67875
67914
|
// Create an elbow at the clicked location
|
|
67876
67915
|
this._graphCanvas.globalState.onNewNodeCreatedObservable.addOnce((newNode) => {
|
|
67877
67916
|
const newElbowBlock = newNode.block;
|
|
67878
|
-
const nodeA = this._nodeA;
|
|
67879
|
-
const pointA = this._portA.connectionPoint;
|
|
67880
|
-
const nodeB = this._nodeB;
|
|
67881
|
-
const pointB = this._portB.connectionPoint;
|
|
67882
67917
|
// Delete previous link
|
|
67883
67918
|
this.dispose();
|
|
67884
67919
|
// Connect to Elbow block
|