|
@@ -1,13 +1,13 @@
|
|
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
|
- module.exports = factory(require("babylonjs-gui"), require("babylonjs-loaders"), require("babylonjs-loaders"), require("babylonjs-materials"), require("babylonjs-serializers"), require("babylonjs"));
|
|
|
+ module.exports = factory(require("babylonjs-gui"), require("babylonjs-loaders"), require("babylonjs-materials"), require("babylonjs-serializers"), require("babylonjs"));
|
|
|
else if(typeof define === 'function' && define.amd)
|
|
|
- define("babylonjs-inspector", ["babylonjs-gui", "babylonjs-loaders", "babylonjs-loaders", "babylonjs-materials", "babylonjs-serializers", "babylonjs"], factory);
|
|
|
+ define("babylonjs-inspector", ["babylonjs-gui", "babylonjs-loaders", "babylonjs-materials", "babylonjs-serializers", "babylonjs"], factory);
|
|
|
else if(typeof exports === 'object')
|
|
|
- exports["babylonjs-inspector"] = factory(require("babylonjs-gui"), require("babylonjs-loaders"), require("babylonjs-loaders"), require("babylonjs-materials"), require("babylonjs-serializers"), require("babylonjs"));
|
|
|
+ exports["babylonjs-inspector"] = factory(require("babylonjs-gui"), require("babylonjs-loaders"), require("babylonjs-materials"), require("babylonjs-serializers"), require("babylonjs"));
|
|
|
else
|
|
|
- root["INSPECTOR"] = factory(root["BABYLON"]["GUI"], root["BABYLON"]["GLTF2"]["Loader"]["Extensions"], root["BABYLON"], root["BABYLON"], root["BABYLON"], root["BABYLON"]);
|
|
|
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_image__, __WEBPACK_EXTERNAL_MODULE_babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__, __WEBPACK_EXTERNAL_MODULE_babylonjs_loaders_glTF_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_materials_grid_gridMaterial__, __WEBPACK_EXTERNAL_MODULE_babylonjs_serializers_glTF_2_0_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
|
|
|
+ root["INSPECTOR"] = factory(root["BABYLON"]["GUI"], root["BABYLON"], root["BABYLON"], root["BABYLON"], root["BABYLON"]);
|
|
|
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_image__, __WEBPACK_EXTERNAL_MODULE_babylonjs_loaders_glTF_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_materials_grid_gridMaterial__, __WEBPACK_EXTERNAL_MODULE_babylonjs_serializers_glTF_2_0_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
|
|
|
return /******/ (function(modules) { // webpackBootstrap
|
|
|
/******/ // The module cache
|
|
|
/******/ var installedModules = {};
|
|
@@ -11322,6 +11322,24 @@ module.exports = exports;
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
+/***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss":
|
|
|
+/*!*********************************************************************************************************************************************************************************************************!*\
|
|
|
+ !*** D:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!D:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss ***!
|
|
|
+ \*********************************************************************************************************************************************************************************************************/
|
|
|
+/*! no static exports found */
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+// Imports
|
|
|
+var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
|
|
|
+exports = ___CSS_LOADER_API_IMPORT___(false);
|
|
|
+// Module
|
|
|
+exports.push([module.i, "#texture-canvas {\n width: 100%;\n height: 100%; }\n", ""]);
|
|
|
+// Exports
|
|
|
+module.exports = exports;
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
/***/ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/embedHost/embedHost.scss":
|
|
|
/*!**************************************************************************************************************************************************************!*\
|
|
|
!*** D:/Repos/Babylon.js/node_modules/css-loader/dist/cjs.js!D:/Repos/Babylon.js/node_modules/sass-loader/dist/cjs.js!./components/embedHost/embedHost.scss ***!
|
|
@@ -64893,7 +64911,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../lines/floatLineComponent */ "./components/actionTabs/lines/floatLineComponent.tsx");
|
|
|
/* harmony import */ var _lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../lines/textLineComponent */ "./components/actionTabs/lines/textLineComponent.tsx");
|
|
|
/* harmony import */ var _animations_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../animations/animationCurveEditorComponent */ "./components/actionTabs/tabs/propertyGrids/animations/animationCurveEditorComponent.tsx");
|
|
|
-/* harmony import */ var _animations_popupComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../animations/popupComponent */ "./components/actionTabs/tabs/propertyGrids/animations/popupComponent.tsx");
|
|
|
+/* harmony import */ var _popupComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../popupComponent */ "./components/popupComponent.tsx");
|
|
|
|
|
|
|
|
|
|
|
@@ -65033,7 +65051,7 @@ var AnimationGridComponent = /** @class */ (function (_super) {
|
|
|
animations.map(function (anim, i) {
|
|
|
return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_8__["TextLineComponent"], { key: anim.targetProperty + i, label: '#' + i + ' >', value: anim.targetProperty }));
|
|
|
}),
|
|
|
- this._isCurveEditorOpen && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_animations_popupComponent__WEBPACK_IMPORTED_MODULE_10__["PopupComponent"], { id: 'curve-editor', title: 'Curve Animation Editor', size: { width: 1024, height: 490 }, onOpen: function (window) { }, onClose: function (window) {
|
|
|
+ this._isCurveEditorOpen && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_popupComponent__WEBPACK_IMPORTED_MODULE_10__["PopupComponent"], { id: 'curve-editor', title: 'Curve Animation Editor', size: { width: 1024, height: 490 }, onOpen: function (window) { }, onClose: function (window) {
|
|
|
return _this.onCloseAnimationCurveEditor(window);
|
|
|
} },
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_animations_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_9__["AnimationCurveEditorComponent"], { scene: this.props.scene, entity: animatableAsAny, close: function (event) {
|
|
@@ -66043,81 +66061,6 @@ var Notification = /** @class */ (function (_super) {
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
-/***/ "./components/actionTabs/tabs/propertyGrids/animations/popupComponent.tsx":
|
|
|
-/*!********************************************************************************!*\
|
|
|
- !*** ./components/actionTabs/tabs/propertyGrids/animations/popupComponent.tsx ***!
|
|
|
- \********************************************************************************/
|
|
|
-/*! exports provided: PopupComponent */
|
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
-
|
|
|
-"use strict";
|
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return PopupComponent; });
|
|
|
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
|
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
|
|
|
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
-/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js");
|
|
|
-/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
-/* harmony import */ var _inspector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../inspector */ "./inspector.ts");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-var PopupComponent = /** @class */ (function (_super) {
|
|
|
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PopupComponent, _super);
|
|
|
- function PopupComponent(props) {
|
|
|
- var _this = _super.call(this, props) || this;
|
|
|
- _this._container = document.createElement('div');
|
|
|
- _this._container.id = _this.props.id;
|
|
|
- _this._window;
|
|
|
- _this.state = {
|
|
|
- isComponentMounted: false,
|
|
|
- blockedByBrowser: false,
|
|
|
- };
|
|
|
- return _this;
|
|
|
- }
|
|
|
- PopupComponent.prototype.componentDidMount = function () {
|
|
|
- this.openPopup();
|
|
|
- this.setState({ isComponentMounted: true });
|
|
|
- };
|
|
|
- PopupComponent.prototype.openPopup = function () {
|
|
|
- var _this = this;
|
|
|
- var _a = this.props, title = _a.title, size = _a.size, onClose = _a.onClose, onOpen = _a.onOpen;
|
|
|
- var windowVariableName = "window_" + title;
|
|
|
- this._container = _inspector__WEBPACK_IMPORTED_MODULE_3__["Inspector"]._CreatePopup(title, windowVariableName, size.width, size.height);
|
|
|
- this._window = _inspector__WEBPACK_IMPORTED_MODULE_3__["Inspector"][windowVariableName];
|
|
|
- if (this._window) {
|
|
|
- onOpen(this._window);
|
|
|
- this._window.addEventListener('beforeunload', function () { return _this._window && onClose(_this._window); });
|
|
|
- }
|
|
|
- else {
|
|
|
- if (!this._window) {
|
|
|
- this.setState({ blockedByBrowser: true }, function () {
|
|
|
- if (_this.state.blockedByBrowser) {
|
|
|
- alert("You might have blocked popups in your browser");
|
|
|
- console.warn("Popup window couldn't be created");
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- PopupComponent.prototype.componentWillUnmount = function () {
|
|
|
- if (this._window) {
|
|
|
- this._window.close();
|
|
|
- }
|
|
|
- };
|
|
|
- PopupComponent.prototype.render = function () {
|
|
|
- if (!this.state.isComponentMounted || this._container === null)
|
|
|
- return null;
|
|
|
- return react_dom__WEBPACK_IMPORTED_MODULE_2__["createPortal"](this.props.children, this._container);
|
|
|
- };
|
|
|
- return PopupComponent;
|
|
|
-}(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
/***/ "./components/actionTabs/tabs/propertyGrids/animations/saveSnippet.tsx":
|
|
|
/*!*****************************************************************************!*\
|
|
|
!*** ./components/actionTabs/tabs/propertyGrids/animations/saveSnippet.tsx ***!
|
|
@@ -66517,7 +66460,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
|
|
|
/* harmony import */ var _lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../lines/textLineComponent */ "./components/actionTabs/lines/textLineComponent.tsx");
|
|
|
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/textInputLineComponent */ "./components/actionTabs/lines/textInputLineComponent.tsx");
|
|
|
-/* harmony import */ var _animations_popupComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../animations/popupComponent */ "./components/actionTabs/tabs/propertyGrids/animations/popupComponent.tsx");
|
|
|
+/* harmony import */ var _popupComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../popupComponent */ "./components/popupComponent.tsx");
|
|
|
/* harmony import */ var _animations_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../animations/animationCurveEditorComponent */ "./components/actionTabs/tabs/propertyGrids/animations/animationCurveEditorComponent.tsx");
|
|
|
|
|
|
|
|
@@ -66582,7 +66525,7 @@ var TargetedAnimationGridComponent = /** @class */ (function (_super) {
|
|
|
return _this.props.globalState.onSelectionChangedObservable.notifyObservers(targetedAnimation);
|
|
|
} })),
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_2__["ButtonLineComponent"], { label: 'Edit animation', onClick: function () { return _this.onOpenAnimationCurveEditor(); } }),
|
|
|
- this._isCurveEditorOpen && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_animations_popupComponent__WEBPACK_IMPORTED_MODULE_6__["PopupComponent"], { id: 'curve-editor', title: 'Curve Animation Editor', size: { width: 1024, height: 512 }, onOpen: function (window) { }, onClose: function (window) {
|
|
|
+ this._isCurveEditorOpen && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_popupComponent__WEBPACK_IMPORTED_MODULE_6__["PopupComponent"], { id: 'curve-editor', title: 'Curve Animation Editor', size: { width: 1024, height: 512 }, onOpen: function (window) { }, onClose: function (window) {
|
|
|
return _this.onCloseAnimationCurveEditor(window);
|
|
|
} },
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_animations_animationCurveEditorComponent__WEBPACK_IMPORTED_MODULE_7__["AnimationCurveEditorComponent"], { scene: this.props.scene, entity: targetedAnimation, playOrPause: function () { return _this.playOrPause(); }, lockObject: this.props.lockObject, globalState: this.props.globalState, close: function (event) { return _this.onCloseAnimationCurveEditor(event.view); } }))),
|
|
@@ -69705,6 +69648,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var _lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../lines/buttonLineComponent */ "./components/actionTabs/lines/buttonLineComponent.tsx");
|
|
|
/* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../lines/textInputLineComponent */ "./components/actionTabs/lines/textInputLineComponent.tsx");
|
|
|
/* harmony import */ var _animations_animationPropertyGridComponent__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../animations/animationPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.tsx");
|
|
|
+/* harmony import */ var _popupComponent__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../popupComponent */ "./components/popupComponent.tsx");
|
|
|
+/* harmony import */ var _textures_textureEditorComponent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./textures/textureEditorComponent */ "./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -69727,6 +69675,7 @@ var TexturePropertyGridComponent = /** @class */ (function (_super) {
|
|
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TexturePropertyGridComponent, _super);
|
|
|
function TexturePropertyGridComponent(props) {
|
|
|
var _this = _super.call(this, props) || this;
|
|
|
+ _this._isTextureEditorOpen = false;
|
|
|
var texture = _this.props.texture;
|
|
|
_this.textureLineRef = react__WEBPACK_IMPORTED_MODULE_1__["createRef"]();
|
|
|
if (!texture || !texture.rootContainer) {
|
|
@@ -69761,15 +69710,24 @@ var TexturePropertyGridComponent = /** @class */ (function (_super) {
|
|
|
else if (file.name.toLowerCase().indexOf(".env") > 0) {
|
|
|
extension = ".env";
|
|
|
}
|
|
|
- texture.updateURL(base64data, extension, function () { return _this.foreceRefresh(); });
|
|
|
+ texture.updateURL(base64data, extension, function () { return _this.forceRefresh(); });
|
|
|
}
|
|
|
else {
|
|
|
- texture.updateURL(base64data, null, function () { return _this.foreceRefresh(); });
|
|
|
+ texture.updateURL(base64data, null, function () { return _this.forceRefresh(); });
|
|
|
}
|
|
|
};
|
|
|
}, undefined, true);
|
|
|
};
|
|
|
- TexturePropertyGridComponent.prototype.foreceRefresh = function () {
|
|
|
+ TexturePropertyGridComponent.prototype.onOpenTextureEditor = function () {
|
|
|
+ this._isTextureEditorOpen = true;
|
|
|
+ };
|
|
|
+ TexturePropertyGridComponent.prototype.onCloseTextureEditor = function (window) {
|
|
|
+ this._isTextureEditorOpen = false;
|
|
|
+ if (window !== null) {
|
|
|
+ window.close();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ TexturePropertyGridComponent.prototype.forceRefresh = function () {
|
|
|
this.forceUpdate();
|
|
|
this.textureLineRef.current.updatePreview();
|
|
|
};
|
|
@@ -69804,14 +69762,21 @@ var TexturePropertyGridComponent = /** @class */ (function (_super) {
|
|
|
extension = textureUrl[index] + extension;
|
|
|
}
|
|
|
}
|
|
|
+ var editable = texture.textureType != babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Engine"].TEXTURETYPE_FLOAT && texture.textureType != babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Engine"].TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV && texture.textureType !== babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Engine"].TEXTURETYPE_HALF_FLOAT;
|
|
|
return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "pane" },
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "PREVIEW" },
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textureLineComponent__WEBPACK_IMPORTED_MODULE_7__["TextureLineComponent"], { ref: this.textureLineRef, texture: texture, width: 256, height: 256, globalState: this.props.globalState }),
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_10__["FileButtonLineComponent"], { label: "Load texture from file", onClick: function (file) { return _this.updateTexture(file); }, accept: ".jpg, .png, .tga, .dds, .env" }),
|
|
|
+ editable &&
|
|
|
+ react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__["ButtonLineComponent"], { label: "View", onClick: function () { return _this.onOpenTextureEditor(); } }),
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_15__["TextInputLineComponent"], { label: "URL", value: textureUrl, lockObject: this.props.lockObject, onChange: function (url) {
|
|
|
texture.updateURL(url);
|
|
|
- _this.foreceRefresh();
|
|
|
+ _this.forceRefresh();
|
|
|
} })),
|
|
|
+ this._isTextureEditorOpen && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_popupComponent__WEBPACK_IMPORTED_MODULE_17__["PopupComponent"], { id: 'texture-editor', title: 'Texture Editor', size: { width: 1024, height: 490 }, onOpen: function (window) { }, onClose: function (window) {
|
|
|
+ return _this.onCloseTextureEditor(window);
|
|
|
+ } },
|
|
|
+ react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_textures_textureEditorComponent__WEBPACK_IMPORTED_MODULE_18__["TextureEditorComponent"], { globalState: this.props.globalState, texture: this.props.texture }))),
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__["CustomPropertyGridComponent"], { globalState: this.props.globalState, target: texture, lockObject: this.props.lockObject, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "GENERAL" },
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_5__["TextLineComponent"], { label: "Width", value: texture.getSize().width.toString() }),
|
|
@@ -69885,6 +69850,221 @@ var TexturePropertyGridComponent = /** @class */ (function (_super) {
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
+/***/ "./components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.ts":
|
|
|
+/*!*********************************************************************************************!*\
|
|
|
+ !*** ./components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.ts ***!
|
|
|
+ \*********************************************************************************************/
|
|
|
+/*! exports provided: TextureCanvasManager */
|
|
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+__webpack_require__.r(__webpack_exports__);
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextureCanvasManager", function() { return TextureCanvasManager; });
|
|
|
+/* harmony import */ var babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Engines/engine */ "babylonjs/Misc/observable");
|
|
|
+/* harmony import */ var babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var TextureCanvasManager = /** @class */ (function () {
|
|
|
+ function TextureCanvasManager(targetCanvas, texture) {
|
|
|
+ var _this = this;
|
|
|
+ this._canvas = targetCanvas;
|
|
|
+ this._engine = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Engine"](targetCanvas, true);
|
|
|
+ this._scene = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Scene"](this._engine);
|
|
|
+ this._scene.clearColor = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Color4"](0.2, 0.2, 0.2, 1.0);
|
|
|
+ this._camera = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["FreeCamera"]("Camera", new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Vector3"](0, 0, -1), this._scene);
|
|
|
+ this._camera.mode = babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Camera"].ORTHOGRAPHIC_CAMERA;
|
|
|
+ if (texture) {
|
|
|
+ /* Grab image data from original texture and paint it onto the context of a DynamicTexture */
|
|
|
+ var pixelData = texture.readPixels();
|
|
|
+ var arr = new Uint8ClampedArray(pixelData.buffer);
|
|
|
+ var imgData = new ImageData(arr, texture.getSize().width, texture.getSize().height);
|
|
|
+ this._texture = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["DynamicTexture"]("texture", texture.getSize(), this._scene, false);
|
|
|
+ var ctx = this._texture.getContext();
|
|
|
+ ctx.putImageData(imgData, 0, 0);
|
|
|
+ this._texture.update();
|
|
|
+ this._texture.hasAlpha = texture.hasAlpha;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ /* If we don't have a texture to start with, just generate a white rectangle */
|
|
|
+ this._texture = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["DynamicTexture"]("texture", 256, this._scene, false);
|
|
|
+ var ctx = this._texture.getContext();
|
|
|
+ ctx.fillStyle = 'white';
|
|
|
+ ctx.fillRect(0, 0, 256, 256);
|
|
|
+ this._texture.update();
|
|
|
+ }
|
|
|
+ this._texture.updateSamplingMode(babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Engine"].TEXTURE_NEAREST_LINEAR);
|
|
|
+ var textureRatio = this._texture.getSize().width / this._texture.getSize().height;
|
|
|
+ this._plane = babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["PlaneBuilder"].CreatePlane("plane", { width: textureRatio, height: 1 }, this._scene);
|
|
|
+ babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["NodeMaterial"].ParseFromSnippetAsync("#TPSEV2#3", this._scene)
|
|
|
+ .then(function (material) {
|
|
|
+ _this._planeMaterial = material;
|
|
|
+ _this._planeMaterial.getTextureBlocks()[0].texture = _this._texture;
|
|
|
+ _this._plane.material = _this._planeMaterial;
|
|
|
+ _this._canvas.focus();
|
|
|
+ });
|
|
|
+ this._plane.enableEdgesRendering();
|
|
|
+ this._plane.edgesWidth = 4.0;
|
|
|
+ this._plane.edgesColor = new babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["Color4"](1, 1, 1, 1);
|
|
|
+ this._engine.runRenderLoop(function () {
|
|
|
+ _this._engine.resize();
|
|
|
+ _this._scene.render();
|
|
|
+ });
|
|
|
+ this._scale = 1;
|
|
|
+ this._isPanning = false;
|
|
|
+ this._scene.onBeforeRenderObservable.add(function () {
|
|
|
+ var _a, _b;
|
|
|
+ var ratio = ((_a = _this._canvas) === null || _a === void 0 ? void 0 : _a.width) / ((_b = _this._canvas) === null || _b === void 0 ? void 0 : _b.height);
|
|
|
+ _this._camera.orthoBottom = -_this._scale;
|
|
|
+ _this._camera.orthoTop = _this._scale;
|
|
|
+ _this._camera.orthoLeft = -_this._scale * ratio;
|
|
|
+ _this._camera.orthoRight = _this._scale * ratio;
|
|
|
+ });
|
|
|
+ this._scene.onPointerObservable.add(function (pointerInfo) {
|
|
|
+ switch (pointerInfo.type) {
|
|
|
+ case babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["PointerEventTypes"].POINTERWHEEL:
|
|
|
+ var event_1 = pointerInfo.event;
|
|
|
+ _this._scale += (event_1.deltaY * TextureCanvasManager.ZOOM_MOUSE_SPEED * _this._scale);
|
|
|
+ _this._scale = Math.min(Math.max(_this._scale, TextureCanvasManager.MIN_SCALE), TextureCanvasManager.MAX_SCALE);
|
|
|
+ break;
|
|
|
+ case babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["PointerEventTypes"].POINTERDOWN:
|
|
|
+ if (pointerInfo.event.button === TextureCanvasManager.PAN_BUTTON) {
|
|
|
+ _this._isPanning = true;
|
|
|
+ _this._mouseX = pointerInfo.event.x;
|
|
|
+ _this._mouseY = pointerInfo.event.y;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["PointerEventTypes"].POINTERUP:
|
|
|
+ if (pointerInfo.event.button === TextureCanvasManager.PAN_BUTTON) {
|
|
|
+ _this._isPanning = false;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["PointerEventTypes"].POINTERMOVE:
|
|
|
+ if (_this._isPanning) {
|
|
|
+ _this._camera.position.x -= (pointerInfo.event.x - _this._mouseX) * _this._scale * TextureCanvasManager.PAN_SPEED;
|
|
|
+ _this._camera.position.y += (pointerInfo.event.y - _this._mouseY) * _this._scale * TextureCanvasManager.PAN_SPEED;
|
|
|
+ _this._mouseX = pointerInfo.event.x;
|
|
|
+ _this._mouseY = pointerInfo.event.y;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this._scene.onKeyboardObservable.add(function (kbInfo) {
|
|
|
+ switch (kbInfo.type) {
|
|
|
+ case babylonjs_Engines_engine__WEBPACK_IMPORTED_MODULE_0__["KeyboardEventTypes"].KEYDOWN:
|
|
|
+ if (kbInfo.event.key == "+") {
|
|
|
+ _this._scale -= TextureCanvasManager.ZOOM_KEYBOARD_SPEED * _this._scale;
|
|
|
+ }
|
|
|
+ if (kbInfo.event.key == "-") {
|
|
|
+ _this._scale += TextureCanvasManager.ZOOM_KEYBOARD_SPEED * _this._scale;
|
|
|
+ }
|
|
|
+ _this._scale = Math.min(Math.max(_this._scale, TextureCanvasManager.MIN_SCALE), TextureCanvasManager.MAX_SCALE);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ TextureCanvasManager.prototype.dispose = function () {
|
|
|
+ if (this._planeMaterial) {
|
|
|
+ this._planeMaterial.dispose();
|
|
|
+ }
|
|
|
+ this._texture.dispose();
|
|
|
+ this._plane.dispose();
|
|
|
+ this._camera.dispose();
|
|
|
+ this._scene.dispose();
|
|
|
+ this._engine.dispose();
|
|
|
+ };
|
|
|
+ TextureCanvasManager.ZOOM_MOUSE_SPEED = 0.0005;
|
|
|
+ TextureCanvasManager.ZOOM_KEYBOARD_SPEED = 0.2;
|
|
|
+ TextureCanvasManager.PAN_SPEED = 0.002;
|
|
|
+ TextureCanvasManager.PAN_BUTTON = 0; // left mouse button
|
|
|
+ TextureCanvasManager.MIN_SCALE = 0.01;
|
|
|
+ TextureCanvasManager.MAX_SCALE = 10;
|
|
|
+ return TextureCanvasManager;
|
|
|
+}());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
+/***/ "./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss":
|
|
|
+/*!****************************************************************************************!*\
|
|
|
+ !*** ./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss ***!
|
|
|
+ \****************************************************************************************/
|
|
|
+/*! no static exports found */
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+var api = __webpack_require__(/*! ../../../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
|
|
|
+ var content = __webpack_require__(/*! !../../../../../../../../node_modules/css-loader/dist/cjs.js!../../../../../../../../node_modules/sass-loader/dist/cjs.js!./textureEditor.scss */ "../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss");
|
|
|
+
|
|
|
+ content = content.__esModule ? content.default : content;
|
|
|
+
|
|
|
+ if (typeof content === 'string') {
|
|
|
+ content = [[module.i, content, '']];
|
|
|
+ }
|
|
|
+
|
|
|
+var options = {};
|
|
|
+
|
|
|
+options.insert = "head";
|
|
|
+options.singleton = false;
|
|
|
+
|
|
|
+var update = api(content, options);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+module.exports = content.locals || {};
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
+/***/ "./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx":
|
|
|
+/*!************************************************************************************************!*\
|
|
|
+ !*** ./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx ***!
|
|
|
+ \************************************************************************************************/
|
|
|
+/*! exports provided: TextureEditorComponent */
|
|
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+__webpack_require__.r(__webpack_exports__);
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextureEditorComponent", function() { return TextureEditorComponent; });
|
|
|
+/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
|
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
|
|
|
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
+/* harmony import */ var _textureCanvasManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textureCanvasManager */ "./components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.ts");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+__webpack_require__(/*! ./textureEditor.scss */ "./components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss");
|
|
|
+var TextureEditorComponent = /** @class */ (function (_super) {
|
|
|
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TextureEditorComponent, _super);
|
|
|
+ function TextureEditorComponent() {
|
|
|
+ var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
|
+ _this.reactCanvas = react__WEBPACK_IMPORTED_MODULE_1__["createRef"]();
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ TextureEditorComponent.prototype.componentDidMount = function () {
|
|
|
+ this._textureCanvasManager = new _textureCanvasManager__WEBPACK_IMPORTED_MODULE_2__["TextureCanvasManager"](this.reactCanvas.current, this.props.texture);
|
|
|
+ };
|
|
|
+ TextureEditorComponent.prototype.componentWillUnmount = function () {
|
|
|
+ this._textureCanvasManager.dispose();
|
|
|
+ };
|
|
|
+ TextureEditorComponent.prototype.render = function () {
|
|
|
+ return react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { id: 'texture-editor' },
|
|
|
+ react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("canvas", { id: "texture-canvas", ref: this.reactCanvas, tabIndex: 1 }));
|
|
|
+ };
|
|
|
+ return TextureEditorComponent;
|
|
|
+}(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
/***/ "./components/actionTabs/tabs/propertyGrids/meshes/bonePropertyGridComponent.tsx":
|
|
|
/*!***************************************************************************************!*\
|
|
|
!*** ./components/actionTabs/tabs/propertyGrids/meshes/bonePropertyGridComponent.tsx ***!
|
|
@@ -72790,15 +72970,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
|
|
|
/* harmony import */ var _lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lines/buttonLineComponent */ "./components/actionTabs/lines/buttonLineComponent.tsx");
|
|
|
/* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lines/checkBoxLineComponent */ "./components/actionTabs/lines/checkBoxLineComponent.tsx");
|
|
|
-/* harmony import */ var babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants */ "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants");
|
|
|
-/* harmony import */ var babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
|
|
|
|
|
|
|
|
// import { OptionsLineComponent } from '../../lines/optionsLineComponent';
|
|
|
|
|
|
|
|
|
-
|
|
|
var VariantsPropertyGridComponent = /** @class */ (function (_super) {
|
|
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(VariantsPropertyGridComponent, _super);
|
|
|
function VariantsPropertyGridComponent(props) {
|
|
@@ -72807,13 +72984,21 @@ var VariantsPropertyGridComponent = /** @class */ (function (_super) {
|
|
|
_this._selectedTags = [];
|
|
|
return _this;
|
|
|
}
|
|
|
+ VariantsPropertyGridComponent.prototype._getVariantsExtension = function () {
|
|
|
+ var _a;
|
|
|
+ return (_a = this.props.globalState) === null || _a === void 0 ? void 0 : _a.glTFLoaderExtenstions["KHR_materials_variants"];
|
|
|
+ };
|
|
|
VariantsPropertyGridComponent.prototype.render = function () {
|
|
|
var _this = this;
|
|
|
- var variants = babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5__["KHR_materials_variants"].GetAvailableVariants(this.props.host);
|
|
|
+ var extension = this._getVariantsExtension();
|
|
|
+ if (!extension) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ var variants = extension.getAvailableVariants(this.props.host);
|
|
|
if (!variants || variants.length === 0) {
|
|
|
return null;
|
|
|
}
|
|
|
- var lastPickedVariants = babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5__["KHR_materials_variants"].GetLastSelectedVariant(this.props.host);
|
|
|
+ var lastPickedVariants = extension.getLastSelectedVariant(this.props.host);
|
|
|
variants.sort(function (a, b) {
|
|
|
var aIsActive = lastPickedVariants && lastPickedVariants.indexOf ? lastPickedVariants.indexOf(a) > -1 : lastPickedVariants === a;
|
|
|
var bIsActive = lastPickedVariants && lastPickedVariants.indexOf ? lastPickedVariants.indexOf(b) > -1 : lastPickedVariants === b;
|
|
@@ -72859,7 +73044,7 @@ var VariantsPropertyGridComponent = /** @class */ (function (_super) {
|
|
|
}, onSelect: function (value) {
|
|
|
if (value) {
|
|
|
_this._selectedTags.push(v);
|
|
|
- babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5__["KHR_materials_variants"].SelectVariant(_this.props.host, v);
|
|
|
+ extension.selectVariant(_this.props.host, v);
|
|
|
}
|
|
|
else {
|
|
|
// Do something on extension?
|
|
@@ -72871,7 +73056,7 @@ var VariantsPropertyGridComponent = /** @class */ (function (_super) {
|
|
|
} }));
|
|
|
}),
|
|
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__["ButtonLineComponent"], { label: "Reset", onClick: function () {
|
|
|
- babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__WEBPACK_IMPORTED_MODULE_5__["KHR_materials_variants"].Reset(_this.props.host);
|
|
|
+ extension.reset(_this.props.host);
|
|
|
_this._selectedTags = [];
|
|
|
_this.forceUpdate();
|
|
|
} }))));
|
|
@@ -73746,6 +73931,7 @@ var GlobalState = /** @class */ (function () {
|
|
|
this.onValidationResultsUpdatedObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]();
|
|
|
this.glTFLoaderExtensionDefaults = {};
|
|
|
this.glTFLoaderDefaults = { "validate": true };
|
|
|
+ this.glTFLoaderExtenstions = {};
|
|
|
this.blockMutationUpdates = false;
|
|
|
this.selectedLineContainerTitles = [];
|
|
|
this.selectedLineContainerTitlesNoFocus = [];
|
|
@@ -73798,6 +73984,7 @@ var GlobalState = /** @class */ (function () {
|
|
|
};
|
|
|
GlobalState.prototype.prepareGLTFPlugin = function (loader) {
|
|
|
var _this = this;
|
|
|
+ this.glTFLoaderExtenstions = {};
|
|
|
var loaderState = this.glTFLoaderDefaults;
|
|
|
if (loaderState !== undefined) {
|
|
|
for (var key in loaderState) {
|
|
@@ -73811,6 +73998,7 @@ var GlobalState = /** @class */ (function () {
|
|
|
extension[key] = extensionState[key];
|
|
|
}
|
|
|
}
|
|
|
+ _this.glTFLoaderExtenstions[extension.name] = extension;
|
|
|
});
|
|
|
if (this.validationResults) {
|
|
|
this.validationResults = null;
|
|
@@ -73937,6 +74125,81 @@ var HeaderComponent = /** @class */ (function (_super) {
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
+/***/ "./components/popupComponent.tsx":
|
|
|
+/*!***************************************!*\
|
|
|
+ !*** ./components/popupComponent.tsx ***!
|
|
|
+ \***************************************/
|
|
|
+/*! exports provided: PopupComponent */
|
|
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+__webpack_require__.r(__webpack_exports__);
|
|
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return PopupComponent; });
|
|
|
+/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
|
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
|
|
|
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
+/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js");
|
|
|
+/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
+/* harmony import */ var _inspector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../inspector */ "./inspector.ts");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var PopupComponent = /** @class */ (function (_super) {
|
|
|
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PopupComponent, _super);
|
|
|
+ function PopupComponent(props) {
|
|
|
+ var _this = _super.call(this, props) || this;
|
|
|
+ _this._container = document.createElement('div');
|
|
|
+ _this._container.id = _this.props.id;
|
|
|
+ _this._window;
|
|
|
+ _this.state = {
|
|
|
+ isComponentMounted: false,
|
|
|
+ blockedByBrowser: false,
|
|
|
+ };
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ PopupComponent.prototype.componentDidMount = function () {
|
|
|
+ this.openPopup();
|
|
|
+ this.setState({ isComponentMounted: true });
|
|
|
+ };
|
|
|
+ PopupComponent.prototype.openPopup = function () {
|
|
|
+ var _this = this;
|
|
|
+ var _a = this.props, title = _a.title, size = _a.size, onClose = _a.onClose, onOpen = _a.onOpen;
|
|
|
+ var windowVariableName = "window_" + title;
|
|
|
+ this._container = _inspector__WEBPACK_IMPORTED_MODULE_3__["Inspector"]._CreatePopup(title, windowVariableName, size.width, size.height);
|
|
|
+ this._window = _inspector__WEBPACK_IMPORTED_MODULE_3__["Inspector"][windowVariableName];
|
|
|
+ if (this._window) {
|
|
|
+ onOpen(this._window);
|
|
|
+ this._window.addEventListener('beforeunload', function () { return _this._window && onClose(_this._window); });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (!this._window) {
|
|
|
+ this.setState({ blockedByBrowser: true }, function () {
|
|
|
+ if (_this.state.blockedByBrowser) {
|
|
|
+ alert("You might have blocked popups in your browser");
|
|
|
+ console.warn("Popup window couldn't be created");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ PopupComponent.prototype.componentWillUnmount = function () {
|
|
|
+ if (this._window) {
|
|
|
+ this._window.close();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ PopupComponent.prototype.render = function () {
|
|
|
+ if (!this.state.isComponentMounted || this._container === null)
|
|
|
+ return null;
|
|
|
+ return react_dom__WEBPACK_IMPORTED_MODULE_2__["createPortal"](this.props.children, this._container);
|
|
|
+ };
|
|
|
+ return PopupComponent;
|
|
|
+}(react__WEBPACK_IMPORTED_MODULE_1__["Component"]));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+
|
|
|
/***/ "./components/propertyChangedEvent.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./components/propertyChangedEvent.ts ***!
|
|
@@ -76891,17 +77154,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_image__;
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
-/***/ "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants":
|
|
|
-/*!************************************************************************************************************************************************************!*\
|
|
|
- !*** external {"root":["BABYLON","GLTF2","Loader","Extensions"],"commonjs":"babylonjs-loaders","commonjs2":"babylonjs-loaders","amd":"babylonjs-loaders"} ***!
|
|
|
- \************************************************************************************************************************************************************/
|
|
|
-/*! no static exports found */
|
|
|
-/***/ (function(module, exports) {
|
|
|
-
|
|
|
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_loaders_glTF_2_0_Extensions_KHR_materials_variants__;
|
|
|
-
|
|
|
-/***/ }),
|
|
|
-
|
|
|
/***/ "babylonjs-loaders/glTF/index":
|
|
|
/*!****************************************************************************************************************************!*\
|
|
|
!*** external {"root":"BABYLON","commonjs":"babylonjs-loaders","commonjs2":"babylonjs-loaders","amd":"babylonjs-loaders"} ***!
|