Browse Source

use es6 direct path

Trevor Baron 6 years ago
parent
commit
c092bad3db

+ 279 - 0
Viewer/dist/templateFreeViewer.html

@@ -0,0 +1,279 @@
+<!DOCTYPE html>
+<html lang="en">
+
+    <head>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <title>BabylonJS Viewer - Basic usage</title>
+        <style>
+            babylon {
+                max-width: 800px;
+                max-height: 500px;
+                width: 100%;
+                height: 600px;
+            }
+        </style>
+    </head>
+
+    <body>
+        <canvas id="babylon-viewer" camera.behaviors.auto-rotate="0" style="max-width: 800px; max-height: 500px; width: 100%; height: 600px;"></canvas>
+        <script src="renderOnlyViewer.js"></script>
+        <script>
+
+            var config = {
+                "Camera.Behaviour": 1,
+                "Camera.Contrast": 1,
+                "Camera.DefaultElevation": 15,
+                "Camera.ElevationLowerLimit (degrees)": -85,
+                "Camera.ElevationReturnTime (s)": 2,
+                "Camera.ElevationReturnWaitTime (s)": 3,
+                "Camera.ElevationUpperLimit (degrees)": 80,
+                "Camera.ExposureValue": 1,
+                "Camera.ExposureValueIsBrightness": false,
+                "Camera.FieldOfView (Degrees)": 45,
+                "Camera.FrameOnModelLoad": true,
+                "Camera.FramingBehaviour": 0,
+                "Camera.FramingElevation": 15,
+                "Camera.FramingPositionY": 0.5,
+                "Camera.FramingRadius": 1,
+                "Camera.FramingRotation": -90,
+                "Camera.FramingTime": 0,
+                "Camera.IdleRotationSpeed (degrees/s)": 0,
+                "Camera.IdleRotationSpinupTime (s)": 2.5,
+                "Camera.IdleRotationWaitTime (s)": 4,
+                "Camera.MaxDistance": 5,
+                "Camera.MinDistance": 0.5,
+                "Camera.State.Position.X": 0,
+                "Camera.State.Position.Y": 0,
+                "Camera.State.Position.Z": 0,
+                "Camera.State.Rotation.W": 1,
+                "Camera.State.Rotation.X": 0,
+                "Camera.State.Rotation.Y": 0,
+                "Camera.State.Rotation.Z": 0,
+                "Camera.ToneMappingEnabled": false,
+                "Camera.ZoomStopsAnimation": false,
+                "ColorGrading.ColorFilterDensityGlobal": 1,
+                "ColorGrading.ColorFilterDensityHighlights": 1,
+                "ColorGrading.ColorFilterDensityMidtones": 1,
+                "ColorGrading.ColorFilterDensityShadows": 1,
+                "ColorGrading.ColorFilterHueGlobal": 1,
+                "ColorGrading.ColorFilterHueHighlights": 0,
+                "ColorGrading.ColorFilterHueMidtones": 0,
+                "ColorGrading.ColorFilterHueShadows": 0,
+                "ColorGrading.ExposureHighlights": 1,
+                "ColorGrading.ExposureMidtones": 1,
+                "ColorGrading.ExposureShadows": 1,
+                "ColorGrading.SaturationGlobal": 1,
+                "ColorGrading.SaturationHighlights": 1,
+                "ColorGrading.SaturationMidtones": 1,
+                "ColorGrading.SaturationShadows": 1,
+                "ColorGrading.TransformData": "",
+                "ColorGrading.TransformDataFormat": "",
+                "ColorGrading.TransformWeight": 1,
+                "Environment.BackgroundClearColorFallback": [
+                    1,
+                    1,
+                    1
+                ],
+                "Environment.Ground_Noise": true,
+                "Environment.Ground_OpacityLevel": 1,
+                "Environment.Ground_PrimaryColor": [
+                    0.847,
+                    0.843,
+                    0.843
+                ],
+                "Environment.Ground_PrimaryLevel": 1,
+                "Environment.Ground_ReflectionLevel": 1,
+                "Environment.Ground_SecondaryColor": [
+                    0,
+                    0,
+                    0
+                ],
+                "Environment.Ground_SecondaryLevel": 0,
+                "Environment.Ground_ShadowLevel": 0,
+                "Environment.Ground_TertiaryColor": [
+                    0,
+                    0,
+                    0
+                ],
+                "Environment.Ground_TertiaryLevel": 0,
+                "Environment.Ground_Texture": "Ground_1.0-1024.png",
+                "Environment.Ground_TextureInGamma": false,
+                "Environment.Ground_UseRGBColor": false,
+                "Environment.RotationAroundY": 0,
+                "Environment.Skybox_Noise": false,
+                "Environment.Skybox_PrimaryColor": [
+                    0.847,
+                    0.843,
+                    0.843
+                ],
+                "Environment.Skybox_PrimaryLevel": 1.5,
+                "Environment.Skybox_SecondaryColor": [
+                    0,
+                    0,
+                    0
+                ],
+                "Environment.Skybox_SecondaryLevel": 0,
+                "Environment.Skybox_TertiaryColor": [
+                    0,
+                    0,
+                    0
+                ],
+                "Environment.Skybox_TertiaryLevel": 0,
+                "Environment.Skybox_Texture": "Skybox_1.0-128.dds",
+                "Environment.Skybox_TextureInGamma": false,
+                "Environment.Skybox_UseRGBColor": false,
+                "GroundPlane.BottomGridOpacity": 1,
+                "GroundPlane.BottomVisible": false,
+                "ImageProcessing.BloomEnabled": false,
+                "ImageProcessing.BloomQuality": 2,
+                "ImageProcessing.BloomWeight": 0,
+                "ImageProcessing.Enabled": true,
+                "ImageProcessing.PlanarReflectionBlur": true,
+                "ImageProcessing.PlanarReflectionDirect": false,
+                "ImageProcessing.PlanarReflectionEnabled": true,
+                "ImageProcessing.PlanarReflectionQuality": 2,
+                "ImageProcessing.PlanarReflectionWeight": 0.8,
+                "ImageProcessing.VignetteBlendMode": 0,
+                "ImageProcessing.VignetteCentreX": 0,
+                "ImageProcessing.VignetteCentreY": 0,
+                "ImageProcessing.VignetteColorA": 1,
+                "ImageProcessing.VignetteColorB": 1,
+                "ImageProcessing.VignetteColorG": 1,
+                "ImageProcessing.VignetteColorR": 1,
+                "ImageProcessing.VignetteStretch": 0.5,
+                "ImageProcessing.VignetteWeight": 0,
+                "Lighting.BackgroundColorAmount": 1,
+                "Lighting.BackgroundColorB": 1,
+                "Lighting.BackgroundColorG": 1,
+                "Lighting.BackgroundColorR": 1,
+                "Lighting.BackgroundLighting": 0.75,
+                "Lighting.BackgroundShadowAmount": 0.075,
+                "Lighting.BackgroundShadowFalloff": 1,
+                "Lighting.DirectEnabled": true,
+                "Lighting.DirectIntensity": 1,
+                "Lighting.EmissiveIntensity": 1,
+                "Lighting.EnvironmentColorB": 1,
+                "Lighting.EnvironmentColorG": 1,
+                "Lighting.EnvironmentColorR": 1,
+                "Lighting.EnvironmentEnabled": true,
+                "Lighting.EnvironmentIndex": 0,
+                "Lighting.EnvironmentIntensity": 5.5,
+                "Lighting.EnvironmentRotation": -5,
+                "Lighting.Light0_CameraOrientationTracking": 0,
+                "Lighting.Light0_CameraRelative": false,
+                "Lighting.Light0_ColorB": 1,
+                "Lighting.Light0_ColorG": 1,
+                "Lighting.Light0_ColorR": 1,
+                "Lighting.Light0_Enabled": true,
+                "Lighting.Light0_FrustumEdgeFalloff": 1,
+                "Lighting.Light0_Intensity": 80,
+                "Lighting.Light0_IntensityMode": 0,
+                "Lighting.Light0_PositionX": -8,
+                "Lighting.Light0_PositionY": 9,
+                "Lighting.Light0_PositionZ": -8,
+                "Lighting.Light0_Radius": 3.3,
+                "Lighting.Light0_ShadowBufferSize": 512,
+                "Lighting.Light0_ShadowEnabled": true,
+                "Lighting.Light0_ShadowFarClip": 10,
+                "Lighting.Light0_ShadowFieldOfView": 15,
+                "Lighting.Light0_ShadowFrustumSize": 2,
+                "Lighting.Light0_ShadowNearClip": 1,
+                "Lighting.Light0_SpotAngle": 60,
+                "Lighting.Light0_TargetX": 0,
+                "Lighting.Light0_TargetY": 0,
+                "Lighting.Light0_TargetZ": 0,
+                "Lighting.Light0_Type": 0,
+                "Lighting.Light1_CameraOrientationTracking": 0,
+                "Lighting.Light1_CameraRelative": false,
+                "Lighting.Light1_ColorB": 1,
+                "Lighting.Light1_ColorG": 1,
+                "Lighting.Light1_ColorR": 1,
+                "Lighting.Light1_Enabled": true,
+                "Lighting.Light1_FrustumEdgeFalloff": 1,
+                "Lighting.Light1_Intensity": 1,
+                "Lighting.Light1_IntensityMode": 0,
+                "Lighting.Light1_PositionX": 5,
+                "Lighting.Light1_PositionY": 1.3,
+                "Lighting.Light1_PositionZ": 0.26,
+                "Lighting.Light1_Radius": 0.85,
+                "Lighting.Light1_ShadowBufferSize": 512,
+                "Lighting.Light1_ShadowEnabled": false,
+                "Lighting.Light1_ShadowFarClip": 10,
+                "Lighting.Light1_ShadowFieldOfView": 15,
+                "Lighting.Light1_ShadowFrustumSize": 2,
+                "Lighting.Light1_ShadowNearClip": 0.2,
+                "Lighting.Light1_SpotAngle": 35,
+                "Lighting.Light1_TargetX": 0,
+                "Lighting.Light1_TargetY": 0,
+                "Lighting.Light1_TargetZ": 0,
+                "Lighting.Light1_Type": 0,
+                "Lighting.Light2_CameraOrientationTracking": 0,
+                "Lighting.Light2_CameraRelative": false,
+                "Lighting.Light2_ColorB": 1,
+                "Lighting.Light2_ColorG": 1,
+                "Lighting.Light2_ColorR": 1,
+                "Lighting.Light2_Enabled": true,
+                "Lighting.Light2_FrustumEdgeFalloff": 1,
+                "Lighting.Light2_Intensity": 5,
+                "Lighting.Light2_IntensityMode": 0,
+                "Lighting.Light2_PositionX": 0.5,
+                "Lighting.Light2_PositionY": 0,
+                "Lighting.Light2_PositionZ": 4.5,
+                "Lighting.Light2_Radius": 1.2,
+                "Lighting.Light2_ShadowBufferSize": 512,
+                "Lighting.Light2_ShadowEnabled": false,
+                "Lighting.Light2_ShadowFarClip": 10,
+                "Lighting.Light2_ShadowFieldOfView": 15,
+                "Lighting.Light2_ShadowFrustumSize": 2,
+                "Lighting.Light2_ShadowNearClip": 0.2,
+                "Lighting.Light2_SpotAngle": 42,
+                "Lighting.Light2_TargetX": 0,
+                "Lighting.Light2_TargetY": 0,
+                "Lighting.Light2_TargetZ": 0,
+                "Lighting.Light2_Type": 0,
+                "Lighting.MasterEnabled": true,
+                "Model.PositionAlignBase": true,
+                "Model.PositionOffsetX": 0,
+                "Model.PositionOffsetY": 0,
+                "Model.PositionOffsetZ": 0,
+                "Model.RelativeModelLoadScale": 1,
+                "Model.RotationOffsetAngle": 210,
+                "Model.RotationOffsetAxisX": 0,
+                "Model.RotationOffsetAxisY": 1,
+                "Model.RotationOffsetAxisZ": 0,
+                "Renderer.ClearColorA": 1,
+                "Renderer.ClearColorB": 0.3137,
+                "Renderer.ClearColorG": 0.2902,
+                "Renderer.ClearColorOverride": false,
+                "Renderer.ClearColorR": 0.2706
+            }
+            
+            // Create viewer with a canvas element
+            var viewer = new BabylonViewer.TemplateFreeViewer(document.getElementById("babylon-viewer"), config);
+
+            // Initialize the viewer (this will setup the scene and load a model if its not)
+            viewer.initialize().then(()=>{
+                // Load a model
+                return viewer.loadModel({
+                    title: "Helmet",
+                    subtitle: "BabylonJS",
+                    thumbnail: "https://www.babylonjs.com/img/favicon/apple-icon-144x144.png",
+                    url: "https://www.babylonjs.com/Assets/DamagedHelmet/glTF/DamagedHelmet.gltf"
+                });
+            }).then(()=>{
+                // 1st model has been loaded, wait a second and swap to another model
+                setTimeout(() => {
+                    viewer.loadModel({
+                        title: "Rabbit",
+                        subtitle: "BabylonJS",
+                        thumbnail: "https://www.babylonjs.com/img/favicon/apple-icon-144x144.png",
+                        url: "https://playground.babylonjs.com/scenes/Rabbit.babylon"
+                    });
+                }, 1000);
+            });
+        </script>
+    </body>
+
+</html>

