@babylonjs/node-editor 6.16.2 → 6.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.
@@ -51367,12 +51367,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
51367
51367
|
/* harmony export */ });
|
51368
51368
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../../../../node_modules/react/jsx-runtime.js");
|
51369
51369
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../../../node_modules/react/index.js");
|
51370
|
-
/* harmony import */ var
|
51371
|
-
/* harmony import */ var
|
51370
|
+
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/tools */ "core/Misc/dataStorage");
|
51371
|
+
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
|
51372
|
+
/* harmony import */ var _lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lines/numericInputComponent */ "../../../dev/sharedUiComponents/dist/lines/numericInputComponent.js");
|
51373
|
+
/* harmony import */ var _fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @fortawesome/react-fontawesome */ "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js");
|
51372
51374
|
/* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @fortawesome/free-solid-svg-icons */ "../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs");
|
51373
|
-
/* harmony import */ var
|
51374
|
-
|
51375
|
-
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_5__);
|
51375
|
+
/* harmony import */ var _lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lines/sliderLineComponent */ "../../../dev/sharedUiComponents/dist/lines/sliderLineComponent.js");
|
51376
|
+
|
51376
51377
|
|
51377
51378
|
|
51378
51379
|
|
@@ -51384,7 +51385,8 @@ class Vector3LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
51384
51385
|
constructor(props) {
|
51385
51386
|
super(props);
|
51386
51387
|
this._localChange = false;
|
51387
|
-
|
51388
|
+
const value = this.getCurrentValue();
|
51389
|
+
this.state = { isExpanded: false, value: value ? value.clone() : core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Zero() };
|
51388
51390
|
}
|
51389
51391
|
getCurrentValue() {
|
51390
51392
|
return this.props.target[this.props.propertyName];
|
@@ -51438,9 +51440,9 @@ class Vector3LineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
51438
51440
|
this.updateVector3();
|
51439
51441
|
}
|
51440
51442
|
render() {
|
51441
|
-
const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
|
51443
|
+
const chevron = this.state.isExpanded ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faMinus }) : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_fortawesome_react_fontawesome__WEBPACK_IMPORTED_MODULE_4__.FontAwesomeIcon, { icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faPlus });
|
51442
51444
|
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector3Line", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "firstLine", children: [this.props.icon && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "label", title: this.props.label, children: this.props.label }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "vector", children: [!this.props.useEuler && `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}`, this.props.useEuler &&
|
51443
|
-
`X: ${
|
51445
|
+
`X: ${core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.x).toFixed(2)}, Y: ${core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.y).toFixed(2)}, Z: ${core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.z).toFixed(2)}`] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron })] }), this.state.isExpanded && !this.props.useEuler && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInputComponent, { label: "x", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.x, onChange: (value) => this.updateStateX(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInputComponent, { label: "y", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.y, onChange: (value) => this.updateStateY(value) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInputComponent, { label: "z", lockObject: this.props.lockObject, step: this.props.step, value: this.state.value.z, onChange: (value) => this.updateStateZ(value) })] })), this.state.isExpanded && this.props.useEuler && !this.props.noSlider && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, margin: true, label: "x", minimum: 0, maximum: 360, step: 0.1, directValue: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.x), onChange: (value) => this.updateStateX(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, margin: true, label: "y", minimum: 0, maximum: 360, step: 0.1, directValue: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.y), onChange: (value) => this.updateStateY(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__.SliderLineComponent, { lockObject: this.props.lockObject, margin: true, label: "z", minimum: 0, maximum: 360, step: 0.1, directValue: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.z), onChange: (value) => this.updateStateZ(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) })] })), this.state.isExpanded && this.props.useEuler && this.props.noSlider && ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "secondLine", children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInputComponent, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.x), onChange: (value) => this.updateStateX(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInputComponent, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.y), onChange: (value) => this.updateStateY(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_lines_numericInputComponent__WEBPACK_IMPORTED_MODULE_3__.NumericInputComponent, { lockObject: this.props.lockObject, label: "z", step: this.props.step, value: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToDegrees(this.state.value.z), onChange: (value) => this.updateStateZ(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Tools.ToRadians(value)) })] }))] }));
|
51444
51446
|
}
|
51445
51447
|
}
|
51446
51448
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
@@ -54598,6 +54600,8 @@ class GraphNode {
|
|
54598
54600
|
const availableNodeOutputs = [];
|
54599
54601
|
const leftNode = this._ownerCanvas._targetLinkCandidate.nodeA;
|
54600
54602
|
const rightNode = this._ownerCanvas._targetLinkCandidate.nodeB;
|
54603
|
+
const leftPort = this._ownerCanvas._targetLinkCandidate.portA.portData;
|
54604
|
+
const rightPort = this._ownerCanvas._targetLinkCandidate.portB.portData;
|
54601
54605
|
// Delete previous
|
54602
54606
|
this._ownerCanvas._targetLinkCandidate.dispose();
|
54603
54607
|
this._ownerCanvas._targetLinkCandidate = null;
|
@@ -54606,6 +54610,17 @@ class GraphNode {
|
|
54606
54610
|
availableNodeOutputs.push(...this.content.outputs);
|
54607
54611
|
inputs.push(...leftNode.content.outputs);
|
54608
54612
|
outputs.push(...rightNode.content.inputs.filter((i) => !i.isConnected));
|
54613
|
+
// Prioritize the already connected ports
|
54614
|
+
const leftPortIndex = inputs.indexOf(leftPort);
|
54615
|
+
const rightPortIndex = outputs.indexOf(rightPort);
|
54616
|
+
if (leftPortIndex > 0) {
|
54617
|
+
inputs.splice(leftPortIndex, 1);
|
54618
|
+
inputs.splice(0, 0, leftPort);
|
54619
|
+
}
|
54620
|
+
if (rightPortIndex > 0) {
|
54621
|
+
outputs.splice(rightPortIndex, 1);
|
54622
|
+
outputs.splice(0, 0, rightPort);
|
54623
|
+
}
|
54609
54624
|
// Reconnect
|
54610
54625
|
this._ownerCanvas.automaticRewire(inputs, availableNodeInputs, true);
|
54611
54626
|
this._ownerCanvas.automaticRewire(availableNodeOutputs, outputs, true);
|