sebavan преди 5 години
родител
ревизия
9b0b9386f2

+ 1 - 1
Tools/Gulp/helpers/gulp-validateTypedoc.js

@@ -221,7 +221,7 @@ Validate.prototype.validateTypedocNamespace = function(namespace) {
         containerNode = namespace.children[a];
 
         // Validate Sub Module
-        if (containerNode.kindString === "Module") {
+        if (containerNode.kindString === "Module" || containerNode.kindString === "Namespace") {
             this.validateTypedocNamespace(containerNode);
             continue;
         }

+ 1 - 1
Viewer/src/model/viewerModel.ts

@@ -654,7 +654,7 @@ export class ViewerModel implements IDisposable {
 
         this.rootMesh.animations = animations;
 
-        if (this.rootMesh.getScene().beginAnimation) {
+        if (this.rootMesh.getScene().beginAnimation !== undefined) {
             let animatable: Animatable = this.rootMesh.getScene().beginAnimation(this.rootMesh, 0, this._frameRate * duration, false, 1, () => {
                 if (onAnimationEnd) {
                     onAnimationEnd();

+ 1 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/animations/animationPropertyGridComponent.tsx

@@ -200,7 +200,7 @@ export class AnimationGridComponent extends React.Component<IAnimationGridCompon
                                     id="curve-editor"
                                     title="Curve Animation Editor"
                                     size={{ width: 1024, height: 490 }}
-                                    onOpen={(window: Window) => { window.console.log("Window opened!!") }}
+                                    onOpen={(window: Window) => {  }}
                                     onClose={(window: Window) => this.onCloseAnimationCurveEditor(window)}>
 
                                     <AnimationCurveEditorComponent 

+ 2 - 4
inspector/src/components/actionTabs/tabs/propertyGrids/animations/targetedAnimationPropertyGridComponent.tsx

@@ -42,9 +42,7 @@ export class TargetedAnimationGridComponent extends React.Component<ITargetedAni
 
     onCloseAnimationCurveEditor(window: Window | null) {
         this._isCurveEditorOpen = false;
-        if (window === null) {
-            console.log("Window already closed");
-        } else {
+        if (window !== null) {
             window.close();
         }
     }
@@ -94,7 +92,7 @@ export class TargetedAnimationGridComponent extends React.Component<ITargetedAni
                             id="curve-editor"
                             title="Curve Animation Editor"
                             size={{ width: 1024, height: 512 }}
-                            onOpen={(window: Window) => { window.console.log("Window opened!!") }}
+                            onOpen={(window: Window) => {  }}
                             onClose={(window: Window) => this.onCloseAnimationCurveEditor(window)}>
 
                             <AnimationCurveEditorComponent

+ 1 - 2
nodeEditor/src/graphEditor.tsx

@@ -610,7 +610,7 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
     createPopUp = () => {
         const userOptions = {
             original: true,
-            popup: false,
+            popup: true,
             overlay: false,
             embedMode: false,
             enableClose: true,
@@ -620,7 +620,6 @@ export class GraphEditor extends React.Component<IGraphEditorProps, IGraphEditor
         };
         const options = {
             embedHostWidth: "100%",
-            popup: true,
             ...userOptions
         };
         const popUpWindow = this.createPopupWindow("PREVIEW AREA", "_PreviewHostWindow");

+ 61 - 61
package.json

@@ -36,78 +36,78 @@
     "readme": "Babylon.js is a 3D engine based on webgl and javascript",
     "readmeFilename": "README.md",
     "devDependencies": {
-        "@fortawesome/fontawesome-svg-core": "~1.2.8",
-        "@fortawesome/free-regular-svg-icons": "~5.4.1",
-        "@fortawesome/free-solid-svg-icons": "~5.4.1",
-        "@fortawesome/react-fontawesome": "~0.1.3",
-        "@types/chai": "^4.1.0",
-        "@types/dagre": "^0.7.42",
-        "@types/mocha": "2.2.46",
-        "@types/node": "^10.5.3",
-        "@types/react": "~16.7.3",
-        "@types/react-color": "^3.0.1",
-        "@types/react-dom": "~16.0.9",
-        "@types/sinon": "^4.1.3",
-        "ajv": "^6.9.1",
+        "@fortawesome/fontawesome-svg-core": "~1.2.28",
+        "@fortawesome/free-regular-svg-icons": "~5.13.0",
+        "@fortawesome/free-solid-svg-icons": "~5.13.0",
+        "@fortawesome/react-fontawesome": "~0.1.10",
+        "@types/chai": "^4.2.11",
+        "@types/dagre": "^0.7.44",
+        "@types/mocha": "^7.0.2",
+        "@types/node": "^14.0.11",
+        "@types/react": "~16.9.35",
+        "@types/react-color": "^3.0.2",
+        "@types/react-dom": "^16.9.8",
+        "@types/sinon": "^9.0.4",
+        "ajv": "^6.12.2",
         "awesome-typescript-loader": "^5.2.1",
-        "base64-font-loader": "0.0.4",
-        "chai": "^4.1.2",
-        "clean-webpack-plugin": "^0.1.19",
+        "base64-font-loader": "^0.0.4",
+        "chai": "^4.2.0",
+        "clean-webpack-plugin": "^3.0.0",
         "color-support": "^1.1.3",
-        "css-loader": "^1.0.0",
-        "dagre": "0.8.4",
-        "del": "3.0.0",
-        "dependency-cruiser": "^5.2.3",
+        "css-loader": "^3.5.3",
+        "dagre": "^0.8.5",
+        "del": "^5.1.0",
+        "dependency-cruiser": "^9.4.0",
         "dts-bundle": "^0.7.3",
-        "file-loader": "~2.0.0",
-        "fs-extra": "^5.0.0",
+        "file-loader": "~6.0.0",
+        "fs-extra": "^9.0.1",
         "gif.js.optimized": "^1.0.1",
-        "gulp": "^4.0.0",
+        "gulp": "^4.0.2",
         "gulp-concat": "~2.6.1",
-        "gulp-connect": "^5.6.1",
-        "gulp-filter": "^5.1.0",
-        "gulp-rename": "^1.4.0",
+        "gulp-connect": "^5.7.0",
+        "gulp-filter": "^6.0.0",
+        "gulp-rename": "^2.0.0",
         "gulp-replace": "~1.0.0",
-        "gulp-tslint": "^8.1.3",
-        "gulp-typedoc": "^2.2.3",
+        "gulp-tslint": "^8.1.4",
+        "gulp-typedoc": "^2.2.5",
         "gulp-typescript": "4.0.2",
-        "karma": "^4.0.1",
-        "karma-browserstack-launcher": "^1.4.0",
+        "karma": "^5.0.9",
+        "karma-browserstack-launcher": "^1.6.0",
         "karma-chai": "^0.1.0",
-        "karma-chrome-launcher": "^2.2.0",
+        "karma-chrome-launcher": "^3.1.0",
         "karma-firefox-launcher": "github:karma-runner/karma-firefox-launcher#master",
-        "karma-mocha": "^1.3.0",
+        "karma-mocha": "^2.0.1",
         "karma-sinon": "^1.0.5",
-        "merge2": "~1.2.2",
-        "mini-css-extract-plugin": "^0.4.1",
-        "minimist": "^1.2.0",
-        "mocha": "^5.2.0",
-        "node-sass": "^4.13.1",
+        "merge2": "~1.4.1",
+        "mini-css-extract-plugin": "^0.9.0",
+        "minimist": "^1.2.5",
+        "mocha": "^7.2.0",
+        "node-sass": "^4.14.1",
         "plugin-error": "^1.0.1",
         "prompt": "^1.0.0",
         "re-resizable": "~4.9.1",
-        "react": "~16.9.0",
-        "react-color": "^2.18.0",
-        "react-contextmenu": "~2.10.0",
-        "react-dom": "~16.9.0",
-        "sass-loader": "^7.1.0",
-        "shelljs": "^0.8.3",
-        "sinon": "^6.1.4",
-        "split.js": "^1.5.9",
-        "style-loader": "^0.21.0",
-        "svg-url-loader": "^4.0.0",
-        "through2": "~2.0.3",
-        "ts-loader": "^5.2.1",
-        "tslib": "^1.10.0",
-        "tslint": "^5.11.0",
-        "typedoc": "^0.15.4",
-        "typescript": "~3.8.3",
-        "webpack": "~4.42.0",
-        "webpack-bundle-analyzer": "^3.1.0",
-        "webpack-cli": "^3.3.9",
-        "webpack-dev-server": "^3.1.14",
-        "webpack-stream": "~5.2.0",
-        "xhr2": "^0.1.4",
-        "xmlbuilder": "8.2.2"
+        "react": "~16.13.1",
+        "react-color": "^2.18.1",
+        "react-contextmenu": "~2.14.0",
+        "react-dom": "~16.13.1",
+        "sass-loader": "^8.0.2",
+        "shelljs": "^0.8.4",
+        "sinon": "^9.0.2",
+        "split.js": "^1.5.11",
+        "style-loader": "^1.2.1",
+        "svg-url-loader": "^6.0.0",
+        "through2": "~3.0.1",
+        "ts-loader": "^7.0.5",
+        "tslib": ">=1.10.0",
+        "tslint": "^6.1.2",
+        "typedoc": "^0.17.7",
+        "typescript": "~3.9.5",
+        "webpack": "~4.43.0",
+        "webpack-bundle-analyzer": "^3.8.0",
+        "webpack-cli": "^3.3.11",
+        "webpack-dev-server": "^3.11.0",
+        "webpack-stream": "~5.2.1",
+        "xhr2": "^0.2.0",
+        "xmlbuilder": "15.1.1"
     }
-}
+}

+ 1 - 1
src/Audio/audioEngine.ts

@@ -230,7 +230,7 @@ export class AudioEngine implements IAudioEngine {
 
     private _resumeAudioContext(): Promise<void> {
         let result: Promise<void>;
-        if (this._audioContext!.resume) {
+        if (this._audioContext!.resume !== undefined) {
             result = this._audioContext!.resume();
         }
         return result! || Promise.resolve();

+ 2 - 2
src/Engines/engine.ts

@@ -1331,7 +1331,7 @@ export class Engine extends ThinEngine {
                 }
             }
 
-            if (this.onResizeObservable.hasObservers) {
+            if (this.onResizeObservable.hasObservers()) {
                 this.onResizeObservable.notifyObservers(this);
             }
         }
@@ -1852,7 +1852,7 @@ export class Engine extends ThinEngine {
 
         this._renderingCanvas.setAttribute("touch-action", "none");
         this._renderingCanvas.style.touchAction = "none";
-        this._renderingCanvas.style.msTouchAction = "none";
+        (this._renderingCanvas.style as any).msTouchAction = "none";
     }
 
     // Loading screen

+ 1 - 1
src/Engines/thinEngine.ts

@@ -484,7 +484,7 @@ export class ThinEngine {
 
         options = options || {};
 
-        if ((<HTMLCanvasElement>canvasOrContext).getContext) {
+        if ((canvasOrContext as any).getContext) {
             canvas = <HTMLCanvasElement>canvasOrContext;
             this._renderingCanvas = canvas;
 

+ 1 - 1
src/Loading/sceneLoader.ts

@@ -412,7 +412,7 @@ export class SceneLoader {
         const registeredPlugin = pluginExtension ? SceneLoader._getPluginForExtension(pluginExtension) : (directLoad ? SceneLoader._getPluginForDirectLoad(fileInfo.name) : SceneLoader._getPluginForFilename(fileInfo.name));
 
         let plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync;
-        if ((registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin) {
+        if ((registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin !== undefined) {
             plugin = (registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin();
         }
         else {

+ 5 - 1
src/Materials/Textures/dynamicTexture.ts

@@ -208,7 +208,7 @@ export class DynamicTexture extends Texture {
         }
 
         const serializationObject = super.serialize();
-        if ((this._canvas as HTMLCanvasElement).toDataURL) {
+        if (this._IsCanvasElement(this._canvas)) {
             serializationObject.base64String = (this._canvas as HTMLCanvasElement).toDataURL();
         }
 
@@ -218,6 +218,10 @@ export class DynamicTexture extends Texture {
         return serializationObject;
     }
 
+    private _IsCanvasElement(canvas: HTMLCanvasElement | OffscreenCanvas): canvas is HTMLCanvasElement {
+        return (canvas as HTMLCanvasElement).toDataURL !== undefined;
+    }
+
     /** @hidden */
     public _rebuild(): void {
         this.update();

+ 6 - 3
src/Meshes/subMesh.ts

@@ -219,9 +219,8 @@ export class SubMesh implements ICullable {
 
         if (rootMaterial === null || rootMaterial === undefined) {
             return this._mesh.getScene().defaultMaterial;
-        } else if ((<MultiMaterial>rootMaterial).getSubMaterial) {
-            var multiMaterial = <MultiMaterial>rootMaterial;
-            var effectiveMaterial = multiMaterial.getSubMaterial(this.materialIndex);
+        } else if (this._IsMultiMaterial(rootMaterial)) {
+            var effectiveMaterial = rootMaterial.getSubMaterial(this.materialIndex);
 
             if (this._currentMaterial !== effectiveMaterial) {
                 this._currentMaterial = effectiveMaterial;
@@ -234,6 +233,10 @@ export class SubMesh implements ICullable {
         return rootMaterial;
     }
 
+    private _IsMultiMaterial(material: Material): material is MultiMaterial {
+        return (material as MultiMaterial).getSubMaterial !== undefined;
+    }
+
     // Methods
 
     /**

+ 1 - 1
src/Misc/virtualJoystick.ts

@@ -123,7 +123,7 @@ export class VirtualJoystick {
             VirtualJoystick.Canvas.style.top = "0px";
             VirtualJoystick.Canvas.style.left = "0px";
             VirtualJoystick.Canvas.style.zIndex = "5";
-            VirtualJoystick.Canvas.style.msTouchAction = "none";
+            (VirtualJoystick.Canvas.style as any).msTouchAction = "none";
             VirtualJoystick.Canvas.style.touchAction = "none";  // fix https://forum.babylonjs.com/t/virtualjoystick-needs-to-set-style-touch-action-none-explicitly/9562
             // Support for jQuery PEP polyfill
             VirtualJoystick.Canvas.setAttribute("touch-action", "none");

+ 1 - 1
src/Morph/morphTarget.ts

@@ -52,7 +52,7 @@ export class MorphTarget implements IAnimatable {
         var previous = this._influence;
         this._influence = influence;
 
-        if (this.onInfluenceChanged.hasObservers) {
+        if (this.onInfluenceChanged.hasObservers()) {
             this.onInfluenceChanged.notifyObservers(previous === 0 || influence === 0);
         }
     }