+ 1 - 1
Viewer/src/configuration/configuration.ts

@@ -1,4 +1,4 @@
-import { EngineOptions } from 'babylonjs';
+import { EngineOptions } from '@babylonjs/core/Engines/engine';
 import { ICameraConfiguration, IDefaultRenderingPipelineConfiguration, IGroundConfiguration, ILightConfiguration, IModelConfiguration, IObserversConfiguration, ISceneConfiguration, ISceneOptimizerConfiguration, ISkyboxConfiguration, ITemplateConfiguration, IVRConfiguration } from './interfaces';
 import { IEnvironmentMapConfiguration } from './interfaces/environmentMapConfiguration';
 

+ 2 - 1
Viewer/src/configuration/configurationContainer.ts

@@ -1,5 +1,6 @@
 import { ViewerConfiguration } from './configuration';
-import { Color3, Scene } from 'babylonjs';
+import { Color3 } from '@babylonjs/core/Maths/math';
+import { Scene } from '@babylonjs/core/scene';
 
 export class ConfigurationContainer {
 

+ 1 - 1
Viewer/src/configuration/globals.ts

@@ -1,4 +1,4 @@
-import { Engine } from "babylonjs";
+import { Engine } from "@babylonjs/core/Engines/engine";
 
 export class ViewerGlobals {
 

+ 1 - 1
Viewer/src/configuration/interfaces/defaultRenderingPipelineConfiguration.ts

@@ -1,4 +1,4 @@
-import { DepthOfFieldEffectBlurLevel } from 'babylonjs';
+import { DepthOfFieldEffectBlurLevel } from "@babylonjs/core/PostProcesses/depthOfFieldEffect";
 
 export interface IDefaultRenderingPipelineConfiguration {
     sharpenEnabled?: boolean;

+ 1 - 1
Viewer/src/configuration/mappers.ts

@@ -1,4 +1,4 @@
-import { Tools } from 'babylonjs';
+import { Tools } from '@babylonjs/core/Misc/tools';
 import { ViewerConfiguration } from './configuration';
 
 import { kebabToCamel } from '../helper/';

+ 3 - 3
Viewer/src/configuration/types/default.ts

@@ -1,7 +1,7 @@
 import { ViewerConfiguration } from '../configuration';
-import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, navbar, overlay, help, share, error } from 'babylonjs-viewer-assets';
-import { babylonFont } from 'babylonjs-viewer-assets';
-import * as images from 'babylonjs-viewer-assets';
+import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, navbar, overlay, help, share, error } from '../../assets';
+import { babylonFont } from '../../assets/font';
+import * as images from '../../assets/img';
 
 /**
  * The default configuration of the viewer, including templates (canvas, overly, loading screen)

+ 1 - 1
Viewer/src/configuration/types/extended.ts

@@ -1,5 +1,5 @@
 import { ViewerConfiguration } from './../configuration';
-import { Tools } from 'babylonjs';
+import { Tools } from '@babylonjs/core/Misc/tools';
 
 /**
  * The viewer's "extended" configuration.

+ 1 - 2
Viewer/src/configuration/types/minimal.ts

@@ -1,6 +1,5 @@
 import { ViewerConfiguration } from './../configuration';
-import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, overlay, error } from 'babylonjs-viewer-assets';
-import { loading, close } from 'babylonjs-viewer-assets';
+import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, overlay, error, loading, close } from '../../assets';
 
 /**
  * The minimal configuration needed to make the viewer work.

+ 2 - 2
Viewer/src/index.ts

@@ -17,10 +17,10 @@ import { registerCustomOptimizer } from './optimizer/custom';
  * An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.
  */
 
-import * as BABYLON from 'babylonjs';
+import * as BABYLON from '@babylonjs/core';
 
 // load needed modules.
-import 'babylonjs-loaders';
+import '@babylonjs/loaders';
 import 'pepjs';
 
 import { initListeners, InitTags } from './initializer';

+ 2 - 1
Viewer/src/labs/environmentSerializer.ts

@@ -1,4 +1,5 @@
-import { Vector3, Tools } from "babylonjs";
+import { Vector3 } from '@babylonjs/core/Maths/math';
+import { Tools } from '@babylonjs/core/Misc/tools';
 import { TextureCube, PixelFormat, PixelType } from './texture';
 
 /**

+ 6 - 1
Viewer/src/labs/texture.ts

@@ -1,4 +1,9 @@
-import { Scene, CubeTexture, InternalTexture, Scalar, BaseTexture, Texture } from "babylonjs";
+import { Scene } from "@babylonjs/core/scene";
+import { CubeTexture } from "@babylonjs/core/Materials/Textures/cubeTexture";
+import { InternalTexture } from "@babylonjs/core/Materials/Textures/internalTexture";
+import { Scalar } from "@babylonjs/core/Maths/math.scalar";
+import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
+import { Texture } from "@babylonjs/core/Materials/Textures/texture";
 
 /**
  * WebGL Pixel Formats

+ 5 - 2
Viewer/src/labs/viewerLabs.ts

@@ -1,8 +1,11 @@
 import { PBREnvironment, EnvironmentDeserializer } from "./environmentSerializer";
-
-import { Tools, Quaternion, ShadowLight, Vector3, Axis, Matrix, SphericalPolynomial, Tmp, Scene } from 'babylonjs';
+import { Scene } from "@babylonjs/core/scene";
+import { Vector3, Quaternion, Axis, Matrix, Tmp } from "@babylonjs/core/Maths/math";
+import { SphericalPolynomial } from "@babylonjs/core/Maths/sphericalPolynomial";
+import { ShadowLight } from "@babylonjs/core/Lights/shadowLight";
 import { TextureUtils } from "./texture";
 
+
 /**
  * The ViewerLabs class will hold functions that are not (!) backwards compatible.
  * The APIs in all labs-related classes and configuration  might change.

+ 2 - 2
Viewer/src/loader/plugins/applyMaterialConfig.ts

@@ -1,7 +1,7 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, Material } from 'babylonjs';
-
 import { ViewerModel } from '../../model/viewerModel';
 import { ILoaderPlugin } from './loaderPlugin';
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from '@babylonjs/core/Loading/sceneLoader';
+import { Material } from '@babylonjs/core/Materials/material';
 
 /**
  * Force-apply material configuration right after a material was loaded.

+ 3 - 2
Viewer/src/loader/plugins/extendedMaterialLoaderPlugin.ts

@@ -1,5 +1,6 @@
-import { Engine, Material, PBRMaterial } from 'babylonjs';
-
+import { Material } from '@babylonjs/core/Materials/material';
+import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial';
+import { Engine } from '@babylonjs/core/Engines/engine';
 import { ILoaderPlugin } from './loaderPlugin';
 
 /**

+ 1 - 1
Viewer/src/loader/plugins/index.ts

@@ -3,7 +3,7 @@ import { ILoaderPlugin } from "./loaderPlugin";
 import { MSFTLodLoaderPlugin } from './msftLodLoaderPlugin';
 import { ApplyMaterialConfigPlugin } from './applyMaterialConfig';
 import { ExtendedMaterialLoaderPlugin } from './extendedMaterialLoaderPlugin';
-import { Tools } from "babylonjs";
+import { Tools } from "@babylonjs/core/Misc/tools";
 
 const pluginCache: { [key: string]: ILoaderPlugin } = {};
 

+ 6 - 2
Viewer/src/loader/plugins/loaderPlugin.ts

@@ -1,6 +1,10 @@
 import { ViewerModel } from "../../model/viewerModel";
-import { IGLTFLoaderExtension, IGLTFLoaderData } from "babylonjs-loaders";
-import { AbstractMesh, ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoaderProgressEvent, BaseTexture, Material } from "babylonjs";
+import { IGLTFLoaderExtension, IGLTFLoaderData } from "@babylonjs/loaders/glTF";
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "@babylonjs/core/Loading/sceneLoader";
+import { SceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader";
+import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
+import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
+import { Material } from "@babylonjs/core/Materials/material";
 
 /**
  * This interface defines the structure of a loader plugin.

+ 3 - 3
Viewer/src/loader/plugins/msftLodLoaderPlugin.ts

@@ -1,6 +1,6 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs';
-import { IGLTFLoaderExtension, GLTF2 } from 'babylonjs-loaders';
-
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from '@babylonjs/core/Loading/sceneLoader';
+import { IGLTFLoaderExtension } from '@babylonjs/loaders/glTF/2.0/glTFLoaderExtension';
+import { GLTF2 } from '@babylonjs/loaders/glTF';
 import { ViewerModel } from '../../model/viewerModel';
 import { ILoaderPlugin } from './loaderPlugin';
 

+ 2 - 1
Viewer/src/loader/plugins/telemetryLoaderPlugin.ts

@@ -1,7 +1,8 @@
 import { ILoaderPlugin } from "./loaderPlugin";
 import { telemetryManager } from "../../managers/telemetryManager";
 import { ViewerModel } from "../../model/viewerModel";
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, PrecisionDate } from "babylonjs";
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "@babylonjs/core/Loading/sceneLoader";
+import { PrecisionDate } from "@babylonjs/core/Misc/precisionDate";
 
 export class TelemetryLoaderPlugin implements ILoaderPlugin {
 

+ 4 - 1
Viewer/src/managers/observablesManager.ts

@@ -1,4 +1,7 @@
-import { Engine, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Observable, Scene, SceneLoaderProgressEvent } from 'babylonjs';
+import { Observable } from '@babylonjs/core/Misc/observable';
+import { Scene } from '@babylonjs/core/scene';
+import { Engine } from '@babylonjs/core/Engines/engine';
+import { SceneLoaderProgressEvent, ISceneLoaderPlugin, ISceneLoaderPluginAsync } from '@babylonjs/core/Loading/sceneLoader';
 
 import { ViewerModel } from '../model/viewerModel';
 

+ 3 - 1
Viewer/src/managers/telemetryManager.ts

@@ -1,4 +1,6 @@
-import { Engine, Observable } from "babylonjs";
+import { Observable } from "@babylonjs/core/Misc/observable";
+import { Engine } from "@babylonjs/core/Engines/engine";
+
 
 /**
  * The data structure of a telemetry event.

+ 4 - 3
Viewer/src/model/modelAnimation.ts

@@ -1,4 +1,5 @@
-import { Animatable, AnimationGroup, Vector3 } from 'babylonjs';
+import { Vector3 } from "@babylonjs/core/Maths/math";
+import { AnimationGroup, Animatable } from "@babylonjs/core/Animations";
 
 /**
  * Animation play mode enum - is the animation looping or playing once
@@ -267,10 +268,10 @@ export class GroupModelAnimation implements IModelAnimation {
      */
     restart() {
         if (this.state === AnimationState.PAUSED) {
-            this._animationGroup.restart();
+            this._animationGroup.restart();
         }
         else {
-            this.start();
+            this.start();
         }
     }
 

+ 17 - 2
Viewer/src/model/viewerModel.ts

@@ -1,5 +1,20 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, AnimationGroup, Animatable, AbstractMesh, Tools, Scene, SceneLoader, Observable, SceneLoaderProgressEvent, Tags, IParticleSystem, Skeleton, IDisposable, Nullable, Animation, Quaternion, Material, Vector3, AnimationPropertiesOverride, QuinticEase, SineEase, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, PBRMaterial, MultiMaterial } from "babylonjs";
-import { GLTFFileLoader } from "babylonjs-loaders";
+import { IDisposable } from "@babylonjs/core/scene";
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "@babylonjs/core/Loading/sceneLoader";
+import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
+import { IParticleSystem } from "@babylonjs/core/Particles/IParticleSystem";
+import { Skeleton } from "@babylonjs/core/Bones/skeleton";
+import { Observable } from "@babylonjs/core/Misc/observable";
+import { SceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader";
+import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup";
+import { Animation, Animatable, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase } from "@babylonjs/core/Animations";
+import { Nullable } from "@babylonjs/core/types";
+import { Quaternion, Vector3 } from "@babylonjs/core/Maths/math";
+import { Tags } from "@babylonjs/core/Misc/tags";
+import { Material } from "@babylonjs/core/Materials/material";
+import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial";
+import { MultiMaterial } from "@babylonjs/core/Materials/multiMaterial";
+import { Tools } from "@babylonjs/core/Misc/tools";
+import { GLTFFileLoader } from "@babylonjs/loaders/glTF";
 import { IAsset } from "babylonjs-gltf2interface";
 import { IModelConfiguration } from "../configuration/interfaces/modelConfiguration";
 import { IModelAnimationConfiguration } from "../configuration/interfaces/modelAnimationConfiguration";

+ 2 - 1
Viewer/src/optimizer/custom/extended.ts

@@ -1,4 +1,5 @@
-import { Scalar, DefaultRenderingPipeline, Scene } from 'babylonjs';
+import { DefaultRenderingPipeline } from '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline';
+import { Scalar } from '@babylonjs/core/Maths/math.scalar';
 import { SceneManager } from '../../managers/sceneManager';
 
 /**

+ 4 - 0
Viewer/src/renderOnly.ts

@@ -0,0 +1,4 @@
+import { TemplateFreeViewer } from './viewer/templateFreeViewer';
+import '@babylonjs/loaders/glTF/2.0';
+
+export { TemplateFreeViewer };

+ 1 - 1
Viewer/src/templating/plugins/printButton.ts

@@ -1,7 +1,7 @@
 import { AbstractViewerNavbarButton } from "../viewerTemplatePlugin";
 import { DefaultViewer } from "../../viewer/defaultViewer";
 import { EventCallback } from "../templateManager";
-import { Tools } from "babylonjs";
+import { Tools } from "@babylonjs/core/Misc/tools";
 
 export class PrintButtonPlugin extends AbstractViewerNavbarButton {
 

+ 2 - 2
Viewer/src/templating/templateManager.ts

@@ -1,5 +1,5 @@
-
-import { Observable, IFileRequest, Tools } from 'babylonjs';
+import { Observable } from '@babylonjs/core/Misc/observable';
+import { IFileRequest, Tools } from '@babylonjs/core/Misc/tools';
 import { isUrl, camelToKebab, kebabToCamel } from '../helper';
 
 import * as Handlebars from 'handlebars/dist/handlebars';

+ 1 - 1
Viewer/src/viewer/viewerManager.ts

@@ -1,4 +1,4 @@
-import { Observable } from 'babylonjs';
+import { Observable } from '@babylonjs/core/Misc/observable';
 import { AbstractViewer } from './viewer';
 
 /**