浏览代码

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js into ktx2-light

Popov72 5 年之前
父节点
当前提交
1ae82fb756
共有 100 个文件被更改,包括 5710 次插入1989 次删除
  1. 5 1
      Playground/src/components/rendererComponent.tsx
  2. 2 2
      Viewer/src/managers/sceneManager.ts
  3. 0 1
      Viewer/src/managers/telemetryManager.ts
  4. 0 2
      Viewer/src/templating/templateManager.ts
  5. 0 2
      Viewer/src/viewer/viewerManager.ts
  6. 1 1
      Viewer/tests/commons/helper.ts
  7. 43 31
      dist/preview release/babylon.d.ts
  8. 2 2
      dist/preview release/babylon.js
  9. 2578 214
      dist/preview release/babylon.max.js
  10. 1 1
      dist/preview release/babylon.max.js.map
  11. 87 62
      dist/preview release/babylon.module.d.ts
  12. 82 38
      dist/preview release/documentation.d.ts
  13. 1 1
      dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts
  14. 0 4
      dist/preview release/gui/babylon.gui.d.ts
  15. 2 7
      dist/preview release/gui/babylon.gui.js
  16. 1 1
      dist/preview release/gui/babylon.gui.js.map
  17. 1 1
      dist/preview release/gui/babylon.gui.min.js
  18. 0 8
      dist/preview release/gui/babylon.gui.module.d.ts
  19. 6 6
      dist/preview release/inspector/babylon.inspector.bundle.js
  20. 287 313
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  21. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  22. 21 19
      dist/preview release/inspector/babylon.inspector.d.ts
  23. 45 43
      dist/preview release/inspector/babylon.inspector.module.d.ts
  24. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  25. 40 39
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  26. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  27. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  28. 40 39
      dist/preview release/loaders/babylon.glTFFileLoader.js
  29. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  30. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  31. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  32. 1 1
      dist/preview release/loaders/babylon.stlFileLoader.min.js
  33. 40 39
      dist/preview release/loaders/babylonjs.loaders.js
  34. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  35. 2 2
      dist/preview release/loaders/babylonjs.loaders.min.js
  36. 36 0
      dist/preview release/nodeEditor/babylon.nodeEditor.d.ts
  37. 6 6
      dist/preview release/nodeEditor/babylon.nodeEditor.js
  38. 212 6
      dist/preview release/nodeEditor/babylon.nodeEditor.max.js
  39. 1 1
      dist/preview release/nodeEditor/babylon.nodeEditor.max.js.map
  40. 74 0
      dist/preview release/nodeEditor/babylon.nodeEditor.module.d.ts
  41. 1 1
      dist/preview release/packagesSizeBaseLine.json
  42. 402 30
      dist/preview release/serializers/babylon.glTF2Serializer.js
  43. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.js.map
  44. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  45. 38 2
      dist/preview release/serializers/babylonjs.serializers.d.ts
  46. 402 30
      dist/preview release/serializers/babylonjs.serializers.js
  47. 1 1
      dist/preview release/serializers/babylonjs.serializers.js.map
  48. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  49. 77 4
      dist/preview release/serializers/babylonjs.serializers.module.d.ts
  50. 87 62
      dist/preview release/viewer/babylon.module.d.ts
  51. 1 1
      dist/preview release/viewer/babylon.viewer.d.ts
  52. 521 521
      dist/preview release/viewer/babylon.viewer.js
  53. 14 14
      dist/preview release/viewer/babylon.viewer.max.js
  54. 1 1
      dist/preview release/viewer/babylon.viewer.module.d.ts
  55. 4 1
      dist/preview release/what's new.md
  56. 2 0
      gui/src/2D/controls/image.ts
  57. 0 6
      gui/src/3D/materials/fluentMaterial.ts
  58. 13 2
      inspector/src/components/actionTabs/lines/numericInputComponent.tsx
  59. 13 9
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/texturePropertyGridComponent.tsx
  60. 2 2
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar.tsx
  61. 1 1
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar.tsx
  62. 0 108
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/contrast.ts
  63. 99 0
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/contrast.tsx
  64. 0 149
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.ts
  65. 144 0
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.tsx
  66. 1 1
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/propertiesBar.tsx
  67. 1 1
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasComponent.tsx
  68. 0 75
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.ts
  69. 17 0
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss
  70. 8 6
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx
  71. 15 0
      inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings.tsx
  72. 10 0
      inspector/src/components/sceneExplorer/sceneExplorerComponent.tsx
  73. 9 3
      inspector/src/inspector.ts
  74. 1 1
      loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts
  75. 1 1
      loaders/src/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts
  76. 1 1
      loaders/src/glTF/2.0/Extensions/EXT_texture_webp.ts
  77. 1 1
      loaders/src/glTF/2.0/Extensions/ExtrasAsMetadata.ts
  78. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts
  79. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts
  80. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat.ts
  81. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_ior.ts
  82. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts
  83. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_sheen.ts
  84. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_specular.ts
  85. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_transmission.ts
  86. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts
  87. 2 2
      loaders/src/glTF/2.0/Extensions/KHR_materials_variants.ts
  88. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts
  89. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts
  90. 1 1
      loaders/src/glTF/2.0/Extensions/KHR_xmp.ts
  91. 3 3
      loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts
  92. 1 1
      loaders/src/glTF/2.0/Extensions/MSFT_lod.ts
  93. 1 1
      loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts
  94. 1 1
      loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts
  95. 3 3
      loaders/src/glTF/2.0/glTFLoader.ts
  96. 10 0
      nodeEditor/imgs/add.svg
  97. 10 0
      nodeEditor/imgs/delete.svg
  98. 75 18
      nodeEditor/src/components/nodeList/nodeList.scss
  99. 74 7
      nodeEditor/src/components/nodeList/nodeListComponent.tsx
  100. 0 0
      nodeEditor/src/graphEditor.tsx

+ 5 - 1
Playground/src/components/rendererComponent.tsx

@@ -250,7 +250,11 @@ export class RenderingComponent extends React.Component<IRenderingComponentProps
                 });
                 });
                 return;
                 return;
             } else if (globalObject.scene.then) {
             } else if (globalObject.scene.then) {
-                globalObject.scene.then(function () {});
+                globalObject.scene.then(() => {
+                    if (this._engine!.scenes[0] && displayInspector) {
+                        this.props.globalState.onInspectorRequiredObservable.notifyObservers(true);
+                    }
+                });
             } else {
             } else {
                 this._engine.scenes[0].executeWhenReady(function () {});
                 this._engine.scenes[0].executeWhenReady(function () {});
             }
             }

+ 2 - 2
Viewer/src/managers/sceneManager.ts

@@ -98,7 +98,7 @@ export class SceneManager {
     /**
     /**
      * Babylon's scene optimizer
      * Babylon's scene optimizer
      */
      */
-    public sceneOptimizer: SceneOptimizer;
+    public sceneOptimizer?: SceneOptimizer;
     /**
     /**
      * Models displayed in this viewer.
      * Models displayed in this viewer.
      */
      */
@@ -741,7 +741,7 @@ export class SceneManager {
 
 
         this.onSceneOptimizerConfiguredObservable.notifyObservers({
         this.onSceneOptimizerConfiguredObservable.notifyObservers({
             sceneManager: this,
             sceneManager: this,
-            object: this.sceneOptimizer,
+            object: this.sceneOptimizer!,
             newConfiguration: optimizerConfig
             newConfiguration: optimizerConfig
         });
         });
     }
     }

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

@@ -118,7 +118,6 @@ export class TelemetryManager {
      */
      */
     public dispose() {
     public dispose() {
         this.onEventBroadcastedObservable.clear();
         this.onEventBroadcastedObservable.clear();
-        delete this.onEventBroadcastedObservable;
     }
     }
 }
 }
 
 

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

@@ -540,8 +540,6 @@ export class Template {
                 evt.htmlElement.removeEventListener(evt.eventName, evt.function);
                 evt.htmlElement.removeEventListener(evt.eventName, evt.function);
             });
             });
         }
         }
-
-        delete this._fragment;
     }
     }
 
 
     private _getTemplateAsHtml(templateConfig: ITemplateConfiguration): Promise<string> {
     private _getTemplateAsHtml(templateConfig: ITemplateConfiguration): Promise<string> {

+ 0 - 2
Viewer/src/viewer/viewerManager.ts

@@ -98,8 +98,6 @@ export class ViewerManager {
      * dispose the manager and all of its associated viewers
      * dispose the manager and all of its associated viewers
      */
      */
     public dispose() {
     public dispose() {
-        delete this._onViewerAdded;
-
         for (let id in this._viewers) {
         for (let id in this._viewers) {
             this._viewers[id].dispose();
             this._viewers[id].dispose();
         }
         }

+ 1 - 1
Viewer/tests/commons/helper.ts

@@ -41,7 +41,7 @@ export class Helper {
     public static disposeViewer() {
     public static disposeViewer() {
         if (Helper.viewer != null) {
         if (Helper.viewer != null) {
             Helper.viewer.dispose();
             Helper.viewer.dispose();
-            delete Helper.viewer;
+            (Helper.viewer as any)= null;
         }
         }
     }
     }
 
 

+ 43 - 31
dist/preview release/babylon.d.ts

@@ -9414,7 +9414,7 @@ declare module BABYLON {
          * Internal only - manager for action
          * Internal only - manager for action
          * @hidden
          * @hidden
          */
          */
-        _actionManager: AbstractActionManager;
+        _actionManager: Nullable<AbstractActionManager>;
         /**
         /**
          * Adds action to chain of actions, may be a DoNothingAction
          * Adds action to chain of actions, may be a DoNothingAction
          * @param action defines the next action to execute
          * @param action defines the next action to execute
@@ -11663,7 +11663,6 @@ declare module BABYLON {
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      */
      */
     export class ProceduralTexture extends Texture {
     export class ProceduralTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
          * Define if the texture is enabled or not (disabled texture will not render)
          */
          */
@@ -16021,6 +16020,8 @@ declare module BABYLON {
         _numBonesWithLinkedTransformNode: number;
         _numBonesWithLinkedTransformNode: number;
         /** @hidden */
         /** @hidden */
         _hasWaitingData: Nullable<boolean>;
         _hasWaitingData: Nullable<boolean>;
+        /** @hidden */
+        _waitingOverrideMeshId: Nullable<string>;
         /**
         /**
          * Specifies if the skeleton should be serialized
          * Specifies if the skeleton should be serialized
          */
          */
@@ -23287,6 +23288,8 @@ declare module BABYLON {
         private _delayedOnLoad;
         private _delayedOnLoad;
         private _delayedOnError;
         private _delayedOnError;
         private _mimeType?;
         private _mimeType?;
+        /** Returns the texture mime type if it was defined by a loader (undefined else) */
+        get mimeType(): string | undefined;
         /**
         /**
          * Observable triggered once the texture has been loaded.
          * Observable triggered once the texture has been loaded.
          */
          */
@@ -23468,7 +23471,6 @@ declare module BABYLON {
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      */
      */
     export class RenderTargetTexture extends Texture {
     export class RenderTargetTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          */
          */
@@ -23513,10 +23515,6 @@ declare module BABYLON {
          */
          */
         renderSprites: boolean;
         renderSprites: boolean;
         /**
         /**
-         * Override the default coordinates mode to projection for RTT as it is the most common case for rendered textures.
-         */
-        coordinatesMode: number;
-        /**
          * Define the camera used to render the texture.
          * Define the camera used to render the texture.
          */
          */
         activeCamera: Nullable<Camera>;
         activeCamera: Nullable<Camera>;
@@ -23607,7 +23605,7 @@ declare module BABYLON {
         _generateMipMaps: boolean;
         _generateMipMaps: boolean;
         protected _renderingManager: RenderingManager;
         protected _renderingManager: RenderingManager;
         /** @hidden */
         /** @hidden */
-        _waitingRenderList: string[];
+        _waitingRenderList?: string[];
         protected _doNotChangeAspectRatio: boolean;
         protected _doNotChangeAspectRatio: boolean;
         protected _currentRefreshId: number;
         protected _currentRefreshId: number;
         protected _refreshRate: number;
         protected _refreshRate: number;
@@ -29374,11 +29372,13 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
+        protected _upVector: Vector3;
         /**
         /**
          * The vector the camera should consider as up.
          * The vector the camera should consider as up.
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          */
          */
-        upVector: Vector3;
+        set upVector(vec: Vector3);
+        get upVector(): Vector3;
         /**
         /**
          * Define the current limit on the left side for an orthographic camera
          * Define the current limit on the left side for an orthographic camera
          * In scene unit
          * In scene unit
@@ -32122,11 +32122,13 @@ declare module BABYLON {
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          */
          */
         enablePointerMoveEvents: boolean;
         enablePointerMoveEvents: boolean;
+        private _renderingGroupId;
         /**
         /**
          * Specifies the rendering group id for this mesh (0 by default)
          * Specifies the rendering group id for this mesh (0 by default)
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          */
          */
-        renderingGroupId: number;
+        get renderingGroupId(): number;
+        set renderingGroupId(value: number);
         private _material;
         private _material;
         /** Gets or sets current material */
         /** Gets or sets current material */
         get material(): Nullable<Material>;
         get material(): Nullable<Material>;
@@ -33858,7 +33860,7 @@ declare module BABYLON {
          * This is part of the texture as textures usually maps to one uv set.
          * This is part of the texture as textures usually maps to one uv set.
          */
          */
         coordinatesIndex: number;
         coordinatesIndex: number;
-        private _coordinatesMode;
+        protected _coordinatesMode: number;
         /**
         /**
         * How a texture is mapped.
         * How a texture is mapped.
         *
         *
@@ -33877,6 +33879,7 @@ declare module BABYLON {
         */
         */
         set coordinatesMode(value: number);
         set coordinatesMode(value: number);
         get coordinatesMode(): number;
         get coordinatesMode(): number;
+        private _wrapU;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -33884,7 +33887,9 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapU: number;
+        get wrapU(): number;
+        set wrapU(value: number);
+        private _wrapV;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -33892,7 +33897,8 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapV: number;
+        get wrapV(): number;
+        set wrapV(value: number);
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -39353,8 +39359,6 @@ declare module BABYLON {
          * The material properties need to be setup according to the type of texture in use.
          * The material properties need to be setup according to the type of texture in use.
          */
          */
         environmentBRDFTexture: BaseTexture;
         environmentBRDFTexture: BaseTexture;
-        /** @hidden */
-        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
          * Texture used in all pbr material as the reflection texture.
          * Texture used in all pbr material as the reflection texture.
          * As in the majority of the scene they are the same (exception for multi room and so on),
          * As in the majority of the scene they are the same (exception for multi room and so on),
@@ -41132,6 +41136,13 @@ declare module BABYLON {
          */
          */
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         /**
         /**
+         * Get a list of transform nodes by tags
+         * @param tagsQuery defines the tags query to use
+         * @param forEach defines a predicate used to filter results
+         * @returns an array of TransformNode
+         */
+        getTransformNodesByTags(tagsQuery: string, forEach?: (transform: TransformNode) => void): TransformNode[];
+        /**
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          *
          *
@@ -41390,10 +41401,15 @@ declare module BABYLON {
          * Textures to keep.
          * Textures to keep.
          */
          */
         textures: BaseTexture[];
         textures: BaseTexture[];
+        /** @hidden */
+        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
-         * Environment texture for the scene
+         * Texture used in all pbr material as the reflection texture.
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
          */
          */
-        environmentTexture: Nullable<BaseTexture>;
+        get environmentTexture(): Nullable<BaseTexture>;
+        set environmentTexture(value: Nullable<BaseTexture>);
         /**
         /**
          * The list of postprocesses added to the scene
          * The list of postprocesses added to the scene
          */
          */
@@ -42812,7 +42828,6 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
-        protected _upVector: Vector3;
         protected _upToYMatrix: Matrix;
         protected _upToYMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         /**
         /**
@@ -50277,7 +50292,12 @@ declare module BABYLON {
         /**
         /**
          * Ratio for the scale of the gizmo (Default: 1)
          * Ratio for the scale of the gizmo (Default: 1)
          */
          */
-        scaleRatio: number;
+        protected _scaleRatio: number;
+        /**
+         * Ratio for the scale of the gizmo (Default: 1)
+         */
+        set scaleRatio(value: number);
+        get scaleRatio(): number;
         /**
         /**
          * If a custom mesh has been set (Default: false)
          * If a custom mesh has been set (Default: false)
          */
          */
@@ -50299,10 +50319,12 @@ declare module BABYLON {
          * @param mesh The mesh to replace the default mesh of the gizmo
          * @param mesh The mesh to replace the default mesh of the gizmo
          */
          */
         setCustomMesh(mesh: Mesh): void;
         setCustomMesh(mesh: Mesh): void;
+        protected _updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
         /**
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          */
          */
-        updateGizmoRotationToMatchAttachedMesh: boolean;
+        set updateGizmoRotationToMatchAttachedMesh(value: boolean);
+        get updateGizmoRotationToMatchAttachedMesh(): boolean;
         /**
         /**
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          */
          */
@@ -50422,9 +50444,7 @@ declare module BABYLON {
          */
          */
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
         /** Fires an event when any of it's sub gizmos are dragged */
         onDragStartObservable: Observable<unknown>;
         onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
         /** Fires an event when any of it's sub gizmos are released from dragging */
@@ -50535,7 +50555,7 @@ declare module BABYLON.Debug {
         /**
         /**
          * Gets the hosting scene
          * Gets the hosting scene
          */
          */
-        scene: Scene;
+        scene: Nullable<Scene>;
         /**
         /**
          * Gets or sets a number used to scale line length
          * Gets or sets a number used to scale line length
          */
          */
@@ -53384,9 +53404,7 @@ declare module BABYLON {
         uniformScaleGizmo: AxisScaleGizmo;
         uniformScaleGizmo: AxisScaleGizmo;
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         private _uniformScalingMesh;
         private _uniformScalingMesh;
         private _octahedron;
         private _octahedron;
         private _sensitivity;
         private _sensitivity;
@@ -60234,10 +60252,6 @@ declare module BABYLON {
          * The texture URL.
          * The texture URL.
          */
          */
         url: string;
         url: string;
-        /**
-         * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.
-         */
-        coordinatesMode: number;
         protected _isBlocking: boolean;
         protected _isBlocking: boolean;
         /**
         /**
          * Sets wether or not the texture is blocking during loading.
          * Sets wether or not the texture is blocking during loading.
@@ -61342,8 +61356,6 @@ declare module BABYLON {
         private _height;
         private _height;
         /** The URL to the image. */
         /** The URL to the image. */
         url: string;
         url: string;
-        /** The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. */
-        coordinatesMode: number;
         /**
         /**
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * @param url The location of the image
          * @param url The location of the image

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/babylon.js


文件差异内容过多而无法显示
+ 2578 - 214
dist/preview release/babylon.max.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 87 - 62
dist/preview release/babylon.module.d.ts

@@ -9534,6 +9534,7 @@ declare module "babylonjs/Actions/action" {
     import { Observable } from "babylonjs/Misc/observable";
     import { Observable } from "babylonjs/Misc/observable";
     import { Condition } from "babylonjs/Actions/condition";
     import { Condition } from "babylonjs/Actions/condition";
     import { AbstractActionManager } from "babylonjs/Actions/abstractActionManager";
     import { AbstractActionManager } from "babylonjs/Actions/abstractActionManager";
+    import { Nullable } from "babylonjs/types";
     import { Scene } from "babylonjs/scene";
     import { Scene } from "babylonjs/scene";
     import { ActionManager } from "babylonjs/Actions/actionManager";
     import { ActionManager } from "babylonjs/Actions/actionManager";
     import { ActionEvent } from "babylonjs/Actions/actionEvent";
     import { ActionEvent } from "babylonjs/Actions/actionEvent";
@@ -9573,7 +9574,7 @@ declare module "babylonjs/Actions/action" {
          * Internal only - manager for action
          * Internal only - manager for action
          * @hidden
          * @hidden
          */
          */
-        _actionManager: AbstractActionManager;
+        _actionManager: Nullable<AbstractActionManager>;
         /**
         /**
          * Adds action to chain of actions, may be a DoNothingAction
          * Adds action to chain of actions, may be a DoNothingAction
          * @param action defines the next action to execute
          * @param action defines the next action to execute
@@ -11924,7 +11925,6 @@ declare module "babylonjs/Materials/Textures/Procedurals/proceduralTexture" {
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      */
      */
     export class ProceduralTexture extends Texture {
     export class ProceduralTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
          * Define if the texture is enabled or not (disabled texture will not render)
          */
          */
@@ -16443,6 +16443,8 @@ declare module "babylonjs/Bones/skeleton" {
         _numBonesWithLinkedTransformNode: number;
         _numBonesWithLinkedTransformNode: number;
         /** @hidden */
         /** @hidden */
         _hasWaitingData: Nullable<boolean>;
         _hasWaitingData: Nullable<boolean>;
+        /** @hidden */
+        _waitingOverrideMeshId: Nullable<string>;
         /**
         /**
          * Specifies if the skeleton should be serialized
          * Specifies if the skeleton should be serialized
          */
          */
@@ -24118,6 +24120,8 @@ declare module "babylonjs/Materials/Textures/texture" {
         private _delayedOnLoad;
         private _delayedOnLoad;
         private _delayedOnError;
         private _delayedOnError;
         private _mimeType?;
         private _mimeType?;
+        /** Returns the texture mime type if it was defined by a loader (undefined else) */
+        get mimeType(): string | undefined;
         /**
         /**
          * Observable triggered once the texture has been loaded.
          * Observable triggered once the texture has been loaded.
          */
          */
@@ -24320,7 +24324,6 @@ declare module "babylonjs/Materials/Textures/renderTargetTexture" {
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      */
      */
     export class RenderTargetTexture extends Texture {
     export class RenderTargetTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          */
          */
@@ -24365,10 +24368,6 @@ declare module "babylonjs/Materials/Textures/renderTargetTexture" {
          */
          */
         renderSprites: boolean;
         renderSprites: boolean;
         /**
         /**
-         * Override the default coordinates mode to projection for RTT as it is the most common case for rendered textures.
-         */
-        coordinatesMode: number;
-        /**
          * Define the camera used to render the texture.
          * Define the camera used to render the texture.
          */
          */
         activeCamera: Nullable<Camera>;
         activeCamera: Nullable<Camera>;
@@ -24459,7 +24458,7 @@ declare module "babylonjs/Materials/Textures/renderTargetTexture" {
         _generateMipMaps: boolean;
         _generateMipMaps: boolean;
         protected _renderingManager: RenderingManager;
         protected _renderingManager: RenderingManager;
         /** @hidden */
         /** @hidden */
-        _waitingRenderList: string[];
+        _waitingRenderList?: string[];
         protected _doNotChangeAspectRatio: boolean;
         protected _doNotChangeAspectRatio: boolean;
         protected _currentRefreshId: number;
         protected _currentRefreshId: number;
         protected _refreshRate: number;
         protected _refreshRate: number;
@@ -30407,11 +30406,13 @@ declare module "babylonjs/Cameras/camera" {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
+        protected _upVector: Vector3;
         /**
         /**
          * The vector the camera should consider as up.
          * The vector the camera should consider as up.
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          */
          */
-        upVector: Vector3;
+        set upVector(vec: Vector3);
+        get upVector(): Vector3;
         /**
         /**
          * Define the current limit on the left side for an orthographic camera
          * Define the current limit on the left side for an orthographic camera
          * In scene unit
          * In scene unit
@@ -33276,11 +33277,13 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          */
          */
         enablePointerMoveEvents: boolean;
         enablePointerMoveEvents: boolean;
+        private _renderingGroupId;
         /**
         /**
          * Specifies the rendering group id for this mesh (0 by default)
          * Specifies the rendering group id for this mesh (0 by default)
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          */
          */
-        renderingGroupId: number;
+        get renderingGroupId(): number;
+        set renderingGroupId(value: number);
         private _material;
         private _material;
         /** Gets or sets current material */
         /** Gets or sets current material */
         get material(): Nullable<Material>;
         get material(): Nullable<Material>;
@@ -35065,7 +35068,7 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
          * This is part of the texture as textures usually maps to one uv set.
          * This is part of the texture as textures usually maps to one uv set.
          */
          */
         coordinatesIndex: number;
         coordinatesIndex: number;
-        private _coordinatesMode;
+        protected _coordinatesMode: number;
         /**
         /**
         * How a texture is mapped.
         * How a texture is mapped.
         *
         *
@@ -35084,6 +35087,7 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
         */
         */
         set coordinatesMode(value: number);
         set coordinatesMode(value: number);
         get coordinatesMode(): number;
         get coordinatesMode(): number;
+        private _wrapU;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -35091,7 +35095,9 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapU: number;
+        get wrapU(): number;
+        set wrapU(value: number);
+        private _wrapV;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -35099,7 +35105,8 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapV: number;
+        get wrapV(): number;
+        set wrapV(value: number);
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -40731,8 +40738,6 @@ declare module "babylonjs/scene" {
          * The material properties need to be setup according to the type of texture in use.
          * The material properties need to be setup according to the type of texture in use.
          */
          */
         environmentBRDFTexture: BaseTexture;
         environmentBRDFTexture: BaseTexture;
-        /** @hidden */
-        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
          * Texture used in all pbr material as the reflection texture.
          * Texture used in all pbr material as the reflection texture.
          * As in the majority of the scene they are the same (exception for multi room and so on),
          * As in the majority of the scene they are the same (exception for multi room and so on),
@@ -42510,6 +42515,13 @@ declare module "babylonjs/scene" {
          */
          */
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         /**
         /**
+         * Get a list of transform nodes by tags
+         * @param tagsQuery defines the tags query to use
+         * @param forEach defines a predicate used to filter results
+         * @returns an array of TransformNode
+         */
+        getTransformNodesByTags(tagsQuery: string, forEach?: (transform: TransformNode) => void): TransformNode[];
+        /**
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          *
          *
@@ -42795,10 +42807,15 @@ declare module "babylonjs/abstractScene" {
          * Textures to keep.
          * Textures to keep.
          */
          */
         textures: BaseTexture[];
         textures: BaseTexture[];
+        /** @hidden */
+        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
-         * Environment texture for the scene
+         * Texture used in all pbr material as the reflection texture.
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
          */
          */
-        environmentTexture: Nullable<BaseTexture>;
+        get environmentTexture(): Nullable<BaseTexture>;
+        set environmentTexture(value: Nullable<BaseTexture>);
         /**
         /**
          * The list of postprocesses added to the scene
          * The list of postprocesses added to the scene
          */
          */
@@ -44312,7 +44329,6 @@ declare module "babylonjs/Cameras/arcRotateCamera" {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
-        protected _upVector: Vector3;
         protected _upToYMatrix: Matrix;
         protected _upToYMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         /**
         /**
@@ -52255,7 +52271,12 @@ declare module "babylonjs/Gizmos/gizmo" {
         /**
         /**
          * Ratio for the scale of the gizmo (Default: 1)
          * Ratio for the scale of the gizmo (Default: 1)
          */
          */
-        scaleRatio: number;
+        protected _scaleRatio: number;
+        /**
+         * Ratio for the scale of the gizmo (Default: 1)
+         */
+        set scaleRatio(value: number);
+        get scaleRatio(): number;
         /**
         /**
          * If a custom mesh has been set (Default: false)
          * If a custom mesh has been set (Default: false)
          */
          */
@@ -52277,10 +52298,12 @@ declare module "babylonjs/Gizmos/gizmo" {
          * @param mesh The mesh to replace the default mesh of the gizmo
          * @param mesh The mesh to replace the default mesh of the gizmo
          */
          */
         setCustomMesh(mesh: Mesh): void;
         setCustomMesh(mesh: Mesh): void;
+        protected _updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
         /**
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          */
          */
-        updateGizmoRotationToMatchAttachedMesh: boolean;
+        set updateGizmoRotationToMatchAttachedMesh(value: boolean);
+        get updateGizmoRotationToMatchAttachedMesh(): boolean;
         /**
         /**
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          */
          */
@@ -52421,9 +52444,7 @@ declare module "babylonjs/Gizmos/positionGizmo" {
          */
          */
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
         /** Fires an event when any of it's sub gizmos are dragged */
         onDragStartObservable: Observable<unknown>;
         onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
         /** Fires an event when any of it's sub gizmos are released from dragging */
@@ -52550,7 +52571,7 @@ declare module "babylonjs/Debug/axesViewer" {
         /**
         /**
          * Gets the hosting scene
          * Gets the hosting scene
          */
          */
-        scene: Scene;
+        scene: Nullable<Scene>;
         /**
         /**
          * Gets or sets a number used to scale line length
          * Gets or sets a number used to scale line length
          */
          */
@@ -55638,9 +55659,7 @@ declare module "babylonjs/Gizmos/scaleGizmo" {
         uniformScaleGizmo: AxisScaleGizmo;
         uniformScaleGizmo: AxisScaleGizmo;
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         private _uniformScalingMesh;
         private _uniformScalingMesh;
         private _octahedron;
         private _octahedron;
         private _sensitivity;
         private _sensitivity;
@@ -63036,10 +63055,6 @@ declare module "babylonjs/Materials/Textures/hdrCubeTexture" {
          * The texture URL.
          * The texture URL.
          */
          */
         url: string;
         url: string;
-        /**
-         * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.
-         */
-        coordinatesMode: number;
         protected _isBlocking: boolean;
         protected _isBlocking: boolean;
         /**
         /**
          * Sets wether or not the texture is blocking during loading.
          * Sets wether or not the texture is blocking during loading.
@@ -64219,8 +64234,6 @@ declare module "babylonjs/Materials/Textures/equiRectangularCubeTexture" {
         private _height;
         private _height;
         /** The URL to the image. */
         /** The URL to the image. */
         url: string;
         url: string;
-        /** The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. */
-        coordinatesMode: number;
         /**
         /**
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * @param url The location of the image
          * @param url The location of the image
@@ -89036,7 +89049,7 @@ declare module BABYLON {
          * Internal only - manager for action
          * Internal only - manager for action
          * @hidden
          * @hidden
          */
          */
-        _actionManager: AbstractActionManager;
+        _actionManager: Nullable<AbstractActionManager>;
         /**
         /**
          * Adds action to chain of actions, may be a DoNothingAction
          * Adds action to chain of actions, may be a DoNothingAction
          * @param action defines the next action to execute
          * @param action defines the next action to execute
@@ -91285,7 +91298,6 @@ declare module BABYLON {
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      */
      */
     export class ProceduralTexture extends Texture {
     export class ProceduralTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
          * Define if the texture is enabled or not (disabled texture will not render)
          */
          */
@@ -95643,6 +95655,8 @@ declare module BABYLON {
         _numBonesWithLinkedTransformNode: number;
         _numBonesWithLinkedTransformNode: number;
         /** @hidden */
         /** @hidden */
         _hasWaitingData: Nullable<boolean>;
         _hasWaitingData: Nullable<boolean>;
+        /** @hidden */
+        _waitingOverrideMeshId: Nullable<string>;
         /**
         /**
          * Specifies if the skeleton should be serialized
          * Specifies if the skeleton should be serialized
          */
          */
@@ -102909,6 +102923,8 @@ declare module BABYLON {
         private _delayedOnLoad;
         private _delayedOnLoad;
         private _delayedOnError;
         private _delayedOnError;
         private _mimeType?;
         private _mimeType?;
+        /** Returns the texture mime type if it was defined by a loader (undefined else) */
+        get mimeType(): string | undefined;
         /**
         /**
          * Observable triggered once the texture has been loaded.
          * Observable triggered once the texture has been loaded.
          */
          */
@@ -103090,7 +103106,6 @@ declare module BABYLON {
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      */
      */
     export class RenderTargetTexture extends Texture {
     export class RenderTargetTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          */
          */
@@ -103135,10 +103150,6 @@ declare module BABYLON {
          */
          */
         renderSprites: boolean;
         renderSprites: boolean;
         /**
         /**
-         * Override the default coordinates mode to projection for RTT as it is the most common case for rendered textures.
-         */
-        coordinatesMode: number;
-        /**
          * Define the camera used to render the texture.
          * Define the camera used to render the texture.
          */
          */
         activeCamera: Nullable<Camera>;
         activeCamera: Nullable<Camera>;
@@ -103229,7 +103240,7 @@ declare module BABYLON {
         _generateMipMaps: boolean;
         _generateMipMaps: boolean;
         protected _renderingManager: RenderingManager;
         protected _renderingManager: RenderingManager;
         /** @hidden */
         /** @hidden */
-        _waitingRenderList: string[];
+        _waitingRenderList?: string[];
         protected _doNotChangeAspectRatio: boolean;
         protected _doNotChangeAspectRatio: boolean;
         protected _currentRefreshId: number;
         protected _currentRefreshId: number;
         protected _refreshRate: number;
         protected _refreshRate: number;
@@ -108996,11 +109007,13 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
+        protected _upVector: Vector3;
         /**
         /**
          * The vector the camera should consider as up.
          * The vector the camera should consider as up.
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          */
          */
-        upVector: Vector3;
+        set upVector(vec: Vector3);
+        get upVector(): Vector3;
         /**
         /**
          * Define the current limit on the left side for an orthographic camera
          * Define the current limit on the left side for an orthographic camera
          * In scene unit
          * In scene unit
@@ -111744,11 +111757,13 @@ declare module BABYLON {
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          */
          */
         enablePointerMoveEvents: boolean;
         enablePointerMoveEvents: boolean;
+        private _renderingGroupId;
         /**
         /**
          * Specifies the rendering group id for this mesh (0 by default)
          * Specifies the rendering group id for this mesh (0 by default)
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          */
          */
-        renderingGroupId: number;
+        get renderingGroupId(): number;
+        set renderingGroupId(value: number);
         private _material;
         private _material;
         /** Gets or sets current material */
         /** Gets or sets current material */
         get material(): Nullable<Material>;
         get material(): Nullable<Material>;
@@ -113480,7 +113495,7 @@ declare module BABYLON {
          * This is part of the texture as textures usually maps to one uv set.
          * This is part of the texture as textures usually maps to one uv set.
          */
          */
         coordinatesIndex: number;
         coordinatesIndex: number;
-        private _coordinatesMode;
+        protected _coordinatesMode: number;
         /**
         /**
         * How a texture is mapped.
         * How a texture is mapped.
         *
         *
@@ -113499,6 +113514,7 @@ declare module BABYLON {
         */
         */
         set coordinatesMode(value: number);
         set coordinatesMode(value: number);
         get coordinatesMode(): number;
         get coordinatesMode(): number;
+        private _wrapU;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -113506,7 +113522,9 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapU: number;
+        get wrapU(): number;
+        set wrapU(value: number);
+        private _wrapV;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -113514,7 +113532,8 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapV: number;
+        get wrapV(): number;
+        set wrapV(value: number);
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -118975,8 +118994,6 @@ declare module BABYLON {
          * The material properties need to be setup according to the type of texture in use.
          * The material properties need to be setup according to the type of texture in use.
          */
          */
         environmentBRDFTexture: BaseTexture;
         environmentBRDFTexture: BaseTexture;
-        /** @hidden */
-        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
          * Texture used in all pbr material as the reflection texture.
          * Texture used in all pbr material as the reflection texture.
          * As in the majority of the scene they are the same (exception for multi room and so on),
          * As in the majority of the scene they are the same (exception for multi room and so on),
@@ -120754,6 +120771,13 @@ declare module BABYLON {
          */
          */
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         /**
         /**
+         * Get a list of transform nodes by tags
+         * @param tagsQuery defines the tags query to use
+         * @param forEach defines a predicate used to filter results
+         * @returns an array of TransformNode
+         */
+        getTransformNodesByTags(tagsQuery: string, forEach?: (transform: TransformNode) => void): TransformNode[];
+        /**
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          *
          *
@@ -121012,10 +121036,15 @@ declare module BABYLON {
          * Textures to keep.
          * Textures to keep.
          */
          */
         textures: BaseTexture[];
         textures: BaseTexture[];
+        /** @hidden */
+        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
-         * Environment texture for the scene
+         * Texture used in all pbr material as the reflection texture.
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
          */
          */
-        environmentTexture: Nullable<BaseTexture>;
+        get environmentTexture(): Nullable<BaseTexture>;
+        set environmentTexture(value: Nullable<BaseTexture>);
         /**
         /**
          * The list of postprocesses added to the scene
          * The list of postprocesses added to the scene
          */
          */
@@ -122434,7 +122463,6 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
-        protected _upVector: Vector3;
         protected _upToYMatrix: Matrix;
         protected _upToYMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         /**
         /**
@@ -129899,7 +129927,12 @@ declare module BABYLON {
         /**
         /**
          * Ratio for the scale of the gizmo (Default: 1)
          * Ratio for the scale of the gizmo (Default: 1)
          */
          */
-        scaleRatio: number;
+        protected _scaleRatio: number;
+        /**
+         * Ratio for the scale of the gizmo (Default: 1)
+         */
+        set scaleRatio(value: number);
+        get scaleRatio(): number;
         /**
         /**
          * If a custom mesh has been set (Default: false)
          * If a custom mesh has been set (Default: false)
          */
          */
@@ -129921,10 +129954,12 @@ declare module BABYLON {
          * @param mesh The mesh to replace the default mesh of the gizmo
          * @param mesh The mesh to replace the default mesh of the gizmo
          */
          */
         setCustomMesh(mesh: Mesh): void;
         setCustomMesh(mesh: Mesh): void;
+        protected _updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
         /**
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          */
          */
-        updateGizmoRotationToMatchAttachedMesh: boolean;
+        set updateGizmoRotationToMatchAttachedMesh(value: boolean);
+        get updateGizmoRotationToMatchAttachedMesh(): boolean;
         /**
         /**
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          */
          */
@@ -130044,9 +130079,7 @@ declare module BABYLON {
          */
          */
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
         /** Fires an event when any of it's sub gizmos are dragged */
         onDragStartObservable: Observable<unknown>;
         onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
         /** Fires an event when any of it's sub gizmos are released from dragging */
@@ -130157,7 +130190,7 @@ declare module BABYLON.Debug {
         /**
         /**
          * Gets the hosting scene
          * Gets the hosting scene
          */
          */
-        scene: Scene;
+        scene: Nullable<Scene>;
         /**
         /**
          * Gets or sets a number used to scale line length
          * Gets or sets a number used to scale line length
          */
          */
@@ -133006,9 +133039,7 @@ declare module BABYLON {
         uniformScaleGizmo: AxisScaleGizmo;
         uniformScaleGizmo: AxisScaleGizmo;
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         private _uniformScalingMesh;
         private _uniformScalingMesh;
         private _octahedron;
         private _octahedron;
         private _sensitivity;
         private _sensitivity;
@@ -139856,10 +139887,6 @@ declare module BABYLON {
          * The texture URL.
          * The texture URL.
          */
          */
         url: string;
         url: string;
-        /**
-         * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.
-         */
-        coordinatesMode: number;
         protected _isBlocking: boolean;
         protected _isBlocking: boolean;
         /**
         /**
          * Sets wether or not the texture is blocking during loading.
          * Sets wether or not the texture is blocking during loading.
@@ -140964,8 +140991,6 @@ declare module BABYLON {
         private _height;
         private _height;
         /** The URL to the image. */
         /** The URL to the image. */
         url: string;
         url: string;
-        /** The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. */
-        coordinatesMode: number;
         /**
         /**
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * @param url The location of the image
          * @param url The location of the image

+ 82 - 38
dist/preview release/documentation.d.ts

@@ -9414,7 +9414,7 @@ declare module BABYLON {
          * Internal only - manager for action
          * Internal only - manager for action
          * @hidden
          * @hidden
          */
          */
-        _actionManager: AbstractActionManager;
+        _actionManager: Nullable<AbstractActionManager>;
         /**
         /**
          * Adds action to chain of actions, may be a DoNothingAction
          * Adds action to chain of actions, may be a DoNothingAction
          * @param action defines the next action to execute
          * @param action defines the next action to execute
@@ -11663,7 +11663,6 @@ declare module BABYLON {
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      */
      */
     export class ProceduralTexture extends Texture {
     export class ProceduralTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
          * Define if the texture is enabled or not (disabled texture will not render)
          */
          */
@@ -16021,6 +16020,8 @@ declare module BABYLON {
         _numBonesWithLinkedTransformNode: number;
         _numBonesWithLinkedTransformNode: number;
         /** @hidden */
         /** @hidden */
         _hasWaitingData: Nullable<boolean>;
         _hasWaitingData: Nullable<boolean>;
+        /** @hidden */
+        _waitingOverrideMeshId: Nullable<string>;
         /**
         /**
          * Specifies if the skeleton should be serialized
          * Specifies if the skeleton should be serialized
          */
          */
@@ -23287,6 +23288,8 @@ declare module BABYLON {
         private _delayedOnLoad;
         private _delayedOnLoad;
         private _delayedOnError;
         private _delayedOnError;
         private _mimeType?;
         private _mimeType?;
+        /** Returns the texture mime type if it was defined by a loader (undefined else) */
+        get mimeType(): string | undefined;
         /**
         /**
          * Observable triggered once the texture has been loaded.
          * Observable triggered once the texture has been loaded.
          */
          */
@@ -23468,7 +23471,6 @@ declare module BABYLON {
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      */
      */
     export class RenderTargetTexture extends Texture {
     export class RenderTargetTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          */
          */
@@ -23513,10 +23515,6 @@ declare module BABYLON {
          */
          */
         renderSprites: boolean;
         renderSprites: boolean;
         /**
         /**
-         * Override the default coordinates mode to projection for RTT as it is the most common case for rendered textures.
-         */
-        coordinatesMode: number;
-        /**
          * Define the camera used to render the texture.
          * Define the camera used to render the texture.
          */
          */
         activeCamera: Nullable<Camera>;
         activeCamera: Nullable<Camera>;
@@ -23607,7 +23605,7 @@ declare module BABYLON {
         _generateMipMaps: boolean;
         _generateMipMaps: boolean;
         protected _renderingManager: RenderingManager;
         protected _renderingManager: RenderingManager;
         /** @hidden */
         /** @hidden */
-        _waitingRenderList: string[];
+        _waitingRenderList?: string[];
         protected _doNotChangeAspectRatio: boolean;
         protected _doNotChangeAspectRatio: boolean;
         protected _currentRefreshId: number;
         protected _currentRefreshId: number;
         protected _refreshRate: number;
         protected _refreshRate: number;
@@ -29374,11 +29372,13 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
+        protected _upVector: Vector3;
         /**
         /**
          * The vector the camera should consider as up.
          * The vector the camera should consider as up.
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          */
          */
-        upVector: Vector3;
+        set upVector(vec: Vector3);
+        get upVector(): Vector3;
         /**
         /**
          * Define the current limit on the left side for an orthographic camera
          * Define the current limit on the left side for an orthographic camera
          * In scene unit
          * In scene unit
@@ -32122,11 +32122,13 @@ declare module BABYLON {
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          */
          */
         enablePointerMoveEvents: boolean;
         enablePointerMoveEvents: boolean;
+        private _renderingGroupId;
         /**
         /**
          * Specifies the rendering group id for this mesh (0 by default)
          * Specifies the rendering group id for this mesh (0 by default)
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          */
          */
-        renderingGroupId: number;
+        get renderingGroupId(): number;
+        set renderingGroupId(value: number);
         private _material;
         private _material;
         /** Gets or sets current material */
         /** Gets or sets current material */
         get material(): Nullable<Material>;
         get material(): Nullable<Material>;
@@ -33858,7 +33860,7 @@ declare module BABYLON {
          * This is part of the texture as textures usually maps to one uv set.
          * This is part of the texture as textures usually maps to one uv set.
          */
          */
         coordinatesIndex: number;
         coordinatesIndex: number;
-        private _coordinatesMode;
+        protected _coordinatesMode: number;
         /**
         /**
         * How a texture is mapped.
         * How a texture is mapped.
         *
         *
@@ -33877,6 +33879,7 @@ declare module BABYLON {
         */
         */
         set coordinatesMode(value: number);
         set coordinatesMode(value: number);
         get coordinatesMode(): number;
         get coordinatesMode(): number;
+        private _wrapU;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -33884,7 +33887,9 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapU: number;
+        get wrapU(): number;
+        set wrapU(value: number);
+        private _wrapV;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -33892,7 +33897,8 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapV: number;
+        get wrapV(): number;
+        set wrapV(value: number);
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -39353,8 +39359,6 @@ declare module BABYLON {
          * The material properties need to be setup according to the type of texture in use.
          * The material properties need to be setup according to the type of texture in use.
          */
          */
         environmentBRDFTexture: BaseTexture;
         environmentBRDFTexture: BaseTexture;
-        /** @hidden */
-        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
          * Texture used in all pbr material as the reflection texture.
          * Texture used in all pbr material as the reflection texture.
          * As in the majority of the scene they are the same (exception for multi room and so on),
          * As in the majority of the scene they are the same (exception for multi room and so on),
@@ -41132,6 +41136,13 @@ declare module BABYLON {
          */
          */
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         /**
         /**
+         * Get a list of transform nodes by tags
+         * @param tagsQuery defines the tags query to use
+         * @param forEach defines a predicate used to filter results
+         * @returns an array of TransformNode
+         */
+        getTransformNodesByTags(tagsQuery: string, forEach?: (transform: TransformNode) => void): TransformNode[];
+        /**
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          *
          *
@@ -41390,10 +41401,15 @@ declare module BABYLON {
          * Textures to keep.
          * Textures to keep.
          */
          */
         textures: BaseTexture[];
         textures: BaseTexture[];
+        /** @hidden */
+        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
-         * Environment texture for the scene
+         * Texture used in all pbr material as the reflection texture.
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
          */
          */
-        environmentTexture: Nullable<BaseTexture>;
+        get environmentTexture(): Nullable<BaseTexture>;
+        set environmentTexture(value: Nullable<BaseTexture>);
         /**
         /**
          * The list of postprocesses added to the scene
          * The list of postprocesses added to the scene
          */
          */
@@ -42812,7 +42828,6 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
-        protected _upVector: Vector3;
         protected _upToYMatrix: Matrix;
         protected _upToYMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         /**
         /**
@@ -50277,7 +50292,12 @@ declare module BABYLON {
         /**
         /**
          * Ratio for the scale of the gizmo (Default: 1)
          * Ratio for the scale of the gizmo (Default: 1)
          */
          */
-        scaleRatio: number;
+        protected _scaleRatio: number;
+        /**
+         * Ratio for the scale of the gizmo (Default: 1)
+         */
+        set scaleRatio(value: number);
+        get scaleRatio(): number;
         /**
         /**
          * If a custom mesh has been set (Default: false)
          * If a custom mesh has been set (Default: false)
          */
          */
@@ -50299,10 +50319,12 @@ declare module BABYLON {
          * @param mesh The mesh to replace the default mesh of the gizmo
          * @param mesh The mesh to replace the default mesh of the gizmo
          */
          */
         setCustomMesh(mesh: Mesh): void;
         setCustomMesh(mesh: Mesh): void;
+        protected _updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
         /**
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          */
          */
-        updateGizmoRotationToMatchAttachedMesh: boolean;
+        set updateGizmoRotationToMatchAttachedMesh(value: boolean);
+        get updateGizmoRotationToMatchAttachedMesh(): boolean;
         /**
         /**
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          */
          */
@@ -50422,9 +50444,7 @@ declare module BABYLON {
          */
          */
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
         /** Fires an event when any of it's sub gizmos are dragged */
         onDragStartObservable: Observable<unknown>;
         onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
         /** Fires an event when any of it's sub gizmos are released from dragging */
@@ -50535,7 +50555,7 @@ declare module BABYLON.Debug {
         /**
         /**
          * Gets the hosting scene
          * Gets the hosting scene
          */
          */
-        scene: Scene;
+        scene: Nullable<Scene>;
         /**
         /**
          * Gets or sets a number used to scale line length
          * Gets or sets a number used to scale line length
          */
          */
@@ -53384,9 +53404,7 @@ declare module BABYLON {
         uniformScaleGizmo: AxisScaleGizmo;
         uniformScaleGizmo: AxisScaleGizmo;
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         private _uniformScalingMesh;
         private _uniformScalingMesh;
         private _octahedron;
         private _octahedron;
         private _sensitivity;
         private _sensitivity;
@@ -60234,10 +60252,6 @@ declare module BABYLON {
          * The texture URL.
          * The texture URL.
          */
          */
         url: string;
         url: string;
-        /**
-         * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.
-         */
-        coordinatesMode: number;
         protected _isBlocking: boolean;
         protected _isBlocking: boolean;
         /**
         /**
          * Sets wether or not the texture is blocking during loading.
          * Sets wether or not the texture is blocking during loading.
@@ -61342,8 +61356,6 @@ declare module BABYLON {
         private _height;
         private _height;
         /** The URL to the image. */
         /** The URL to the image. */
         url: string;
         url: string;
-        /** The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. */
-        coordinatesMode: number;
         /**
         /**
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * @param url The location of the image
          * @param url The location of the image
@@ -79978,10 +79990,6 @@ declare module BABYLON.GUI {
          */
          */
         innerGlowColor: BABYLON.Color3;
         innerGlowColor: BABYLON.Color3;
         /**
         /**
-         * Gets or sets alpha value (default is 1.0)
-         */
-        alpha: number;
-        /**
          * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
          * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
          */
          */
         albedoColor: BABYLON.Color3;
         albedoColor: BABYLON.Color3;
@@ -83282,6 +83290,7 @@ declare module BABYLON.GLTF2.Exporter {
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
+        static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
     }
     }
 }
 }
 declare module BABYLON.GLTF2.Exporter {
 declare module BABYLON.GLTF2.Exporter {
@@ -83502,6 +83511,16 @@ declare module BABYLON.GLTF2.Exporter {
          */
          */
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         /**
         /**
+         * Writes mesh attribute data to a data buffer
+         * Returns the bytelength of the data
+         * @param vertexBufferKind Indicates what kind of vertex data is being passed in
+         * @param meshAttributeArray Array containing the attribute data
+         * @param byteStride Specifies the space between data
+         * @param binaryWriter The buffer to write the binary data to
+         * @param convertToRightHandedSystem Converts the values to right-handed
+         */
+        writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
+        /**
          * Generates glTF json data
          * Generates glTF json data
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param glTFPrefix Text to use when prefixing a glTF file
          * @param glTFPrefix Text to use when prefixing a glTF file
@@ -83549,6 +83568,14 @@ declare module BABYLON.GLTF2.Exporter {
          */
          */
         private createBufferViewKind;
         private createBufferViewKind;
         /**
         /**
+     * Creates a bufferview based on the vertices type for the Babylon mesh
+     * @param babylonSubMesh The Babylon submesh that the morph target is applied to
+     * @param babylonMorphTarget the morph target to be exported
+     * @param binaryWriter The buffer to write the bufferview data to
+     * @param convertToRightHandedSystem Converts the values to right-handed
+     */
+        private setMorphTargetAttributes;
+        /**
          * The primitive mode of the Babylon mesh
          * The primitive mode of the Babylon mesh
          * @param babylonMesh The BabylonJS mesh
          * @param babylonMesh The BabylonJS mesh
          */
          */
@@ -83724,7 +83751,7 @@ declare module BABYLON.GLTF2.Exporter {
         /**
         /**
          * The glTF accessor type for the data.
          * The glTF accessor type for the data.
          */
          */
-        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4;
+        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
         /**
         /**
          * Specifies if quaternions should be used.
          * Specifies if quaternions should be used.
          */
          */
@@ -83766,8 +83793,25 @@ declare module BABYLON.GLTF2.Exporter {
             [key: number]: number;
             [key: number]: number;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         /**
         /**
+     * @ignore
+     * Create individual morph animations from the mesh's morph target animation tracks
+     * @param babylonNode
+     * @param runtimeGLTFAnimation
+     * @param idleGLTFAnimations
+     * @param nodeMap
+     * @param nodes
+     * @param binaryWriter
+     * @param bufferViews
+     * @param accessors
+     * @param convertToRightHandedSystem
+     * @param animationSampleRate
+     */
+        static _CreateMorphTargetAnimationFromMorphTargets(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
+            [key: number]: number;
+        }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
+        /**
          * @ignore
          * @ignore
-         * Create node animations from the animation groups
+         * Create node and morph animations from the animation groups
          * @param babylonScene
          * @param babylonScene
          * @param glTFAnimations
          * @param glTFAnimations
          * @param nodeMap
          * @param nodeMap
@@ -85062,7 +85106,7 @@ declare module BABYLON.GLTF2 {
 
 
     /** @hidden */
     /** @hidden */
     interface IKHRMaterialVariants_Mapping extends IProperty {
     interface IKHRMaterialVariants_Mapping extends IProperty {
-        mapping: Array<{
+        mappings: Array<{
             variants: number[];
             variants: number[];
             material: number;
             material: number;
         }>;
         }>;

+ 1 - 1
dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts

@@ -1062,7 +1062,7 @@ declare module BABYLON.GLTF2 {
 
 
     /** @hidden */
     /** @hidden */
     interface IKHRMaterialVariants_Mapping extends IProperty {
     interface IKHRMaterialVariants_Mapping extends IProperty {
-        mapping: Array<{
+        mappings: Array<{
             variants: number[];
             variants: number[];
             material: number;
             material: number;
         }>;
         }>;

+ 0 - 4
dist/preview release/gui/babylon.gui.d.ts

@@ -3892,10 +3892,6 @@ declare module BABYLON.GUI {
          */
          */
         innerGlowColor: BABYLON.Color3;
         innerGlowColor: BABYLON.Color3;
         /**
         /**
-         * Gets or sets alpha value (default is 1.0)
-         */
-        alpha: number;
-        /**
          * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
          * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
          */
          */
         albedoColor: BABYLON.Color3;
         albedoColor: BABYLON.Color3;

+ 2 - 7
dist/preview release/gui/babylon.gui.js

@@ -6863,6 +6863,7 @@ var Image = /** @class */ (function (_super) {
         configurable: true
         configurable: true
     });
     });
     Image.prototype._onImageLoaded = function () {
     Image.prototype._onImageLoaded = function () {
+        this._imageDataCache.data = null;
         this._imageWidth = this._domImage.width;
         this._imageWidth = this._domImage.width;
         this._imageHeight = this._domImage.height;
         this._imageHeight = this._domImage.height;
         this._loaded = true;
         this._loaded = true;
@@ -7106,6 +7107,7 @@ var Image = /** @class */ (function (_super) {
             var canvas = this._workingCanvas;
             var canvas = this._workingCanvas;
             var context_1 = canvas.getContext("2d");
             var context_1 = canvas.getContext("2d");
             this._imageDataCache.data = imageData = context_1.getImageData(0, 0, width, height).data;
             this._imageDataCache.data = imageData = context_1.getImageData(0, 0, width, height).data;
+            this._imageDataCache.key = key;
         }
         }
         x = (x - this._currentMeasure.left) | 0;
         x = (x - this._currentMeasure.left) | 0;
         y = (y - this._currentMeasure.top) | 0;
         y = (y - this._currentMeasure.top) | 0;
@@ -16726,10 +16728,6 @@ var FluentMaterial = /** @class */ (function (_super) {
          */
          */
         _this.innerGlowColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1.0, 1.0, 1.0);
         _this.innerGlowColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](1.0, 1.0, 1.0);
         /**
         /**
-         * Gets or sets alpha value (default is 1.0)
-         */
-        _this.alpha = 1.0;
-        /**
          * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
          * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
          */
          */
         _this.albedoColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.3, 0.35, 0.4);
         _this.albedoColor = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.3, 0.35, 0.4);
@@ -16924,9 +16922,6 @@ var FluentMaterial = /** @class */ (function (_super) {
         Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
         Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
     ], FluentMaterial.prototype, "innerGlowColor", void 0);
     ], FluentMaterial.prototype, "innerGlowColor", void 0);
     Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
     Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
-        Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
-    ], FluentMaterial.prototype, "alpha", void 0);
-    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
         Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
         Object(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serializeAsColor3"])()
     ], FluentMaterial.prototype, "albedoColor", void 0);
     ], FluentMaterial.prototype, "albedoColor", void 0);
     Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
     Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


+ 0 - 8
dist/preview release/gui/babylon.gui.module.d.ts

@@ -4125,10 +4125,6 @@ declare module "babylonjs-gui/3D/materials/fluentMaterial" {
          */
          */
         innerGlowColor: Color3;
         innerGlowColor: Color3;
         /**
         /**
-         * Gets or sets alpha value (default is 1.0)
-         */
-        alpha: number;
-        /**
          * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
          * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
          */
          */
         albedoColor: Color3;
         albedoColor: Color3;
@@ -8296,10 +8292,6 @@ declare module BABYLON.GUI {
          */
          */
         innerGlowColor: BABYLON.Color3;
         innerGlowColor: BABYLON.Color3;
         /**
         /**
-         * Gets or sets alpha value (default is 1.0)
-         */
-        alpha: number;
-        /**
          * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
          * Gets or sets the albedo color (Default is BABYLON.Color3(0.3, 0.35, 0.4))
          */
          */
         albedoColor: BABYLON.Color3;
         albedoColor: BABYLON.Color3;

文件差异内容过多而无法显示
+ 6 - 6
dist/preview release/inspector/babylon.inspector.bundle.js


文件差异内容过多而无法显示
+ 287 - 313
dist/preview release/inspector/babylon.inspector.bundle.max.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 21 - 19
dist/preview release/inspector/babylon.inspector.d.ts

@@ -300,6 +300,7 @@ declare module INSPECTOR {
             value: string;
             value: string;
         }): boolean;
         }): boolean;
         updateValue(evt: any): void;
         updateValue(evt: any): void;
+        onBlur(): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -1369,7 +1370,7 @@ declare module INSPECTOR {
         channels: IChannel[];
         channels: IChannel[];
         setChannels(channelState: IChannel[]): void;
         setChannels(channelState: IChannel[]): void;
     }
     }
-    export class ChannelsBar extends React.Component<IChannelsBarProps> {
+    export class ChannelsBar extends React.PureComponent<IChannelsBarProps> {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -1382,13 +1383,6 @@ declare module INSPECTOR {
         b?: number;
         b?: number;
         a?: number;
         a?: number;
     }
     }
-    export interface IToolGUI {
-        adt: BABYLON.GUI.AdvancedDynamicTexture;
-        toolWindow: BABYLON.GUI.StackPanel;
-        isDragging: boolean;
-        dragCoords: BABYLON.Nullable<BABYLON.Vector2>;
-        style: BABYLON.GUI.Style;
-    }
     export class TextureCanvasManager {
     export class TextureCanvasManager {
         private _engine;
         private _engine;
         private _scene;
         private _scene;
@@ -1429,7 +1423,6 @@ declare module INSPECTOR {
         private static DESELECT_KEY;
         private static DESELECT_KEY;
         private _tool;
         private _tool;
         private _setPixelData;
         private _setPixelData;
-        private _GUI;
         private _window;
         private _window;
         private _metadata;
         private _metadata;
         private _editing3D;
         private _editing3D;
@@ -1457,8 +1450,6 @@ declare module INSPECTOR {
         get tool(): BABYLON.Nullable<ITool>;
         get tool(): BABYLON.Nullable<ITool>;
         set face(face: number);
         set face(face: number);
         set mipLevel(mipLevel: number);
         set mipLevel(mipLevel: number);
-        /** Returns the tool GUI object, allowing tools to access the GUI */
-        get GUI(): IToolGUI;
         /** Returns the 3D scene used for postprocesses */
         /** Returns the 3D scene used for postprocesses */
         get scene3D(): BABYLON.Scene;
         get scene3D(): BABYLON.Scene;
         set metadata(metadata: IMetadata);
         set metadata(metadata: IMetadata);
@@ -1487,7 +1478,7 @@ declare module INSPECTOR {
         width: number;
         width: number;
         height: number;
         height: number;
     }
     }
-    export class PropertiesBar extends React.Component<IPropertiesBarProps, IPropertiesBarState> {
+    export class PropertiesBar extends React.PureComponent<IPropertiesBarProps, IPropertiesBarState> {
         private _resetButton;
         private _resetButton;
         private _uploadButton;
         private _uploadButton;
         private _saveButton;
         private _saveButton;
@@ -1503,12 +1494,12 @@ declare module INSPECTOR {
     }
     }
 }
 }
 declare module INSPECTOR {
 declare module INSPECTOR {
-    interface BottomBarProps {
+    interface IBottomBarProps {
         name: string;
         name: string;
         mipLevel: number;
         mipLevel: number;
         hasMips: boolean;
         hasMips: boolean;
     }
     }
-    export class BottomBar extends React.Component<BottomBarProps> {
+    export class BottomBar extends React.PureComponent<IBottomBarProps> {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -1519,7 +1510,7 @@ declare module INSPECTOR {
         canvas3D: React.RefObject<HTMLCanvasElement>;
         canvas3D: React.RefObject<HTMLCanvasElement>;
         texture: BABYLON.BaseTexture;
         texture: BABYLON.BaseTexture;
     }
     }
-    export class TextureCanvasComponent extends React.Component<ITextureCanvasComponentProps> {
+    export class TextureCanvasComponent extends React.PureComponent<ITextureCanvasComponentProps> {
         shouldComponentUpdate(nextProps: ITextureCanvasComponentProps): boolean;
         shouldComponentUpdate(nextProps: ITextureCanvasComponentProps): boolean;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
@@ -1544,8 +1535,15 @@ declare module INSPECTOR {
     export default _default;
     export default _default;
 }
 }
 declare module INSPECTOR {
 declare module INSPECTOR {
+    interface IToolSettingsProps {
+        tool: ITool | undefined;
+    }
+    export class ToolSettings extends React.Component<IToolSettingsProps> {
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
     interface ITextureEditorComponentProps {
     interface ITextureEditorComponentProps {
-        globalState: GlobalState;
         texture: BABYLON.BaseTexture;
         texture: BABYLON.BaseTexture;
         url: string;
         url: string;
         window: React.RefObject<PopupComponent>;
         window: React.RefObject<PopupComponent>;
@@ -1577,8 +1575,6 @@ declare module INSPECTOR {
         setMetadata: (data: any) => void;
         setMetadata: (data: any) => void;
         /** Returns the texture coordinates under the cursor */
         /** Returns the texture coordinates under the cursor */
         getMouseCoordinates: (pointerInfo: BABYLON.PointerInfo) => BABYLON.Vector2;
         getMouseCoordinates: (pointerInfo: BABYLON.PointerInfo) => BABYLON.Vector2;
-        /** An object which holds the GUI's ADT as well as the tool window. */
-        GUI: IToolGUI;
         /** Provides access to the BABYLON namespace */
         /** Provides access to the BABYLON namespace */
         BABYLON: any;
         BABYLON: any;
         /** Provides a canvas that you can use the canvas API to paint on. */
         /** Provides a canvas that you can use the canvas API to paint on. */
@@ -1588,6 +1584,9 @@ declare module INSPECTOR {
         /** Call this when you are finished painting. */
         /** Call this when you are finished painting. */
         stopPainting: () => void;
         stopPainting: () => void;
     }
     }
+    export interface IToolGUIProps {
+        instance: IToolType;
+    }
     /** An interface representing the definition of a tool */
     /** An interface representing the definition of a tool */
     export interface IToolData {
     export interface IToolData {
         /** Name to display on the toolbar */
         /** Name to display on the toolbar */
@@ -1600,6 +1599,7 @@ declare module INSPECTOR {
         usesWindow?: boolean;
         usesWindow?: boolean;
         /** Whether the tool uses postprocesses */
         /** Whether the tool uses postprocesses */
         is3D?: boolean;
         is3D?: boolean;
+        settingsComponent?: React.ComponentType<IToolGUIProps>;
     }
     }
     export interface IToolType {
     export interface IToolType {
         /** Called when the tool is selected. */
         /** Called when the tool is selected. */
@@ -1666,10 +1666,12 @@ declare module INSPECTOR {
         private _adtInstrumentation;
         private _adtInstrumentation;
         private popoutWindowRef;
         private popoutWindowRef;
         private textureLineRef;
         private textureLineRef;
+        private _textureInspectorSize;
         constructor(props: ITexturePropertyGridComponentProps);
         constructor(props: ITexturePropertyGridComponentProps);
         componentWillUnmount(): void;
         componentWillUnmount(): void;
         updateTexture(file: File): void;
         updateTexture(file: File): void;
-        onOpenTextureEditor(): void;
+        openTextureEditor(): void;
+        onOpenTextureEditor(window: Window): void;
         onCloseTextureEditor(window: Window | null, callback?: {
         onCloseTextureEditor(window: Window | null, callback?: {
             (): void;
             (): void;
         }): void;
         }): void;

+ 45 - 43
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -340,6 +340,7 @@ declare module "babylonjs-inspector/components/actionTabs/lines/numericInputComp
             value: string;
             value: string;
         }): boolean;
         }): boolean;
         updateValue(evt: any): void;
         updateValue(evt: any): void;
+        onBlur(): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -1547,7 +1548,7 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         channels: IChannel[];
         channels: IChannel[];
         setChannels(channelState: IChannel[]): void;
         setChannels(channelState: IChannel[]): void;
     }
     }
-    export class ChannelsBar extends React.Component<IChannelsBarProps> {
+    export class ChannelsBar extends React.PureComponent<IChannelsBarProps> {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -1560,9 +1561,6 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
     import { PointerInfo } from 'babylonjs/Events/pointerEvents';
     import { PointerInfo } from 'babylonjs/Events/pointerEvents';
     import { ITool } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar";
     import { ITool } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar";
     import { IChannel } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar";
     import { IChannel } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar";
-    import { StackPanel } from 'babylonjs-gui/2D/controls/stackPanel';
-    import { Style } from 'babylonjs-gui/2D/style';
-    import { AdvancedDynamicTexture } from 'babylonjs-gui/2D/advancedDynamicTexture';
     import { IMetadata } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent";
     import { IMetadata } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent";
     export interface IPixelData {
     export interface IPixelData {
         x?: number;
         x?: number;
@@ -1572,13 +1570,6 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         b?: number;
         b?: number;
         a?: number;
         a?: number;
     }
     }
-    export interface IToolGUI {
-        adt: AdvancedDynamicTexture;
-        toolWindow: StackPanel;
-        isDragging: boolean;
-        dragCoords: Nullable<Vector2>;
-        style: Style;
-    }
     export class TextureCanvasManager {
     export class TextureCanvasManager {
         private _engine;
         private _engine;
         private _scene;
         private _scene;
@@ -1619,7 +1610,6 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         private static DESELECT_KEY;
         private static DESELECT_KEY;
         private _tool;
         private _tool;
         private _setPixelData;
         private _setPixelData;
-        private _GUI;
         private _window;
         private _window;
         private _metadata;
         private _metadata;
         private _editing3D;
         private _editing3D;
@@ -1647,8 +1637,6 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         get tool(): Nullable<ITool>;
         get tool(): Nullable<ITool>;
         set face(face: number);
         set face(face: number);
         set mipLevel(mipLevel: number);
         set mipLevel(mipLevel: number);
-        /** Returns the tool GUI object, allowing tools to access the GUI */
-        get GUI(): IToolGUI;
         /** Returns the 3D scene used for postprocesses */
         /** Returns the 3D scene used for postprocesses */
         get scene3D(): Scene;
         get scene3D(): Scene;
         set metadata(metadata: IMetadata);
         set metadata(metadata: IMetadata);
@@ -1680,7 +1668,7 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         width: number;
         width: number;
         height: number;
         height: number;
     }
     }
-    export class PropertiesBar extends React.Component<IPropertiesBarProps, IPropertiesBarState> {
+    export class PropertiesBar extends React.PureComponent<IPropertiesBarProps, IPropertiesBarState> {
         private _resetButton;
         private _resetButton;
         private _uploadButton;
         private _uploadButton;
         private _saveButton;
         private _saveButton;
@@ -1697,12 +1685,12 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
 }
 }
 declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar" {
 declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar" {
     import * as React from 'react';
     import * as React from 'react';
-    interface BottomBarProps {
+    interface IBottomBarProps {
         name: string;
         name: string;
         mipLevel: number;
         mipLevel: number;
         hasMips: boolean;
         hasMips: boolean;
     }
     }
-    export class BottomBar extends React.Component<BottomBarProps> {
+    export class BottomBar extends React.PureComponent<IBottomBarProps> {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -1715,7 +1703,7 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         canvas3D: React.RefObject<HTMLCanvasElement>;
         canvas3D: React.RefObject<HTMLCanvasElement>;
         texture: BaseTexture;
         texture: BaseTexture;
     }
     }
-    export class TextureCanvasComponent extends React.Component<ITextureCanvasComponentProps> {
+    export class TextureCanvasComponent extends React.PureComponent<ITextureCanvasComponentProps> {
         shouldComponentUpdate(nextProps: ITextureCanvasComponentProps): boolean;
         shouldComponentUpdate(nextProps: ITextureCanvasComponentProps): boolean;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
@@ -1744,10 +1732,19 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
     const _default: import("babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent").IToolData[];
     const _default: import("babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent").IToolData[];
     export default _default;
     export default _default;
 }
 }
+declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings" {
+    import * as React from 'react';
+    import { ITool } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar";
+    interface IToolSettingsProps {
+        tool: ITool | undefined;
+    }
+    export class ToolSettings extends React.Component<IToolSettingsProps> {
+        render(): JSX.Element;
+    }
+}
 declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent" {
 declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent" {
     import * as React from 'react';
     import * as React from 'react';
-    import { GlobalState } from "babylonjs-inspector/components/globalState";
-    import { IPixelData, IToolGUI } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager";
+    import { IPixelData } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager";
     import { ITool } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar";
     import { ITool } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/toolBar";
     import { IChannel } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar";
     import { IChannel } from "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar";
     import { BaseTexture } from 'babylonjs/Materials/Textures/baseTexture';
     import { BaseTexture } from 'babylonjs/Materials/Textures/baseTexture';
@@ -1757,7 +1754,6 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
     import { PointerInfo } from 'babylonjs/Events/pointerEvents';
     import { PointerInfo } from 'babylonjs/Events/pointerEvents';
     import { PopupComponent } from "babylonjs-inspector/components/popupComponent";
     import { PopupComponent } from "babylonjs-inspector/components/popupComponent";
     interface ITextureEditorComponentProps {
     interface ITextureEditorComponentProps {
-        globalState: GlobalState;
         texture: BaseTexture;
         texture: BaseTexture;
         url: string;
         url: string;
         window: React.RefObject<PopupComponent>;
         window: React.RefObject<PopupComponent>;
@@ -1789,8 +1785,6 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         setMetadata: (data: any) => void;
         setMetadata: (data: any) => void;
         /** Returns the texture coordinates under the cursor */
         /** Returns the texture coordinates under the cursor */
         getMouseCoordinates: (pointerInfo: PointerInfo) => Vector2;
         getMouseCoordinates: (pointerInfo: PointerInfo) => Vector2;
-        /** An object which holds the GUI's ADT as well as the tool window. */
-        GUI: IToolGUI;
         /** Provides access to the BABYLON namespace */
         /** Provides access to the BABYLON namespace */
         BABYLON: any;
         BABYLON: any;
         /** Provides a canvas that you can use the canvas API to paint on. */
         /** Provides a canvas that you can use the canvas API to paint on. */
@@ -1800,6 +1794,9 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         /** Call this when you are finished painting. */
         /** Call this when you are finished painting. */
         stopPainting: () => void;
         stopPainting: () => void;
     }
     }
+    export interface IToolGUIProps {
+        instance: IToolType;
+    }
     /** An interface representing the definition of a tool */
     /** An interface representing the definition of a tool */
     export interface IToolData {
     export interface IToolData {
         /** Name to display on the toolbar */
         /** Name to display on the toolbar */
@@ -1812,6 +1809,7 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         usesWindow?: boolean;
         usesWindow?: boolean;
         /** Whether the tool uses postprocesses */
         /** Whether the tool uses postprocesses */
         is3D?: boolean;
         is3D?: boolean;
+        settingsComponent?: React.ComponentType<IToolGUIProps>;
     }
     }
     export interface IToolType {
     export interface IToolType {
         /** Called when the tool is selected. */
         /** Called when the tool is selected. */
@@ -1885,10 +1883,12 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mat
         private _adtInstrumentation;
         private _adtInstrumentation;
         private popoutWindowRef;
         private popoutWindowRef;
         private textureLineRef;
         private textureLineRef;
+        private _textureInspectorSize;
         constructor(props: ITexturePropertyGridComponentProps);
         constructor(props: ITexturePropertyGridComponentProps);
         componentWillUnmount(): void;
         componentWillUnmount(): void;
         updateTexture(file: File): void;
         updateTexture(file: File): void;
-        onOpenTextureEditor(): void;
+        openTextureEditor(): void;
+        onOpenTextureEditor(window: Window): void;
         onCloseTextureEditor(window: Window | null, callback?: {
         onCloseTextureEditor(window: Window | null, callback?: {
             (): void;
             (): void;
         }): void;
         }): void;
@@ -4461,6 +4461,7 @@ declare module INSPECTOR {
             value: string;
             value: string;
         }): boolean;
         }): boolean;
         updateValue(evt: any): void;
         updateValue(evt: any): void;
+        onBlur(): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -5530,7 +5531,7 @@ declare module INSPECTOR {
         channels: IChannel[];
         channels: IChannel[];
         setChannels(channelState: IChannel[]): void;
         setChannels(channelState: IChannel[]): void;
     }
     }
-    export class ChannelsBar extends React.Component<IChannelsBarProps> {
+    export class ChannelsBar extends React.PureComponent<IChannelsBarProps> {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -5543,13 +5544,6 @@ declare module INSPECTOR {
         b?: number;
         b?: number;
         a?: number;
         a?: number;
     }
     }
-    export interface IToolGUI {
-        adt: BABYLON.GUI.AdvancedDynamicTexture;
-        toolWindow: BABYLON.GUI.StackPanel;
-        isDragging: boolean;
-        dragCoords: BABYLON.Nullable<BABYLON.Vector2>;
-        style: BABYLON.GUI.Style;
-    }
     export class TextureCanvasManager {
     export class TextureCanvasManager {
         private _engine;
         private _engine;
         private _scene;
         private _scene;
@@ -5590,7 +5584,6 @@ declare module INSPECTOR {
         private static DESELECT_KEY;
         private static DESELECT_KEY;
         private _tool;
         private _tool;
         private _setPixelData;
         private _setPixelData;
-        private _GUI;
         private _window;
         private _window;
         private _metadata;
         private _metadata;
         private _editing3D;
         private _editing3D;
@@ -5618,8 +5611,6 @@ declare module INSPECTOR {
         get tool(): BABYLON.Nullable<ITool>;
         get tool(): BABYLON.Nullable<ITool>;
         set face(face: number);
         set face(face: number);
         set mipLevel(mipLevel: number);
         set mipLevel(mipLevel: number);
-        /** Returns the tool GUI object, allowing tools to access the GUI */
-        get GUI(): IToolGUI;
         /** Returns the 3D scene used for postprocesses */
         /** Returns the 3D scene used for postprocesses */
         get scene3D(): BABYLON.Scene;
         get scene3D(): BABYLON.Scene;
         set metadata(metadata: IMetadata);
         set metadata(metadata: IMetadata);
@@ -5648,7 +5639,7 @@ declare module INSPECTOR {
         width: number;
         width: number;
         height: number;
         height: number;
     }
     }
-    export class PropertiesBar extends React.Component<IPropertiesBarProps, IPropertiesBarState> {
+    export class PropertiesBar extends React.PureComponent<IPropertiesBarProps, IPropertiesBarState> {
         private _resetButton;
         private _resetButton;
         private _uploadButton;
         private _uploadButton;
         private _saveButton;
         private _saveButton;
@@ -5664,12 +5655,12 @@ declare module INSPECTOR {
     }
     }
 }
 }
 declare module INSPECTOR {
 declare module INSPECTOR {
-    interface BottomBarProps {
+    interface IBottomBarProps {
         name: string;
         name: string;
         mipLevel: number;
         mipLevel: number;
         hasMips: boolean;
         hasMips: boolean;
     }
     }
-    export class BottomBar extends React.Component<BottomBarProps> {
+    export class BottomBar extends React.PureComponent<IBottomBarProps> {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -5680,7 +5671,7 @@ declare module INSPECTOR {
         canvas3D: React.RefObject<HTMLCanvasElement>;
         canvas3D: React.RefObject<HTMLCanvasElement>;
         texture: BABYLON.BaseTexture;
         texture: BABYLON.BaseTexture;
     }
     }
-    export class TextureCanvasComponent extends React.Component<ITextureCanvasComponentProps> {
+    export class TextureCanvasComponent extends React.PureComponent<ITextureCanvasComponentProps> {
         shouldComponentUpdate(nextProps: ITextureCanvasComponentProps): boolean;
         shouldComponentUpdate(nextProps: ITextureCanvasComponentProps): boolean;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
@@ -5705,8 +5696,15 @@ declare module INSPECTOR {
     export default _default;
     export default _default;
 }
 }
 declare module INSPECTOR {
 declare module INSPECTOR {
+    interface IToolSettingsProps {
+        tool: ITool | undefined;
+    }
+    export class ToolSettings extends React.Component<IToolSettingsProps> {
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
     interface ITextureEditorComponentProps {
     interface ITextureEditorComponentProps {
-        globalState: GlobalState;
         texture: BABYLON.BaseTexture;
         texture: BABYLON.BaseTexture;
         url: string;
         url: string;
         window: React.RefObject<PopupComponent>;
         window: React.RefObject<PopupComponent>;
@@ -5738,8 +5736,6 @@ declare module INSPECTOR {
         setMetadata: (data: any) => void;
         setMetadata: (data: any) => void;
         /** Returns the texture coordinates under the cursor */
         /** Returns the texture coordinates under the cursor */
         getMouseCoordinates: (pointerInfo: BABYLON.PointerInfo) => BABYLON.Vector2;
         getMouseCoordinates: (pointerInfo: BABYLON.PointerInfo) => BABYLON.Vector2;
-        /** An object which holds the GUI's ADT as well as the tool window. */
-        GUI: IToolGUI;
         /** Provides access to the BABYLON namespace */
         /** Provides access to the BABYLON namespace */
         BABYLON: any;
         BABYLON: any;
         /** Provides a canvas that you can use the canvas API to paint on. */
         /** Provides a canvas that you can use the canvas API to paint on. */
@@ -5749,6 +5745,9 @@ declare module INSPECTOR {
         /** Call this when you are finished painting. */
         /** Call this when you are finished painting. */
         stopPainting: () => void;
         stopPainting: () => void;
     }
     }
+    export interface IToolGUIProps {
+        instance: IToolType;
+    }
     /** An interface representing the definition of a tool */
     /** An interface representing the definition of a tool */
     export interface IToolData {
     export interface IToolData {
         /** Name to display on the toolbar */
         /** Name to display on the toolbar */
@@ -5761,6 +5760,7 @@ declare module INSPECTOR {
         usesWindow?: boolean;
         usesWindow?: boolean;
         /** Whether the tool uses postprocesses */
         /** Whether the tool uses postprocesses */
         is3D?: boolean;
         is3D?: boolean;
+        settingsComponent?: React.ComponentType<IToolGUIProps>;
     }
     }
     export interface IToolType {
     export interface IToolType {
         /** Called when the tool is selected. */
         /** Called when the tool is selected. */
@@ -5827,10 +5827,12 @@ declare module INSPECTOR {
         private _adtInstrumentation;
         private _adtInstrumentation;
         private popoutWindowRef;
         private popoutWindowRef;
         private textureLineRef;
         private textureLineRef;
+        private _textureInspectorSize;
         constructor(props: ITexturePropertyGridComponentProps);
         constructor(props: ITexturePropertyGridComponentProps);
         componentWillUnmount(): void;
         componentWillUnmount(): void;
         updateTexture(file: File): void;
         updateTexture(file: File): void;
-        onOpenTextureEditor(): void;
+        openTextureEditor(): void;
+        onOpenTextureEditor(window: Window): void;
         onCloseTextureEditor(window: Window | null, callback?: {
         onCloseTextureEditor(window: Window | null, callback?: {
             (): void;
             (): void;
         }): void;
         }): void;

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


文件差异内容过多而无法显示
+ 40 - 39
dist/preview release/loaders/babylon.glTF2FileLoader.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


文件差异内容过多而无法显示
+ 40 - 39
dist/preview release/loaders/babylon.glTFFileLoader.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.stlFileLoader.min.js


文件差异内容过多而无法显示
+ 40 - 39
dist/preview release/loaders/babylonjs.loaders.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/loaders/babylonjs.loaders.min.js


+ 36 - 0
dist/preview release/nodeEditor/babylon.nodeEditor.d.ts

@@ -1267,6 +1267,39 @@ declare module NODEEDITOR {
     }
     }
 }
 }
 declare module NODEEDITOR {
 declare module NODEEDITOR {
+    export interface IDraggableLineWithButtonComponent {
+        data: string;
+        tooltip: string;
+        iconImage: any;
+        onIconClick: (value: string) => void;
+        iconTitle: string;
+    }
+    export class DraggableLineWithButtonComponent extends React.Component<IDraggableLineWithButtonComponent> {
+        constructor(props: IDraggableLineWithButtonComponent);
+        render(): JSX.Element;
+    }
+}
+declare module NODEEDITOR {
+    interface ILineWithFileButtonComponentProps {
+        title: string;
+        closed?: boolean;
+        label: string;
+        iconImage: any;
+        onIconClick: (file: File) => void;
+        accept: string;
+        uploadName?: string;
+    }
+    export class LineWithFileButtonComponent extends React.Component<ILineWithFileButtonComponentProps, {
+        isExpanded: boolean;
+    }> {
+        private uploadRef;
+        constructor(props: ILineWithFileButtonComponentProps);
+        onChange(evt: any): void;
+        switchExpandedState(): void;
+        render(): JSX.Element;
+    }
+}
+declare module NODEEDITOR {
     interface INodeListComponentProps {
     interface INodeListComponentProps {
         globalState: GlobalState;
         globalState: GlobalState;
     }
     }
@@ -1275,9 +1308,12 @@ declare module NODEEDITOR {
     }> {
     }> {
         private _onResetRequiredObserver;
         private _onResetRequiredObserver;
         private static _Tooltips;
         private static _Tooltips;
+        private _customFrameList;
         constructor(props: INodeListComponentProps);
         constructor(props: INodeListComponentProps);
         componentWillUnmount(): void;
         componentWillUnmount(): void;
         filterContent(filter: string): void;
         filterContent(filter: string): void;
+        loadCustomFrame(file: File): void;
+        removeItem(value: string): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }

文件差异内容过多而无法显示
+ 6 - 6
dist/preview release/nodeEditor/babylon.nodeEditor.js


文件差异内容过多而无法显示
+ 212 - 6
dist/preview release/nodeEditor/babylon.nodeEditor.max.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/nodeEditor/babylon.nodeEditor.max.js.map


+ 74 - 0
dist/preview release/nodeEditor/babylon.nodeEditor.module.d.ts

@@ -1544,6 +1544,41 @@ declare module "babylonjs-node-editor/sharedComponents/draggableLineComponent" {
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
+declare module "babylonjs-node-editor/sharedComponents/draggableLineWithButtonComponent" {
+    import * as React from "react";
+    export interface IDraggableLineWithButtonComponent {
+        data: string;
+        tooltip: string;
+        iconImage: any;
+        onIconClick: (value: string) => void;
+        iconTitle: string;
+    }
+    export class DraggableLineWithButtonComponent extends React.Component<IDraggableLineWithButtonComponent> {
+        constructor(props: IDraggableLineWithButtonComponent);
+        render(): JSX.Element;
+    }
+}
+declare module "babylonjs-node-editor/sharedComponents/lineWithFileButtonComponent" {
+    import * as React from "react";
+    interface ILineWithFileButtonComponentProps {
+        title: string;
+        closed?: boolean;
+        label: string;
+        iconImage: any;
+        onIconClick: (file: File) => void;
+        accept: string;
+        uploadName?: string;
+    }
+    export class LineWithFileButtonComponent extends React.Component<ILineWithFileButtonComponentProps, {
+        isExpanded: boolean;
+    }> {
+        private uploadRef;
+        constructor(props: ILineWithFileButtonComponentProps);
+        onChange(evt: any): void;
+        switchExpandedState(): void;
+        render(): JSX.Element;
+    }
+}
 declare module "babylonjs-node-editor/components/nodeList/nodeListComponent" {
 declare module "babylonjs-node-editor/components/nodeList/nodeListComponent" {
     import * as React from "react";
     import * as React from "react";
     import { GlobalState } from "babylonjs-node-editor/globalState";
     import { GlobalState } from "babylonjs-node-editor/globalState";
@@ -1555,9 +1590,12 @@ declare module "babylonjs-node-editor/components/nodeList/nodeListComponent" {
     }> {
     }> {
         private _onResetRequiredObserver;
         private _onResetRequiredObserver;
         private static _Tooltips;
         private static _Tooltips;
+        private _customFrameList;
         constructor(props: INodeListComponentProps);
         constructor(props: INodeListComponentProps);
         componentWillUnmount(): void;
         componentWillUnmount(): void;
         filterContent(filter: string): void;
         filterContent(filter: string): void;
+        loadCustomFrame(file: File): void;
+        removeItem(value: string): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }
@@ -3131,6 +3169,39 @@ declare module NODEEDITOR {
     }
     }
 }
 }
 declare module NODEEDITOR {
 declare module NODEEDITOR {
+    export interface IDraggableLineWithButtonComponent {
+        data: string;
+        tooltip: string;
+        iconImage: any;
+        onIconClick: (value: string) => void;
+        iconTitle: string;
+    }
+    export class DraggableLineWithButtonComponent extends React.Component<IDraggableLineWithButtonComponent> {
+        constructor(props: IDraggableLineWithButtonComponent);
+        render(): JSX.Element;
+    }
+}
+declare module NODEEDITOR {
+    interface ILineWithFileButtonComponentProps {
+        title: string;
+        closed?: boolean;
+        label: string;
+        iconImage: any;
+        onIconClick: (file: File) => void;
+        accept: string;
+        uploadName?: string;
+    }
+    export class LineWithFileButtonComponent extends React.Component<ILineWithFileButtonComponentProps, {
+        isExpanded: boolean;
+    }> {
+        private uploadRef;
+        constructor(props: ILineWithFileButtonComponentProps);
+        onChange(evt: any): void;
+        switchExpandedState(): void;
+        render(): JSX.Element;
+    }
+}
+declare module NODEEDITOR {
     interface INodeListComponentProps {
     interface INodeListComponentProps {
         globalState: GlobalState;
         globalState: GlobalState;
     }
     }
@@ -3139,9 +3210,12 @@ declare module NODEEDITOR {
     }> {
     }> {
         private _onResetRequiredObserver;
         private _onResetRequiredObserver;
         private static _Tooltips;
         private static _Tooltips;
+        private _customFrameList;
         constructor(props: INodeListComponentProps);
         constructor(props: INodeListComponentProps);
         componentWillUnmount(): void;
         componentWillUnmount(): void;
         filterContent(filter: string): void;
         filterContent(filter: string): void;
+        loadCustomFrame(file: File): void;
+        removeItem(value: string): void;
         render(): JSX.Element;
         render(): JSX.Element;
     }
     }
 }
 }

+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"thinEngineOnly":117231,"engineOnly":153671,"sceneOnly":517938,"minGridMaterial":656459,"minStandardMaterial":805884}
+{"thinEngineOnly":117231,"engineOnly":153671,"sceneOnly":518525,"minGridMaterial":657416,"minStandardMaterial":807237}

+ 402 - 30
dist/preview release/serializers/babylon.glTF2Serializer.js

@@ -429,7 +429,7 @@ var KHR_lights_punctual = /** @class */ (function () {
     }
     }
     /** @hidden */
     /** @hidden */
     KHR_lights_punctual.prototype.dispose = function () {
     KHR_lights_punctual.prototype.dispose = function () {
-        delete this._lights;
+        this._lights = null;
     };
     };
     Object.defineProperty(KHR_lights_punctual.prototype, "wasUsed", {
     Object.defineProperty(KHR_lights_punctual.prototype, "wasUsed", {
         /** @hidden */
         /** @hidden */
@@ -952,6 +952,8 @@ __webpack_require__.r(__webpack_exports__);
 
 
 
 
 
 
+
+
 /**
 /**
  * @hidden
  * @hidden
  * Enum for handling in tangent and out tangent.
  * Enum for handling in tangent and out tangent.
@@ -1045,6 +1047,11 @@ var _GLTFAnimation = /** @class */ (function () {
                 animationChannelTargetPath = "rotation" /* ROTATION */;
                 animationChannelTargetPath = "rotation" /* ROTATION */;
                 break;
                 break;
             }
             }
+            case 'influence': {
+                dataAccessorType = "SCALAR" /* SCALAR */;
+                animationChannelTargetPath = "weights" /* WEIGHTS */;
+                break;
+            }
             default: {
             default: {
                 babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].Error("Unsupported animatable property " + property[0]);
                 babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].Error("Unsupported animatable property " + property[0]);
             }
             }
@@ -1094,8 +1101,63 @@ var _GLTFAnimation = /** @class */ (function () {
         }
         }
     };
     };
     /**
     /**
+ * @ignore
+ * Create individual morph animations from the mesh's morph target animation tracks
+ * @param babylonNode
+ * @param runtimeGLTFAnimation
+ * @param idleGLTFAnimations
+ * @param nodeMap
+ * @param nodes
+ * @param binaryWriter
+ * @param bufferViews
+ * @param accessors
+ * @param convertToRightHandedSystem
+ * @param animationSampleRate
+ */
+    _GLTFAnimation._CreateMorphTargetAnimationFromMorphTargets = function (babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationSampleRate) {
+        var glTFAnimation;
+        if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Mesh"]) {
+            var morphTargetManager = babylonNode.morphTargetManager;
+            if (morphTargetManager) {
+                for (var i = 0; i < morphTargetManager.numTargets; ++i) {
+                    var morphTarget = morphTargetManager.getTarget(i);
+                    for (var j = 0; j < morphTarget.animations.length; ++j) {
+                        var animation = morphTarget.animations[j];
+                        var combinedAnimation = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"]("" + animation.name, "influence", animation.framePerSecond, animation.dataType, animation.loopMode, animation.enableBlending);
+                        var combinedAnimationKeys = [];
+                        var animationKeys = animation.getKeys();
+                        for (var k = 0; k < animationKeys.length; ++k) {
+                            var animationKey = animationKeys[k];
+                            for (var l = 0; l < morphTargetManager.numTargets; ++l) {
+                                if (l == i) {
+                                    combinedAnimationKeys.push(animationKey);
+                                }
+                                else {
+                                    combinedAnimationKeys.push({ frame: animationKey.frame, value: morphTargetManager.getTarget(l).influence });
+                                }
+                            }
+                        }
+                        combinedAnimation.setKeys(combinedAnimationKeys);
+                        var animationInfo = _GLTFAnimation._DeduceAnimationInfo(combinedAnimation);
+                        if (animationInfo) {
+                            glTFAnimation = {
+                                name: combinedAnimation.name,
+                                samplers: [],
+                                channels: []
+                            };
+                            _GLTFAnimation.AddAnimation("" + animation.name, animation.hasRunningRuntimeAnimations ? runtimeGLTFAnimation : glTFAnimation, babylonNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate, morphTargetManager.numTargets);
+                            if (glTFAnimation.samplers.length && glTFAnimation.channels.length) {
+                                idleGLTFAnimations.push(glTFAnimation);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    };
+    /**
      * @ignore
      * @ignore
-     * Create node animations from the animation groups
+     * Create node and morph animations from the animation groups
      * @param babylonScene
      * @param babylonScene
      * @param glTFAnimations
      * @param glTFAnimations
      * @param nodeMap
      * @param nodeMap
@@ -1107,18 +1169,22 @@ var _GLTFAnimation = /** @class */ (function () {
      * @param animationSampleRate
      * @param animationSampleRate
      */
      */
     _GLTFAnimation._CreateNodeAnimationFromAnimationGroups = function (babylonScene, glTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystemMap, animationSampleRate) {
     _GLTFAnimation._CreateNodeAnimationFromAnimationGroups = function (babylonScene, glTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystemMap, animationSampleRate) {
+        var _a;
         var glTFAnimation;
         var glTFAnimation;
         if (babylonScene.animationGroups) {
         if (babylonScene.animationGroups) {
             var animationGroups = babylonScene.animationGroups;
             var animationGroups = babylonScene.animationGroups;
-            for (var _i = 0, animationGroups_1 = animationGroups; _i < animationGroups_1.length; _i++) {
-                var animationGroup = animationGroups_1[_i];
+            var _loop_1 = function (animationGroup) {
+                var morphAnimations = new Map();
+                var sampleAnimations = new Map();
+                var morphAnimationMeshes = new Set();
+                var animationGroupFrameDiff = animationGroup.to - animationGroup.from;
                 glTFAnimation = {
                 glTFAnimation = {
                     name: animationGroup.name,
                     name: animationGroup.name,
                     channels: [],
                     channels: [],
                     samplers: []
                     samplers: []
                 };
                 };
-                for (var _a = 0, _b = animationGroup.targetedAnimations; _a < _b.length; _a++) {
-                    var targetAnimation = _b[_a];
+                var _loop_2 = function (i) {
+                    var targetAnimation = animationGroup.targetedAnimations[i];
                     var target = targetAnimation.target;
                     var target = targetAnimation.target;
                     var animation = targetAnimation.animation;
                     var animation = targetAnimation.animation;
                     if (target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"] || target.length === 1 && target[0] instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"]) {
                     if (target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"] || target.length === 1 && target[0] instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"]) {
@@ -1129,15 +1195,87 @@ var _GLTFAnimation = /** @class */ (function () {
                             _GLTFAnimation.AddAnimation("" + animation.name, glTFAnimation, babylonTransformNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate);
                             _GLTFAnimation.AddAnimation("" + animation.name, glTFAnimation, babylonTransformNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate);
                         }
                         }
                     }
                     }
+                    else if (target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"] || target.length === 1 && target[0] instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"]) {
+                        var animationInfo = _GLTFAnimation._DeduceAnimationInfo(targetAnimation.animation);
+                        if (animationInfo) {
+                            var babylonMorphTarget_1 = target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"] ? target : target[0];
+                            if (babylonMorphTarget_1) {
+                                var babylonMorphTargetManager_1 = babylonScene.morphTargetManagers.find(function (morphTargetManager) {
+                                    for (var j = 0; j < morphTargetManager.numTargets; ++j) {
+                                        if (morphTargetManager.getTarget(j) === babylonMorphTarget_1) {
+                                            return true;
+                                        }
+                                    }
+                                    return false;
+                                });
+                                if (babylonMorphTargetManager_1) {
+                                    var babylonMesh = babylonScene.meshes.find(function (mesh) {
+                                        return mesh.morphTargetManager === babylonMorphTargetManager_1;
+                                    });
+                                    if (babylonMesh) {
+                                        if (!morphAnimations.has(babylonMesh)) {
+                                            morphAnimations.set(babylonMesh, new Map());
+                                        }
+                                        (_a = morphAnimations.get(babylonMesh)) === null || _a === void 0 ? void 0 : _a.set(babylonMorphTarget_1, animation);
+                                        morphAnimationMeshes.add(babylonMesh);
+                                        sampleAnimations.set(babylonMesh, animation);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+                for (var i = 0; i < animationGroup.targetedAnimations.length; ++i) {
+                    _loop_2(i);
                 }
                 }
+                morphAnimationMeshes.forEach(function (mesh) {
+                    // for each mesh that we want to export a Morph target animation track for...
+                    var morphTargetManager = mesh.morphTargetManager;
+                    var combinedAnimationGroup = null;
+                    var animationKeys = [];
+                    var sampleAnimation = sampleAnimations.get(mesh);
+                    var numAnimationKeys = sampleAnimation.getKeys().length;
+                    // for each frame of this mesh's animation group track
+                    for (var i = 0; i < numAnimationKeys; ++i) {
+                        // construct a new Animation track by interlacing the frames of each morph target animation track
+                        if (morphTargetManager) {
+                            for (var j = 0; j < morphTargetManager.numTargets; ++j) {
+                                var morphTarget = morphTargetManager.getTarget(j);
+                                var animationsByMorphTarget = morphAnimations.get(mesh);
+                                if (animationsByMorphTarget) {
+                                    var morphTargetAnimation = animationsByMorphTarget.get(morphTarget);
+                                    if (morphTargetAnimation) {
+                                        if (!combinedAnimationGroup) {
+                                            combinedAnimationGroup = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"](animationGroup.name + "_" + mesh.name + "_MorphWeightAnimation", "influence", morphTargetAnimation.framePerSecond, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_FLOAT, morphTargetAnimation.loopMode, morphTargetAnimation.enableBlending);
+                                        }
+                                        animationKeys.push(morphTargetAnimation.getKeys()[i]);
+                                    }
+                                    else {
+                                        animationKeys.push({ frame: animationGroup.from + (animationGroupFrameDiff / numAnimationKeys) * i, value: morphTarget.influence });
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    combinedAnimationGroup.setKeys(animationKeys);
+                    var animationInfo = _GLTFAnimation._DeduceAnimationInfo(combinedAnimationGroup);
+                    if (animationInfo) {
+                        _GLTFAnimation.AddAnimation(animationGroup.name + "_" + mesh.name + "_MorphWeightAnimation", glTFAnimation, mesh, combinedAnimationGroup, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, false, animationInfo.useQuaternion, animationSampleRate, morphTargetManager === null || morphTargetManager === void 0 ? void 0 : morphTargetManager.numTargets);
+                    }
+                });
                 if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                 if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                     glTFAnimations.push(glTFAnimation);
                     glTFAnimations.push(glTFAnimation);
                 }
                 }
+            };
+            for (var _i = 0, animationGroups_1 = animationGroups; _i < animationGroups_1.length; _i++) {
+                var animationGroup = animationGroups_1[_i];
+                _loop_1(animationGroup);
             }
             }
         }
         }
     };
     };
-    _GLTFAnimation.AddAnimation = function (name, glTFAnimation, babylonTransformNode, animation, dataAccessorType, animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, useQuaternion, animationSampleRate) {
-        var animationData = _GLTFAnimation._CreateNodeAnimation(babylonTransformNode, animation, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion, animationSampleRate);
+    _GLTFAnimation.AddAnimation = function (name, glTFAnimation, babylonTransformNode, animation, dataAccessorType, animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, useQuaternion, animationSampleRate, morphAnimationChannels) {
+        var animationData;
+        animationData = _GLTFAnimation._CreateNodeAnimation(babylonTransformNode, animation, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion, animationSampleRate);
         var bufferView;
         var bufferView;
         var accessor;
         var accessor;
         var keyframeAccessorIndex;
         var keyframeAccessorIndex;
@@ -1146,6 +1284,19 @@ var _GLTFAnimation = /** @class */ (function () {
         var animationSampler;
         var animationSampler;
         var animationChannel;
         var animationChannel;
         if (animationData) {
         if (animationData) {
+            if (morphAnimationChannels) {
+                var index = 0;
+                var currentInput = 0;
+                var newInputs = [];
+                while (animationData.inputs.length > 0) {
+                    currentInput = animationData.inputs.shift();
+                    if (index % morphAnimationChannels == 0) {
+                        newInputs.push(currentInput);
+                    }
+                    index++;
+                }
+                animationData.inputs = newInputs;
+            }
             var nodeIndex = nodeMap[babylonTransformNode.uniqueId];
             var nodeIndex = nodeMap[babylonTransformNode.uniqueId];
             // Creates buffer view and accessor for key frames.
             // Creates buffer view and accessor for key frames.
             var byteLength = animationData.inputs.length * 4;
             var byteLength = animationData.inputs.length * 4;
@@ -1159,7 +1310,7 @@ var _GLTFAnimation = /** @class */ (function () {
             keyframeAccessorIndex = accessors.length - 1;
             keyframeAccessorIndex = accessors.length - 1;
             // create bufferview and accessor for keyed values.
             // create bufferview and accessor for keyed values.
             outputLength = animationData.outputs.length;
             outputLength = animationData.outputs.length;
-            byteLength = dataAccessorType === "VEC3" /* VEC3 */ ? animationData.outputs.length * 12 : animationData.outputs.length * 16;
+            byteLength = _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetDataAccessorElementCount(dataAccessorType) * 4 * animationData.outputs.length;
             // check for in and out tangents
             // check for in and out tangents
             bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, undefined, name + "  data view");
             bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, undefined, name + "  data view");
             bufferViews.push(bufferView);
             bufferViews.push(bufferView);
@@ -1300,7 +1451,7 @@ var _GLTFAnimation = /** @class */ (function () {
         var animationType = animation.dataType;
         var animationType = animation.dataType;
         var cacheValue;
         var cacheValue;
         inputs.push(time);
         inputs.push(time);
-        if (typeof value === "number") {
+        if (typeof value === "number" && babylonTransformNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"]) {
             value = this._ConvertFactorToVector3OrQuaternion(value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
             value = this._ConvertFactorToVector3OrQuaternion(value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
         }
         }
         if (value) {
         if (value) {
@@ -1320,7 +1471,10 @@ var _GLTFAnimation = /** @class */ (function () {
                 }
                 }
                 outputs.push(quaternionCache.asArray());
                 outputs.push(quaternionCache.asArray());
             }
             }
-            else {
+            else if (animationChannelTargetPath === "weights" /* WEIGHTS */) {
+                outputs.push([value]);
+            }
+            else { // scaling and position animation
                 cacheValue = value;
                 cacheValue = value;
                 if (convertToRightHandedSystem && (animationChannelTargetPath !== "scale" /* SCALE */)) {
                 if (convertToRightHandedSystem && (animationChannelTargetPath !== "scale" /* SCALE */)) {
                     _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedPositionVector3FromRef(cacheValue);
                     _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedPositionVector3FromRef(cacheValue);
@@ -1441,29 +1595,34 @@ var _GLTFAnimation = /** @class */ (function () {
             }
             }
             outputs.push(value); // scale  vector.
             outputs.push(value); // scale  vector.
         }
         }
-        else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_FLOAT) { // handles single component x, y, z or w component animation by using a base property and animating over a component.
-            newPositionRotationOrScale = this._ConvertFactorToVector3OrQuaternion(keyFrame.value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
-            if (newPositionRotationOrScale) {
-                if (animationChannelTargetPath === "rotation" /* ROTATION */) {
-                    var posRotScale = useQuaternion ? newPositionRotationOrScale : babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].RotationYawPitchRoll(newPositionRotationOrScale.y, newPositionRotationOrScale.x, newPositionRotationOrScale.z).normalize();
-                    if (convertToRightHandedSystem) {
-                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedQuaternionFromRef(posRotScale);
-                        if (!babylonTransformNode.parent) {
-                            posRotScale = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray([0, 1, 0, 0]).multiply(posRotScale);
+        else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_FLOAT) {
+            if (animationChannelTargetPath === "weights" /* WEIGHTS */) {
+                outputs.push([keyFrame.value]);
+            }
+            else { // handles single component x, y, z or w component animation by using a base property and animating over a component.
+                newPositionRotationOrScale = this._ConvertFactorToVector3OrQuaternion(keyFrame.value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
+                if (newPositionRotationOrScale) {
+                    if (animationChannelTargetPath === "rotation" /* ROTATION */) {
+                        var posRotScale = useQuaternion ? newPositionRotationOrScale : babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].RotationYawPitchRoll(newPositionRotationOrScale.y, newPositionRotationOrScale.x, newPositionRotationOrScale.z).normalize();
+                        if (convertToRightHandedSystem) {
+                            _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedQuaternionFromRef(posRotScale);
+                            if (!babylonTransformNode.parent) {
+                                posRotScale = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray([0, 1, 0, 0]).multiply(posRotScale);
+                            }
                         }
                         }
+                        outputs.push(posRotScale.asArray());
                     }
                     }
-                    outputs.push(posRotScale.asArray());
-                }
-                else if (animationChannelTargetPath === "translation" /* TRANSLATION */) {
-                    if (convertToRightHandedSystem) {
-                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedNormalVector3FromRef(newPositionRotationOrScale);
-                        if (!babylonTransformNode.parent) {
-                            newPositionRotationOrScale.x *= -1;
-                            newPositionRotationOrScale.z *= -1;
+                    else if (animationChannelTargetPath === "translation" /* TRANSLATION */) {
+                        if (convertToRightHandedSystem) {
+                            _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedNormalVector3FromRef(newPositionRotationOrScale);
+                            if (!babylonTransformNode.parent) {
+                                newPositionRotationOrScale.x *= -1;
+                                newPositionRotationOrScale.z *= -1;
+                            }
                         }
                         }
                     }
                     }
+                    outputs.push(newPositionRotationOrScale.asArray());
                 }
                 }
-                outputs.push(newPositionRotationOrScale.asArray());
             }
             }
         }
         }
         else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION) {
         else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION) {
@@ -1567,6 +1726,14 @@ var _GLTFAnimation = /** @class */ (function () {
                     tangent = [0, 0, 0, 0];
                     tangent = [0, 0, 0, 0];
                 }
                 }
             }
             }
+            else if (animationChannelTargetPath === "weights" /* WEIGHTS */) {
+                if (tangentValue) {
+                    tangent = [tangentValue];
+                }
+                else {
+                    tangent = [0];
+                }
+            }
             else {
             else {
                 if (tangentValue) {
                 if (tangentValue) {
                     tangent = tangentValue.asArray();
                     tangent = tangentValue.asArray();
@@ -2313,6 +2480,103 @@ var _Exporter = /** @class */ (function () {
         }
         }
     };
     };
     /**
     /**
+     * Writes mesh attribute data to a data buffer
+     * Returns the bytelength of the data
+     * @param vertexBufferKind Indicates what kind of vertex data is being passed in
+     * @param meshAttributeArray Array containing the attribute data
+     * @param byteStride Specifies the space between data
+     * @param binaryWriter The buffer to write the binary data to
+     * @param convertToRightHandedSystem Converts the values to right-handed
+     */
+    _Exporter.prototype.writeMorphTargetAttributeData = function (vertexBufferKind, attributeComponentKind, meshPrimitive, morphTarget, meshAttributeArray, morphTargetAttributeArray, stride, binaryWriter, convertToRightHandedSystem, minMax) {
+        var vertexAttributes = [];
+        var index;
+        var difference = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
+        var difference4 = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"](0, 0, 0, 0);
+        switch (vertexBufferKind) {
+            case babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind: {
+                for (var k = meshPrimitive.verticesStart; k < meshPrimitive.verticesCount; ++k) {
+                    index = meshPrimitive.indexStart + k * stride;
+                    var vertexData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(meshAttributeArray, index);
+                    var morphData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(morphTargetAttributeArray, index);
+                    difference = morphData.subtractToRef(vertexData, difference);
+                    if (convertToRightHandedSystem) {
+                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._GetRightHandedPositionVector3FromRef(difference);
+                    }
+                    if (minMax) {
+                        minMax.min.copyFromFloats(Math.min(difference.x, minMax.min.x), Math.min(difference.y, minMax.min.y), Math.min(difference.z, minMax.min.z));
+                        minMax.max.copyFromFloats(Math.max(difference.x, minMax.max.x), Math.max(difference.y, minMax.max.y), Math.max(difference.z, minMax.max.z));
+                    }
+                    vertexAttributes.push(difference.asArray());
+                }
+                break;
+            }
+            case babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind: {
+                for (var k = meshPrimitive.verticesStart; k < meshPrimitive.verticesCount; ++k) {
+                    index = meshPrimitive.indexStart + k * stride;
+                    var vertexData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(meshAttributeArray, index);
+                    vertexData.normalize();
+                    var morphData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(morphTargetAttributeArray, index);
+                    morphData.normalize();
+                    difference = morphData.subtractToRef(vertexData, difference);
+                    if (convertToRightHandedSystem) {
+                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._GetRightHandedNormalVector3FromRef(difference);
+                    }
+                    vertexAttributes.push(difference.asArray());
+                }
+                break;
+            }
+            case babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].TangentKind: {
+                for (var k = meshPrimitive.verticesStart; k < meshPrimitive.verticesCount; ++k) {
+                    index = meshPrimitive.indexStart + k * (stride + 1);
+                    var vertexData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"].FromArray(meshAttributeArray, index);
+                    _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._NormalizeTangentFromRef(vertexData);
+                    var morphData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"].FromArray(morphTargetAttributeArray, index);
+                    _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._NormalizeTangentFromRef(morphData);
+                    difference4 = morphData.subtractToRef(vertexData, difference4);
+                    if (convertToRightHandedSystem) {
+                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._GetRightHandedVector4FromRef(difference4);
+                    }
+                    vertexAttributes.push([difference4.x, difference4.y, difference4.z]);
+                }
+                break;
+            }
+            default: {
+                babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Unsupported Vertex Buffer Type: " + vertexBufferKind);
+                vertexAttributes = [];
+            }
+        }
+        var writeBinaryFunc;
+        switch (attributeComponentKind) {
+            case 5121 /* UNSIGNED_BYTE */: {
+                writeBinaryFunc = binaryWriter.setUInt8.bind(binaryWriter);
+                break;
+            }
+            case 5123 /* UNSIGNED_SHORT */: {
+                writeBinaryFunc = binaryWriter.setUInt16.bind(binaryWriter);
+                break;
+            }
+            case 5125 /* UNSIGNED_INT */: {
+                writeBinaryFunc = binaryWriter.setUInt32.bind(binaryWriter);
+            }
+            case 5126 /* FLOAT */: {
+                writeBinaryFunc = binaryWriter.setFloat32.bind(binaryWriter);
+                break;
+            }
+            default: {
+                babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Unsupported Attribute Component kind: " + attributeComponentKind);
+                return;
+            }
+        }
+        for (var _i = 0, vertexAttributes_2 = vertexAttributes; _i < vertexAttributes_2.length; _i++) {
+            var vertexAttribute = vertexAttributes_2[_i];
+            for (var _a = 0, vertexAttribute_2 = vertexAttribute; _a < vertexAttribute_2.length; _a++) {
+                var component = vertexAttribute_2[_a];
+                writeBinaryFunc(component);
+            }
+        }
+    };
+    /**
      * Generates glTF json data
      * Generates glTF json data
      * @param shouldUseGlb Indicates whether the json should be written for a glb file
      * @param shouldUseGlb Indicates whether the json should be written for a glb file
      * @param glTFPrefix Text to use when prefixing a glTF file
      * @param glTFPrefix Text to use when prefixing a glTF file
@@ -2584,6 +2848,67 @@ var _Exporter = /** @class */ (function () {
         }
         }
     };
     };
     /**
     /**
+ * Creates a bufferview based on the vertices type for the Babylon mesh
+ * @param babylonSubMesh The Babylon submesh that the morph target is applied to
+ * @param babylonMorphTarget the morph target to be exported
+ * @param binaryWriter The buffer to write the bufferview data to
+ * @param convertToRightHandedSystem Converts the values to right-handed
+ */
+    _Exporter.prototype.setMorphTargetAttributes = function (babylonSubMesh, meshPrimitive, babylonMorphTarget, binaryWriter, convertToRightHandedSystem) {
+        if (babylonMorphTarget) {
+            if (!meshPrimitive.targets) {
+                meshPrimitive.targets = [];
+            }
+            var target = {};
+            if (babylonMorphTarget.hasNormals) {
+                var vertexNormals = babylonSubMesh.getMesh().getVerticesData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);
+                var morphNormals = babylonMorphTarget.getNormals();
+                var count = babylonSubMesh.verticesCount;
+                var byteStride = 12; // 3 x 4 byte floats
+                var byteLength = count * byteStride;
+                var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, byteStride, babylonMorphTarget.name + "_NORMAL");
+                this._bufferViews.push(bufferView);
+                var bufferViewIndex = this._bufferViews.length - 1;
+                var accessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateAccessor(bufferViewIndex, babylonMorphTarget.name + " - " + "NORMAL", "VEC3" /* VEC3 */, 5126 /* FLOAT */, count, 0, null, null);
+                this._accessors.push(accessor);
+                target.NORMAL = this._accessors.length - 1;
+                this.writeMorphTargetAttributeData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind, 5126 /* FLOAT */, babylonSubMesh, babylonMorphTarget, vertexNormals, morphNormals, byteStride / 4, binaryWriter, convertToRightHandedSystem);
+            }
+            if (babylonMorphTarget.hasPositions) {
+                var vertexPositions = babylonSubMesh.getMesh().getVerticesData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind);
+                var morphPositions = babylonMorphTarget.getPositions();
+                var count = babylonSubMesh.verticesCount;
+                var byteStride = 12; // 3 x 4 byte floats
+                var byteLength = count * byteStride;
+                var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, byteStride, babylonMorphTarget.name + "_POSITION");
+                this._bufferViews.push(bufferView);
+                var bufferViewIndex = this._bufferViews.length - 1;
+                var minMax = { min: new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"](Infinity, Infinity, Infinity), max: new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"](-Infinity, -Infinity, -Infinity) };
+                var accessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateAccessor(bufferViewIndex, babylonMorphTarget.name + " - " + "POSITION", "VEC3" /* VEC3 */, 5126 /* FLOAT */, count, 0, null, null);
+                this._accessors.push(accessor);
+                target.POSITION = this._accessors.length - 1;
+                this.writeMorphTargetAttributeData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind, 5126 /* FLOAT */, babylonSubMesh, babylonMorphTarget, vertexPositions, morphPositions, byteStride / 4, binaryWriter, convertToRightHandedSystem, minMax);
+                accessor.min = minMax.min.asArray();
+                accessor.max = minMax.max.asArray();
+            }
+            if (babylonMorphTarget.hasTangents) {
+                var vertexTangents = babylonSubMesh.getMesh().getVerticesData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].TangentKind);
+                var morphTangents = babylonMorphTarget.getTangents();
+                var count = babylonSubMesh.verticesCount;
+                var byteStride = 12; // 3 x 4 byte floats
+                var byteLength = count * byteStride;
+                var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, byteStride, babylonMorphTarget.name + "_NORMAL");
+                this._bufferViews.push(bufferView);
+                var bufferViewIndex = this._bufferViews.length - 1;
+                var accessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateAccessor(bufferViewIndex, babylonMorphTarget.name + " - " + "TANGENT", "VEC3" /* VEC3 */, 5126 /* FLOAT */, count, 0, null, null);
+                this._accessors.push(accessor);
+                target.TANGENT = this._accessors.length - 1;
+                this.writeMorphTargetAttributeData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].TangentKind, 5126 /* FLOAT */, babylonSubMesh, babylonMorphTarget, vertexTangents, morphTangents, byteStride / 4, binaryWriter, convertToRightHandedSystem);
+            }
+            meshPrimitive.targets.push(target);
+        }
+    };
+    /**
      * The primitive mode of the Babylon mesh
      * The primitive mode of the Babylon mesh
      * @param babylonMesh The BabylonJS mesh
      * @param babylonMesh The BabylonJS mesh
      */
      */
@@ -2721,6 +3046,7 @@ var _Exporter = /** @class */ (function () {
             var indexBufferViewIndex = null;
             var indexBufferViewIndex = null;
             var primitiveMode = this.getMeshPrimitiveMode(bufferMesh);
             var primitiveMode = this.getMeshPrimitiveMode(bufferMesh);
             var vertexAttributeBufferViews = {};
             var vertexAttributeBufferViews = {};
+            var morphTargetManager = bufferMesh.morphTargetManager;
             // For each BabylonMesh, create bufferviews for each 'kind'
             // For each BabylonMesh, create bufferviews for each 'kind'
             for (var _i = 0, attributeData_1 = attributeData; _i < attributeData_1.length; _i++) {
             for (var _i = 0, attributeData_1 = attributeData; _i < attributeData_1.length; _i++) {
                 var attribute = attributeData_1[_i];
                 var attribute = attributeData_1[_i];
@@ -2846,6 +3172,13 @@ var _Exporter = /** @class */ (function () {
                         }
                         }
                         meshPrimitive.material = materialIndex;
                         meshPrimitive.material = materialIndex;
                     }
                     }
+                    if (morphTargetManager) {
+                        var target = void 0;
+                        for (var i = 0; i < morphTargetManager.numTargets; ++i) {
+                            target = morphTargetManager.getTarget(i);
+                            this.setMorphTargetAttributes(submesh, meshPrimitive, target, binaryWriter, convertToRightHandedSystem);
+                        }
+                    }
                     mesh.primitives.push(meshPrimitive);
                     mesh.primitives.push(meshPrimitive);
                     var promise = this._extensionsPostExportMeshPrimitiveAsync("postExport", meshPrimitive, submesh, binaryWriter);
                     var promise = this._extensionsPostExportMeshPrimitiveAsync("postExport", meshPrimitive, submesh, binaryWriter);
                     if (promise) {
                     if (promise) {
@@ -3032,6 +3365,7 @@ var _Exporter = /** @class */ (function () {
                                 nodeMap[babylonNode.uniqueId] = nodeIndex;
                                 nodeMap[babylonNode.uniqueId] = nodeIndex;
                                 if (!babylonScene.animationGroups.length && babylonNode.animations.length) {
                                 if (!babylonScene.animationGroups.length && babylonNode.animations.length) {
                                     _glTFAnimation__WEBPACK_IMPORTED_MODULE_5__["_GLTFAnimation"]._CreateNodeAnimationFromNodeAnimations(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, _this._nodes, binaryWriter, _this._bufferViews, _this._accessors, convertToRightHandedSystem, _this._animationSampleRate);
                                     _glTFAnimation__WEBPACK_IMPORTED_MODULE_5__["_GLTFAnimation"]._CreateNodeAnimationFromNodeAnimations(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, _this._nodes, binaryWriter, _this._bufferViews, _this._accessors, convertToRightHandedSystem, _this._animationSampleRate);
+                                    _glTFAnimation__WEBPACK_IMPORTED_MODULE_5__["_GLTFAnimation"]._CreateMorphTargetAnimationFromMorphTargets(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, _this._nodes, binaryWriter, _this._bufferViews, _this._accessors, convertToRightHandedSystem, _this._animationSampleRate);
                                 }
                                 }
                             });
                             });
                         }
                         }
@@ -3083,6 +3417,15 @@ var _Exporter = /** @class */ (function () {
             if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["TransformNode"]) {
             if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["TransformNode"]) {
                 // Set transformation
                 // Set transformation
                 _this.setNodeTransformation(node, babylonNode, convertToRightHandedSystem);
                 _this.setNodeTransformation(node, babylonNode, convertToRightHandedSystem);
+                if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Mesh"]) {
+                    var morphTargetManager = babylonNode.morphTargetManager;
+                    if (morphTargetManager && morphTargetManager.numTargets > 0) {
+                        mesh.weights = [];
+                        for (var i = 0; i < morphTargetManager.numTargets; ++i) {
+                            mesh.weights.push(morphTargetManager.getTarget(i).influence);
+                        }
+                    }
+                }
                 return _this.setPrimitiveAttributesAsync(mesh, babylonNode, binaryWriter, convertToRightHandedSystem).then(function () {
                 return _this.setPrimitiveAttributesAsync(mesh, babylonNode, binaryWriter, convertToRightHandedSystem).then(function () {
                     if (mesh.primitives.length) {
                     if (mesh.primitives.length) {
                         _this._meshes.push(mesh);
                         _this._meshes.push(mesh);
@@ -3803,7 +4146,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
                             else {
                             else {
                                 reject("gltfMaterialExporter: Failed to get blob from image canvas!");
                                 reject("gltfMaterialExporter: Failed to get blob from image canvas!");
                             }
                             }
-                        });
+                        }, mimeType);
                     }
                     }
                 }
                 }
                 else {
                 else {
@@ -4399,6 +4742,17 @@ var _GLTFMaterialExporter = /** @class */ (function () {
                     samplerIndex_1 = foundSamplerIndex;
                     samplerIndex_1 = foundSamplerIndex;
                 }
                 }
                 var size = babylonTexture.getSize();
                 var size = babylonTexture.getSize();
+                // Preserve texture mime type if defined
+                if (babylonTexture.mimeType) {
+                    switch (babylonTexture.mimeType) {
+                        case "image/jpeg":
+                            mimeType = "image/jpeg" /* JPEG */;
+                            break;
+                        case "image/png":
+                            mimeType = "image/png" /* PNG */;
+                            break;
+                    }
+                }
                 return _this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then(function (base64Data) {
                 return _this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then(function (base64Data) {
                     var textureInfo = _this._getTextureInfoFromBase64(base64Data, babylonTexture.name.replace(/\.\/|\/|\.\\|\\/g, "_"), mimeType, babylonTexture.coordinatesIndex, samplerIndex_1);
                     var textureInfo = _this._getTextureInfoFromBase64(base64Data, babylonTexture.name.replace(/\.\/|\/|\.\\|\\/g, "_"), mimeType, babylonTexture.coordinatesIndex, samplerIndex_1);
                     if (textureInfo) {
                     if (textureInfo) {
@@ -4764,6 +5118,24 @@ var _GLTFUtilities = /** @class */ (function () {
         var m = matrix.m;
         var m = matrix.m;
         babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Matrix"].FromValuesToRef(m[0], m[1], -m[2], m[3], m[4], m[5], -m[6], m[7], -m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15], matrix);
         babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Matrix"].FromValuesToRef(m[0], m[1], -m[2], m[3], m[4], m[5], -m[6], m[7], -m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15], matrix);
     };
     };
+    _GLTFUtilities._GetDataAccessorElementCount = function (accessorType) {
+        switch (accessorType) {
+            case "MAT2" /* MAT2 */:
+                return 4;
+            case "MAT3" /* MAT3 */:
+                return 9;
+            case "MAT4" /* MAT4 */:
+                return 16;
+            case "SCALAR" /* SCALAR */:
+                return 1;
+            case "VEC2" /* VEC2 */:
+                return 2;
+            case "VEC3" /* VEC3 */:
+                return 3;
+            case "VEC4" /* VEC4 */:
+                return 4;
+        }
+    };
     return _GLTFUtilities;
     return _GLTFUtilities;
 }());
 }());
 
 

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.min.js


+ 38 - 2
dist/preview release/serializers/babylonjs.serializers.d.ts

@@ -499,6 +499,7 @@ declare module BABYLON.GLTF2.Exporter {
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
+        static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
     }
     }
 }
 }
 declare module BABYLON.GLTF2.Exporter {
 declare module BABYLON.GLTF2.Exporter {
@@ -719,6 +720,16 @@ declare module BABYLON.GLTF2.Exporter {
          */
          */
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         /**
         /**
+         * Writes mesh attribute data to a data buffer
+         * Returns the bytelength of the data
+         * @param vertexBufferKind Indicates what kind of vertex data is being passed in
+         * @param meshAttributeArray Array containing the attribute data
+         * @param byteStride Specifies the space between data
+         * @param binaryWriter The buffer to write the binary data to
+         * @param convertToRightHandedSystem Converts the values to right-handed
+         */
+        writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
+        /**
          * Generates glTF json data
          * Generates glTF json data
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param glTFPrefix Text to use when prefixing a glTF file
          * @param glTFPrefix Text to use when prefixing a glTF file
@@ -766,6 +777,14 @@ declare module BABYLON.GLTF2.Exporter {
          */
          */
         private createBufferViewKind;
         private createBufferViewKind;
         /**
         /**
+     * Creates a bufferview based on the vertices type for the Babylon mesh
+     * @param babylonSubMesh The Babylon submesh that the morph target is applied to
+     * @param babylonMorphTarget the morph target to be exported
+     * @param binaryWriter The buffer to write the bufferview data to
+     * @param convertToRightHandedSystem Converts the values to right-handed
+     */
+        private setMorphTargetAttributes;
+        /**
          * The primitive mode of the Babylon mesh
          * The primitive mode of the Babylon mesh
          * @param babylonMesh The BabylonJS mesh
          * @param babylonMesh The BabylonJS mesh
          */
          */
@@ -941,7 +960,7 @@ declare module BABYLON.GLTF2.Exporter {
         /**
         /**
          * The glTF accessor type for the data.
          * The glTF accessor type for the data.
          */
          */
-        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4;
+        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
         /**
         /**
          * Specifies if quaternions should be used.
          * Specifies if quaternions should be used.
          */
          */
@@ -983,8 +1002,25 @@ declare module BABYLON.GLTF2.Exporter {
             [key: number]: number;
             [key: number]: number;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         /**
         /**
+     * @ignore
+     * Create individual morph animations from the mesh's morph target animation tracks
+     * @param babylonNode
+     * @param runtimeGLTFAnimation
+     * @param idleGLTFAnimations
+     * @param nodeMap
+     * @param nodes
+     * @param binaryWriter
+     * @param bufferViews
+     * @param accessors
+     * @param convertToRightHandedSystem
+     * @param animationSampleRate
+     */
+        static _CreateMorphTargetAnimationFromMorphTargets(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
+            [key: number]: number;
+        }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
+        /**
          * @ignore
          * @ignore
-         * Create node animations from the animation groups
+         * Create node and morph animations from the animation groups
          * @param babylonScene
          * @param babylonScene
          * @param glTFAnimations
          * @param glTFAnimations
          * @param nodeMap
          * @param nodeMap

+ 402 - 30
dist/preview release/serializers/babylonjs.serializers.js

@@ -614,7 +614,7 @@ var KHR_lights_punctual = /** @class */ (function () {
     }
     }
     /** @hidden */
     /** @hidden */
     KHR_lights_punctual.prototype.dispose = function () {
     KHR_lights_punctual.prototype.dispose = function () {
-        delete this._lights;
+        this._lights = null;
     };
     };
     Object.defineProperty(KHR_lights_punctual.prototype, "wasUsed", {
     Object.defineProperty(KHR_lights_punctual.prototype, "wasUsed", {
         /** @hidden */
         /** @hidden */
@@ -1137,6 +1137,8 @@ __webpack_require__.r(__webpack_exports__);
 
 
 
 
 
 
+
+
 /**
 /**
  * @hidden
  * @hidden
  * Enum for handling in tangent and out tangent.
  * Enum for handling in tangent and out tangent.
@@ -1230,6 +1232,11 @@ var _GLTFAnimation = /** @class */ (function () {
                 animationChannelTargetPath = "rotation" /* ROTATION */;
                 animationChannelTargetPath = "rotation" /* ROTATION */;
                 break;
                 break;
             }
             }
+            case 'influence': {
+                dataAccessorType = "SCALAR" /* SCALAR */;
+                animationChannelTargetPath = "weights" /* WEIGHTS */;
+                break;
+            }
             default: {
             default: {
                 babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].Error("Unsupported animatable property " + property[0]);
                 babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Tools"].Error("Unsupported animatable property " + property[0]);
             }
             }
@@ -1279,8 +1286,63 @@ var _GLTFAnimation = /** @class */ (function () {
         }
         }
     };
     };
     /**
     /**
+ * @ignore
+ * Create individual morph animations from the mesh's morph target animation tracks
+ * @param babylonNode
+ * @param runtimeGLTFAnimation
+ * @param idleGLTFAnimations
+ * @param nodeMap
+ * @param nodes
+ * @param binaryWriter
+ * @param bufferViews
+ * @param accessors
+ * @param convertToRightHandedSystem
+ * @param animationSampleRate
+ */
+    _GLTFAnimation._CreateMorphTargetAnimationFromMorphTargets = function (babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationSampleRate) {
+        var glTFAnimation;
+        if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Mesh"]) {
+            var morphTargetManager = babylonNode.morphTargetManager;
+            if (morphTargetManager) {
+                for (var i = 0; i < morphTargetManager.numTargets; ++i) {
+                    var morphTarget = morphTargetManager.getTarget(i);
+                    for (var j = 0; j < morphTarget.animations.length; ++j) {
+                        var animation = morphTarget.animations[j];
+                        var combinedAnimation = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"]("" + animation.name, "influence", animation.framePerSecond, animation.dataType, animation.loopMode, animation.enableBlending);
+                        var combinedAnimationKeys = [];
+                        var animationKeys = animation.getKeys();
+                        for (var k = 0; k < animationKeys.length; ++k) {
+                            var animationKey = animationKeys[k];
+                            for (var l = 0; l < morphTargetManager.numTargets; ++l) {
+                                if (l == i) {
+                                    combinedAnimationKeys.push(animationKey);
+                                }
+                                else {
+                                    combinedAnimationKeys.push({ frame: animationKey.frame, value: morphTargetManager.getTarget(l).influence });
+                                }
+                            }
+                        }
+                        combinedAnimation.setKeys(combinedAnimationKeys);
+                        var animationInfo = _GLTFAnimation._DeduceAnimationInfo(combinedAnimation);
+                        if (animationInfo) {
+                            glTFAnimation = {
+                                name: combinedAnimation.name,
+                                samplers: [],
+                                channels: []
+                            };
+                            _GLTFAnimation.AddAnimation("" + animation.name, animation.hasRunningRuntimeAnimations ? runtimeGLTFAnimation : glTFAnimation, babylonNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate, morphTargetManager.numTargets);
+                            if (glTFAnimation.samplers.length && glTFAnimation.channels.length) {
+                                idleGLTFAnimations.push(glTFAnimation);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    };
+    /**
      * @ignore
      * @ignore
-     * Create node animations from the animation groups
+     * Create node and morph animations from the animation groups
      * @param babylonScene
      * @param babylonScene
      * @param glTFAnimations
      * @param glTFAnimations
      * @param nodeMap
      * @param nodeMap
@@ -1292,18 +1354,22 @@ var _GLTFAnimation = /** @class */ (function () {
      * @param animationSampleRate
      * @param animationSampleRate
      */
      */
     _GLTFAnimation._CreateNodeAnimationFromAnimationGroups = function (babylonScene, glTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystemMap, animationSampleRate) {
     _GLTFAnimation._CreateNodeAnimationFromAnimationGroups = function (babylonScene, glTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystemMap, animationSampleRate) {
+        var _a;
         var glTFAnimation;
         var glTFAnimation;
         if (babylonScene.animationGroups) {
         if (babylonScene.animationGroups) {
             var animationGroups = babylonScene.animationGroups;
             var animationGroups = babylonScene.animationGroups;
-            for (var _i = 0, animationGroups_1 = animationGroups; _i < animationGroups_1.length; _i++) {
-                var animationGroup = animationGroups_1[_i];
+            var _loop_1 = function (animationGroup) {
+                var morphAnimations = new Map();
+                var sampleAnimations = new Map();
+                var morphAnimationMeshes = new Set();
+                var animationGroupFrameDiff = animationGroup.to - animationGroup.from;
                 glTFAnimation = {
                 glTFAnimation = {
                     name: animationGroup.name,
                     name: animationGroup.name,
                     channels: [],
                     channels: [],
                     samplers: []
                     samplers: []
                 };
                 };
-                for (var _a = 0, _b = animationGroup.targetedAnimations; _a < _b.length; _a++) {
-                    var targetAnimation = _b[_a];
+                var _loop_2 = function (i) {
+                    var targetAnimation = animationGroup.targetedAnimations[i];
                     var target = targetAnimation.target;
                     var target = targetAnimation.target;
                     var animation = targetAnimation.animation;
                     var animation = targetAnimation.animation;
                     if (target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"] || target.length === 1 && target[0] instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"]) {
                     if (target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"] || target.length === 1 && target[0] instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"]) {
@@ -1314,15 +1380,87 @@ var _GLTFAnimation = /** @class */ (function () {
                             _GLTFAnimation.AddAnimation("" + animation.name, glTFAnimation, babylonTransformNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate);
                             _GLTFAnimation.AddAnimation("" + animation.name, glTFAnimation, babylonTransformNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate);
                         }
                         }
                     }
                     }
+                    else if (target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"] || target.length === 1 && target[0] instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"]) {
+                        var animationInfo = _GLTFAnimation._DeduceAnimationInfo(targetAnimation.animation);
+                        if (animationInfo) {
+                            var babylonMorphTarget_1 = target instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"] ? target : target[0];
+                            if (babylonMorphTarget_1) {
+                                var babylonMorphTargetManager_1 = babylonScene.morphTargetManagers.find(function (morphTargetManager) {
+                                    for (var j = 0; j < morphTargetManager.numTargets; ++j) {
+                                        if (morphTargetManager.getTarget(j) === babylonMorphTarget_1) {
+                                            return true;
+                                        }
+                                    }
+                                    return false;
+                                });
+                                if (babylonMorphTargetManager_1) {
+                                    var babylonMesh = babylonScene.meshes.find(function (mesh) {
+                                        return mesh.morphTargetManager === babylonMorphTargetManager_1;
+                                    });
+                                    if (babylonMesh) {
+                                        if (!morphAnimations.has(babylonMesh)) {
+                                            morphAnimations.set(babylonMesh, new Map());
+                                        }
+                                        (_a = morphAnimations.get(babylonMesh)) === null || _a === void 0 ? void 0 : _a.set(babylonMorphTarget_1, animation);
+                                        morphAnimationMeshes.add(babylonMesh);
+                                        sampleAnimations.set(babylonMesh, animation);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+                for (var i = 0; i < animationGroup.targetedAnimations.length; ++i) {
+                    _loop_2(i);
                 }
                 }
+                morphAnimationMeshes.forEach(function (mesh) {
+                    // for each mesh that we want to export a Morph target animation track for...
+                    var morphTargetManager = mesh.morphTargetManager;
+                    var combinedAnimationGroup = null;
+                    var animationKeys = [];
+                    var sampleAnimation = sampleAnimations.get(mesh);
+                    var numAnimationKeys = sampleAnimation.getKeys().length;
+                    // for each frame of this mesh's animation group track
+                    for (var i = 0; i < numAnimationKeys; ++i) {
+                        // construct a new Animation track by interlacing the frames of each morph target animation track
+                        if (morphTargetManager) {
+                            for (var j = 0; j < morphTargetManager.numTargets; ++j) {
+                                var morphTarget = morphTargetManager.getTarget(j);
+                                var animationsByMorphTarget = morphAnimations.get(mesh);
+                                if (animationsByMorphTarget) {
+                                    var morphTargetAnimation = animationsByMorphTarget.get(morphTarget);
+                                    if (morphTargetAnimation) {
+                                        if (!combinedAnimationGroup) {
+                                            combinedAnimationGroup = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"](animationGroup.name + "_" + mesh.name + "_MorphWeightAnimation", "influence", morphTargetAnimation.framePerSecond, babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_FLOAT, morphTargetAnimation.loopMode, morphTargetAnimation.enableBlending);
+                                        }
+                                        animationKeys.push(morphTargetAnimation.getKeys()[i]);
+                                    }
+                                    else {
+                                        animationKeys.push({ frame: animationGroup.from + (animationGroupFrameDiff / numAnimationKeys) * i, value: morphTarget.influence });
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    combinedAnimationGroup.setKeys(animationKeys);
+                    var animationInfo = _GLTFAnimation._DeduceAnimationInfo(combinedAnimationGroup);
+                    if (animationInfo) {
+                        _GLTFAnimation.AddAnimation(animationGroup.name + "_" + mesh.name + "_MorphWeightAnimation", glTFAnimation, mesh, combinedAnimationGroup, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, false, animationInfo.useQuaternion, animationSampleRate, morphTargetManager === null || morphTargetManager === void 0 ? void 0 : morphTargetManager.numTargets);
+                    }
+                });
                 if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                 if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                     glTFAnimations.push(glTFAnimation);
                     glTFAnimations.push(glTFAnimation);
                 }
                 }
+            };
+            for (var _i = 0, animationGroups_1 = animationGroups; _i < animationGroups_1.length; _i++) {
+                var animationGroup = animationGroups_1[_i];
+                _loop_1(animationGroup);
             }
             }
         }
         }
     };
     };
-    _GLTFAnimation.AddAnimation = function (name, glTFAnimation, babylonTransformNode, animation, dataAccessorType, animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, useQuaternion, animationSampleRate) {
-        var animationData = _GLTFAnimation._CreateNodeAnimation(babylonTransformNode, animation, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion, animationSampleRate);
+    _GLTFAnimation.AddAnimation = function (name, glTFAnimation, babylonTransformNode, animation, dataAccessorType, animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, useQuaternion, animationSampleRate, morphAnimationChannels) {
+        var animationData;
+        animationData = _GLTFAnimation._CreateNodeAnimation(babylonTransformNode, animation, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion, animationSampleRate);
         var bufferView;
         var bufferView;
         var accessor;
         var accessor;
         var keyframeAccessorIndex;
         var keyframeAccessorIndex;
@@ -1331,6 +1469,19 @@ var _GLTFAnimation = /** @class */ (function () {
         var animationSampler;
         var animationSampler;
         var animationChannel;
         var animationChannel;
         if (animationData) {
         if (animationData) {
+            if (morphAnimationChannels) {
+                var index = 0;
+                var currentInput = 0;
+                var newInputs = [];
+                while (animationData.inputs.length > 0) {
+                    currentInput = animationData.inputs.shift();
+                    if (index % morphAnimationChannels == 0) {
+                        newInputs.push(currentInput);
+                    }
+                    index++;
+                }
+                animationData.inputs = newInputs;
+            }
             var nodeIndex = nodeMap[babylonTransformNode.uniqueId];
             var nodeIndex = nodeMap[babylonTransformNode.uniqueId];
             // Creates buffer view and accessor for key frames.
             // Creates buffer view and accessor for key frames.
             var byteLength = animationData.inputs.length * 4;
             var byteLength = animationData.inputs.length * 4;
@@ -1344,7 +1495,7 @@ var _GLTFAnimation = /** @class */ (function () {
             keyframeAccessorIndex = accessors.length - 1;
             keyframeAccessorIndex = accessors.length - 1;
             // create bufferview and accessor for keyed values.
             // create bufferview and accessor for keyed values.
             outputLength = animationData.outputs.length;
             outputLength = animationData.outputs.length;
-            byteLength = dataAccessorType === "VEC3" /* VEC3 */ ? animationData.outputs.length * 12 : animationData.outputs.length * 16;
+            byteLength = _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetDataAccessorElementCount(dataAccessorType) * 4 * animationData.outputs.length;
             // check for in and out tangents
             // check for in and out tangents
             bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, undefined, name + "  data view");
             bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, undefined, name + "  data view");
             bufferViews.push(bufferView);
             bufferViews.push(bufferView);
@@ -1485,7 +1636,7 @@ var _GLTFAnimation = /** @class */ (function () {
         var animationType = animation.dataType;
         var animationType = animation.dataType;
         var cacheValue;
         var cacheValue;
         inputs.push(time);
         inputs.push(time);
-        if (typeof value === "number") {
+        if (typeof value === "number" && babylonTransformNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["TransformNode"]) {
             value = this._ConvertFactorToVector3OrQuaternion(value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
             value = this._ConvertFactorToVector3OrQuaternion(value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
         }
         }
         if (value) {
         if (value) {
@@ -1505,7 +1656,10 @@ var _GLTFAnimation = /** @class */ (function () {
                 }
                 }
                 outputs.push(quaternionCache.asArray());
                 outputs.push(quaternionCache.asArray());
             }
             }
-            else {
+            else if (animationChannelTargetPath === "weights" /* WEIGHTS */) {
+                outputs.push([value]);
+            }
+            else { // scaling and position animation
                 cacheValue = value;
                 cacheValue = value;
                 if (convertToRightHandedSystem && (animationChannelTargetPath !== "scale" /* SCALE */)) {
                 if (convertToRightHandedSystem && (animationChannelTargetPath !== "scale" /* SCALE */)) {
                     _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedPositionVector3FromRef(cacheValue);
                     _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedPositionVector3FromRef(cacheValue);
@@ -1626,29 +1780,34 @@ var _GLTFAnimation = /** @class */ (function () {
             }
             }
             outputs.push(value); // scale  vector.
             outputs.push(value); // scale  vector.
         }
         }
-        else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_FLOAT) { // handles single component x, y, z or w component animation by using a base property and animating over a component.
-            newPositionRotationOrScale = this._ConvertFactorToVector3OrQuaternion(keyFrame.value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
-            if (newPositionRotationOrScale) {
-                if (animationChannelTargetPath === "rotation" /* ROTATION */) {
-                    var posRotScale = useQuaternion ? newPositionRotationOrScale : babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].RotationYawPitchRoll(newPositionRotationOrScale.y, newPositionRotationOrScale.x, newPositionRotationOrScale.z).normalize();
-                    if (convertToRightHandedSystem) {
-                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedQuaternionFromRef(posRotScale);
-                        if (!babylonTransformNode.parent) {
-                            posRotScale = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray([0, 1, 0, 0]).multiply(posRotScale);
+        else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_FLOAT) {
+            if (animationChannelTargetPath === "weights" /* WEIGHTS */) {
+                outputs.push([keyFrame.value]);
+            }
+            else { // handles single component x, y, z or w component animation by using a base property and animating over a component.
+                newPositionRotationOrScale = this._ConvertFactorToVector3OrQuaternion(keyFrame.value, babylonTransformNode, animation, animationType, animationChannelTargetPath, convertToRightHandedSystem, useQuaternion);
+                if (newPositionRotationOrScale) {
+                    if (animationChannelTargetPath === "rotation" /* ROTATION */) {
+                        var posRotScale = useQuaternion ? newPositionRotationOrScale : babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].RotationYawPitchRoll(newPositionRotationOrScale.y, newPositionRotationOrScale.x, newPositionRotationOrScale.z).normalize();
+                        if (convertToRightHandedSystem) {
+                            _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedQuaternionFromRef(posRotScale);
+                            if (!babylonTransformNode.parent) {
+                                posRotScale = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray([0, 1, 0, 0]).multiply(posRotScale);
+                            }
                         }
                         }
+                        outputs.push(posRotScale.asArray());
                     }
                     }
-                    outputs.push(posRotScale.asArray());
-                }
-                else if (animationChannelTargetPath === "translation" /* TRANSLATION */) {
-                    if (convertToRightHandedSystem) {
-                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedNormalVector3FromRef(newPositionRotationOrScale);
-                        if (!babylonTransformNode.parent) {
-                            newPositionRotationOrScale.x *= -1;
-                            newPositionRotationOrScale.z *= -1;
+                    else if (animationChannelTargetPath === "translation" /* TRANSLATION */) {
+                        if (convertToRightHandedSystem) {
+                            _glTFUtilities__WEBPACK_IMPORTED_MODULE_1__["_GLTFUtilities"]._GetRightHandedNormalVector3FromRef(newPositionRotationOrScale);
+                            if (!babylonTransformNode.parent) {
+                                newPositionRotationOrScale.x *= -1;
+                                newPositionRotationOrScale.z *= -1;
+                            }
                         }
                         }
                     }
                     }
+                    outputs.push(newPositionRotationOrScale.asArray());
                 }
                 }
-                outputs.push(newPositionRotationOrScale.asArray());
             }
             }
         }
         }
         else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION) {
         else if (animationType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION) {
@@ -1752,6 +1911,14 @@ var _GLTFAnimation = /** @class */ (function () {
                     tangent = [0, 0, 0, 0];
                     tangent = [0, 0, 0, 0];
                 }
                 }
             }
             }
+            else if (animationChannelTargetPath === "weights" /* WEIGHTS */) {
+                if (tangentValue) {
+                    tangent = [tangentValue];
+                }
+                else {
+                    tangent = [0];
+                }
+            }
             else {
             else {
                 if (tangentValue) {
                 if (tangentValue) {
                     tangent = tangentValue.asArray();
                     tangent = tangentValue.asArray();
@@ -2498,6 +2665,103 @@ var _Exporter = /** @class */ (function () {
         }
         }
     };
     };
     /**
     /**
+     * Writes mesh attribute data to a data buffer
+     * Returns the bytelength of the data
+     * @param vertexBufferKind Indicates what kind of vertex data is being passed in
+     * @param meshAttributeArray Array containing the attribute data
+     * @param byteStride Specifies the space between data
+     * @param binaryWriter The buffer to write the binary data to
+     * @param convertToRightHandedSystem Converts the values to right-handed
+     */
+    _Exporter.prototype.writeMorphTargetAttributeData = function (vertexBufferKind, attributeComponentKind, meshPrimitive, morphTarget, meshAttributeArray, morphTargetAttributeArray, stride, binaryWriter, convertToRightHandedSystem, minMax) {
+        var vertexAttributes = [];
+        var index;
+        var difference = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
+        var difference4 = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"](0, 0, 0, 0);
+        switch (vertexBufferKind) {
+            case babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind: {
+                for (var k = meshPrimitive.verticesStart; k < meshPrimitive.verticesCount; ++k) {
+                    index = meshPrimitive.indexStart + k * stride;
+                    var vertexData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(meshAttributeArray, index);
+                    var morphData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(morphTargetAttributeArray, index);
+                    difference = morphData.subtractToRef(vertexData, difference);
+                    if (convertToRightHandedSystem) {
+                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._GetRightHandedPositionVector3FromRef(difference);
+                    }
+                    if (minMax) {
+                        minMax.min.copyFromFloats(Math.min(difference.x, minMax.min.x), Math.min(difference.y, minMax.min.y), Math.min(difference.z, minMax.min.z));
+                        minMax.max.copyFromFloats(Math.max(difference.x, minMax.max.x), Math.max(difference.y, minMax.max.y), Math.max(difference.z, minMax.max.z));
+                    }
+                    vertexAttributes.push(difference.asArray());
+                }
+                break;
+            }
+            case babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind: {
+                for (var k = meshPrimitive.verticesStart; k < meshPrimitive.verticesCount; ++k) {
+                    index = meshPrimitive.indexStart + k * stride;
+                    var vertexData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(meshAttributeArray, index);
+                    vertexData.normalize();
+                    var morphData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].FromArray(morphTargetAttributeArray, index);
+                    morphData.normalize();
+                    difference = morphData.subtractToRef(vertexData, difference);
+                    if (convertToRightHandedSystem) {
+                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._GetRightHandedNormalVector3FromRef(difference);
+                    }
+                    vertexAttributes.push(difference.asArray());
+                }
+                break;
+            }
+            case babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].TangentKind: {
+                for (var k = meshPrimitive.verticesStart; k < meshPrimitive.verticesCount; ++k) {
+                    index = meshPrimitive.indexStart + k * (stride + 1);
+                    var vertexData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"].FromArray(meshAttributeArray, index);
+                    _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._NormalizeTangentFromRef(vertexData);
+                    var morphData = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector4"].FromArray(morphTargetAttributeArray, index);
+                    _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._NormalizeTangentFromRef(morphData);
+                    difference4 = morphData.subtractToRef(vertexData, difference4);
+                    if (convertToRightHandedSystem) {
+                        _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._GetRightHandedVector4FromRef(difference4);
+                    }
+                    vertexAttributes.push([difference4.x, difference4.y, difference4.z]);
+                }
+                break;
+            }
+            default: {
+                babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Unsupported Vertex Buffer Type: " + vertexBufferKind);
+                vertexAttributes = [];
+            }
+        }
+        var writeBinaryFunc;
+        switch (attributeComponentKind) {
+            case 5121 /* UNSIGNED_BYTE */: {
+                writeBinaryFunc = binaryWriter.setUInt8.bind(binaryWriter);
+                break;
+            }
+            case 5123 /* UNSIGNED_SHORT */: {
+                writeBinaryFunc = binaryWriter.setUInt16.bind(binaryWriter);
+                break;
+            }
+            case 5125 /* UNSIGNED_INT */: {
+                writeBinaryFunc = binaryWriter.setUInt32.bind(binaryWriter);
+            }
+            case 5126 /* FLOAT */: {
+                writeBinaryFunc = binaryWriter.setFloat32.bind(binaryWriter);
+                break;
+            }
+            default: {
+                babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Unsupported Attribute Component kind: " + attributeComponentKind);
+                return;
+            }
+        }
+        for (var _i = 0, vertexAttributes_2 = vertexAttributes; _i < vertexAttributes_2.length; _i++) {
+            var vertexAttribute = vertexAttributes_2[_i];
+            for (var _a = 0, vertexAttribute_2 = vertexAttribute; _a < vertexAttribute_2.length; _a++) {
+                var component = vertexAttribute_2[_a];
+                writeBinaryFunc(component);
+            }
+        }
+    };
+    /**
      * Generates glTF json data
      * Generates glTF json data
      * @param shouldUseGlb Indicates whether the json should be written for a glb file
      * @param shouldUseGlb Indicates whether the json should be written for a glb file
      * @param glTFPrefix Text to use when prefixing a glTF file
      * @param glTFPrefix Text to use when prefixing a glTF file
@@ -2769,6 +3033,67 @@ var _Exporter = /** @class */ (function () {
         }
         }
     };
     };
     /**
     /**
+ * Creates a bufferview based on the vertices type for the Babylon mesh
+ * @param babylonSubMesh The Babylon submesh that the morph target is applied to
+ * @param babylonMorphTarget the morph target to be exported
+ * @param binaryWriter The buffer to write the bufferview data to
+ * @param convertToRightHandedSystem Converts the values to right-handed
+ */
+    _Exporter.prototype.setMorphTargetAttributes = function (babylonSubMesh, meshPrimitive, babylonMorphTarget, binaryWriter, convertToRightHandedSystem) {
+        if (babylonMorphTarget) {
+            if (!meshPrimitive.targets) {
+                meshPrimitive.targets = [];
+            }
+            var target = {};
+            if (babylonMorphTarget.hasNormals) {
+                var vertexNormals = babylonSubMesh.getMesh().getVerticesData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind);
+                var morphNormals = babylonMorphTarget.getNormals();
+                var count = babylonSubMesh.verticesCount;
+                var byteStride = 12; // 3 x 4 byte floats
+                var byteLength = count * byteStride;
+                var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, byteStride, babylonMorphTarget.name + "_NORMAL");
+                this._bufferViews.push(bufferView);
+                var bufferViewIndex = this._bufferViews.length - 1;
+                var accessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateAccessor(bufferViewIndex, babylonMorphTarget.name + " - " + "NORMAL", "VEC3" /* VEC3 */, 5126 /* FLOAT */, count, 0, null, null);
+                this._accessors.push(accessor);
+                target.NORMAL = this._accessors.length - 1;
+                this.writeMorphTargetAttributeData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].NormalKind, 5126 /* FLOAT */, babylonSubMesh, babylonMorphTarget, vertexNormals, morphNormals, byteStride / 4, binaryWriter, convertToRightHandedSystem);
+            }
+            if (babylonMorphTarget.hasPositions) {
+                var vertexPositions = babylonSubMesh.getMesh().getVerticesData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind);
+                var morphPositions = babylonMorphTarget.getPositions();
+                var count = babylonSubMesh.verticesCount;
+                var byteStride = 12; // 3 x 4 byte floats
+                var byteLength = count * byteStride;
+                var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, byteStride, babylonMorphTarget.name + "_POSITION");
+                this._bufferViews.push(bufferView);
+                var bufferViewIndex = this._bufferViews.length - 1;
+                var minMax = { min: new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"](Infinity, Infinity, Infinity), max: new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"](-Infinity, -Infinity, -Infinity) };
+                var accessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateAccessor(bufferViewIndex, babylonMorphTarget.name + " - " + "POSITION", "VEC3" /* VEC3 */, 5126 /* FLOAT */, count, 0, null, null);
+                this._accessors.push(accessor);
+                target.POSITION = this._accessors.length - 1;
+                this.writeMorphTargetAttributeData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].PositionKind, 5126 /* FLOAT */, babylonSubMesh, babylonMorphTarget, vertexPositions, morphPositions, byteStride / 4, binaryWriter, convertToRightHandedSystem, minMax);
+                accessor.min = minMax.min.asArray();
+                accessor.max = minMax.max.asArray();
+            }
+            if (babylonMorphTarget.hasTangents) {
+                var vertexTangents = babylonSubMesh.getMesh().getVerticesData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].TangentKind);
+                var morphTangents = babylonMorphTarget.getTangents();
+                var count = babylonSubMesh.verticesCount;
+                var byteStride = 12; // 3 x 4 byte floats
+                var byteLength = count * byteStride;
+                var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, byteStride, babylonMorphTarget.name + "_NORMAL");
+                this._bufferViews.push(bufferView);
+                var bufferViewIndex = this._bufferViews.length - 1;
+                var accessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__["_GLTFUtilities"]._CreateAccessor(bufferViewIndex, babylonMorphTarget.name + " - " + "TANGENT", "VEC3" /* VEC3 */, 5126 /* FLOAT */, count, 0, null, null);
+                this._accessors.push(accessor);
+                target.TANGENT = this._accessors.length - 1;
+                this.writeMorphTargetAttributeData(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["VertexBuffer"].TangentKind, 5126 /* FLOAT */, babylonSubMesh, babylonMorphTarget, vertexTangents, morphTangents, byteStride / 4, binaryWriter, convertToRightHandedSystem);
+            }
+            meshPrimitive.targets.push(target);
+        }
+    };
+    /**
      * The primitive mode of the Babylon mesh
      * The primitive mode of the Babylon mesh
      * @param babylonMesh The BabylonJS mesh
      * @param babylonMesh The BabylonJS mesh
      */
      */
@@ -2906,6 +3231,7 @@ var _Exporter = /** @class */ (function () {
             var indexBufferViewIndex = null;
             var indexBufferViewIndex = null;
             var primitiveMode = this.getMeshPrimitiveMode(bufferMesh);
             var primitiveMode = this.getMeshPrimitiveMode(bufferMesh);
             var vertexAttributeBufferViews = {};
             var vertexAttributeBufferViews = {};
+            var morphTargetManager = bufferMesh.morphTargetManager;
             // For each BabylonMesh, create bufferviews for each 'kind'
             // For each BabylonMesh, create bufferviews for each 'kind'
             for (var _i = 0, attributeData_1 = attributeData; _i < attributeData_1.length; _i++) {
             for (var _i = 0, attributeData_1 = attributeData; _i < attributeData_1.length; _i++) {
                 var attribute = attributeData_1[_i];
                 var attribute = attributeData_1[_i];
@@ -3031,6 +3357,13 @@ var _Exporter = /** @class */ (function () {
                         }
                         }
                         meshPrimitive.material = materialIndex;
                         meshPrimitive.material = materialIndex;
                     }
                     }
+                    if (morphTargetManager) {
+                        var target = void 0;
+                        for (var i = 0; i < morphTargetManager.numTargets; ++i) {
+                            target = morphTargetManager.getTarget(i);
+                            this.setMorphTargetAttributes(submesh, meshPrimitive, target, binaryWriter, convertToRightHandedSystem);
+                        }
+                    }
                     mesh.primitives.push(meshPrimitive);
                     mesh.primitives.push(meshPrimitive);
                     var promise = this._extensionsPostExportMeshPrimitiveAsync("postExport", meshPrimitive, submesh, binaryWriter);
                     var promise = this._extensionsPostExportMeshPrimitiveAsync("postExport", meshPrimitive, submesh, binaryWriter);
                     if (promise) {
                     if (promise) {
@@ -3217,6 +3550,7 @@ var _Exporter = /** @class */ (function () {
                                 nodeMap[babylonNode.uniqueId] = nodeIndex;
                                 nodeMap[babylonNode.uniqueId] = nodeIndex;
                                 if (!babylonScene.animationGroups.length && babylonNode.animations.length) {
                                 if (!babylonScene.animationGroups.length && babylonNode.animations.length) {
                                     _glTFAnimation__WEBPACK_IMPORTED_MODULE_5__["_GLTFAnimation"]._CreateNodeAnimationFromNodeAnimations(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, _this._nodes, binaryWriter, _this._bufferViews, _this._accessors, convertToRightHandedSystem, _this._animationSampleRate);
                                     _glTFAnimation__WEBPACK_IMPORTED_MODULE_5__["_GLTFAnimation"]._CreateNodeAnimationFromNodeAnimations(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, _this._nodes, binaryWriter, _this._bufferViews, _this._accessors, convertToRightHandedSystem, _this._animationSampleRate);
+                                    _glTFAnimation__WEBPACK_IMPORTED_MODULE_5__["_GLTFAnimation"]._CreateMorphTargetAnimationFromMorphTargets(babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, _this._nodes, binaryWriter, _this._bufferViews, _this._accessors, convertToRightHandedSystem, _this._animationSampleRate);
                                 }
                                 }
                             });
                             });
                         }
                         }
@@ -3268,6 +3602,15 @@ var _Exporter = /** @class */ (function () {
             if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["TransformNode"]) {
             if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["TransformNode"]) {
                 // Set transformation
                 // Set transformation
                 _this.setNodeTransformation(node, babylonNode, convertToRightHandedSystem);
                 _this.setNodeTransformation(node, babylonNode, convertToRightHandedSystem);
+                if (babylonNode instanceof babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Mesh"]) {
+                    var morphTargetManager = babylonNode.morphTargetManager;
+                    if (morphTargetManager && morphTargetManager.numTargets > 0) {
+                        mesh.weights = [];
+                        for (var i = 0; i < morphTargetManager.numTargets; ++i) {
+                            mesh.weights.push(morphTargetManager.getTarget(i).influence);
+                        }
+                    }
+                }
                 return _this.setPrimitiveAttributesAsync(mesh, babylonNode, binaryWriter, convertToRightHandedSystem).then(function () {
                 return _this.setPrimitiveAttributesAsync(mesh, babylonNode, binaryWriter, convertToRightHandedSystem).then(function () {
                     if (mesh.primitives.length) {
                     if (mesh.primitives.length) {
                         _this._meshes.push(mesh);
                         _this._meshes.push(mesh);
@@ -3988,7 +4331,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
                             else {
                             else {
                                 reject("gltfMaterialExporter: Failed to get blob from image canvas!");
                                 reject("gltfMaterialExporter: Failed to get blob from image canvas!");
                             }
                             }
-                        });
+                        }, mimeType);
                     }
                     }
                 }
                 }
                 else {
                 else {
@@ -4584,6 +4927,17 @@ var _GLTFMaterialExporter = /** @class */ (function () {
                     samplerIndex_1 = foundSamplerIndex;
                     samplerIndex_1 = foundSamplerIndex;
                 }
                 }
                 var size = babylonTexture.getSize();
                 var size = babylonTexture.getSize();
+                // Preserve texture mime type if defined
+                if (babylonTexture.mimeType) {
+                    switch (babylonTexture.mimeType) {
+                        case "image/jpeg":
+                            mimeType = "image/jpeg" /* JPEG */;
+                            break;
+                        case "image/png":
+                            mimeType = "image/png" /* PNG */;
+                            break;
+                    }
+                }
                 return _this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then(function (base64Data) {
                 return _this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then(function (base64Data) {
                     var textureInfo = _this._getTextureInfoFromBase64(base64Data, babylonTexture.name.replace(/\.\/|\/|\.\\|\\/g, "_"), mimeType, babylonTexture.coordinatesIndex, samplerIndex_1);
                     var textureInfo = _this._getTextureInfoFromBase64(base64Data, babylonTexture.name.replace(/\.\/|\/|\.\\|\\/g, "_"), mimeType, babylonTexture.coordinatesIndex, samplerIndex_1);
                     if (textureInfo) {
                     if (textureInfo) {
@@ -4949,6 +5303,24 @@ var _GLTFUtilities = /** @class */ (function () {
         var m = matrix.m;
         var m = matrix.m;
         babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Matrix"].FromValuesToRef(m[0], m[1], -m[2], m[3], m[4], m[5], -m[6], m[7], -m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15], matrix);
         babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__["Matrix"].FromValuesToRef(m[0], m[1], -m[2], m[3], m[4], m[5], -m[6], m[7], -m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15], matrix);
     };
     };
+    _GLTFUtilities._GetDataAccessorElementCount = function (accessorType) {
+        switch (accessorType) {
+            case "MAT2" /* MAT2 */:
+                return 4;
+            case "MAT3" /* MAT3 */:
+                return 9;
+            case "MAT4" /* MAT4 */:
+                return 16;
+            case "SCALAR" /* SCALAR */:
+                return 1;
+            case "VEC2" /* VEC2 */:
+                return 2;
+            case "VEC3" /* VEC3 */:
+                return 3;
+            case "VEC4" /* VEC4 */:
+                return 4;
+        }
+    };
     return _GLTFUtilities;
     return _GLTFUtilities;
 }());
 }());
 
 

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


+ 77 - 4
dist/preview release/serializers/babylonjs.serializers.module.d.ts

@@ -527,6 +527,7 @@ declare module "babylonjs-serializers/glTF/2.0/glTFUtilities" {
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
+        static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
     }
     }
 }
 }
 declare module "babylonjs-serializers/glTF/2.0/glTFExporter" {
 declare module "babylonjs-serializers/glTF/2.0/glTFExporter" {
@@ -536,6 +537,7 @@ declare module "babylonjs-serializers/glTF/2.0/glTFExporter" {
     import { Node } from "babylonjs/node";
     import { Node } from "babylonjs/node";
     import { TransformNode } from "babylonjs/Meshes/transformNode";
     import { TransformNode } from "babylonjs/Meshes/transformNode";
     import { SubMesh } from "babylonjs/Meshes/subMesh";
     import { SubMesh } from "babylonjs/Meshes/subMesh";
+    import { MorphTarget } from "babylonjs/Morph/morphTarget";
     import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
     import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
     import { Texture } from "babylonjs/Materials/Textures/texture";
     import { Texture } from "babylonjs/Materials/Textures/texture";
     import { Material } from "babylonjs/Materials/material";
     import { Material } from "babylonjs/Materials/material";
@@ -762,6 +764,16 @@ declare module "babylonjs-serializers/glTF/2.0/glTFExporter" {
          */
          */
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         /**
         /**
+         * Writes mesh attribute data to a data buffer
+         * Returns the bytelength of the data
+         * @param vertexBufferKind Indicates what kind of vertex data is being passed in
+         * @param meshAttributeArray Array containing the attribute data
+         * @param byteStride Specifies the space between data
+         * @param binaryWriter The buffer to write the binary data to
+         * @param convertToRightHandedSystem Converts the values to right-handed
+         */
+        writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
+        /**
          * Generates glTF json data
          * Generates glTF json data
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param glTFPrefix Text to use when prefixing a glTF file
          * @param glTFPrefix Text to use when prefixing a glTF file
@@ -809,6 +821,14 @@ declare module "babylonjs-serializers/glTF/2.0/glTFExporter" {
          */
          */
         private createBufferViewKind;
         private createBufferViewKind;
         /**
         /**
+     * Creates a bufferview based on the vertices type for the Babylon mesh
+     * @param babylonSubMesh The Babylon submesh that the morph target is applied to
+     * @param babylonMorphTarget the morph target to be exported
+     * @param binaryWriter The buffer to write the bufferview data to
+     * @param convertToRightHandedSystem Converts the values to right-handed
+     */
+        private setMorphTargetAttributes;
+        /**
          * The primitive mode of the Babylon mesh
          * The primitive mode of the Babylon mesh
          * @param babylonMesh The BabylonJS mesh
          * @param babylonMesh The BabylonJS mesh
          */
          */
@@ -991,7 +1011,7 @@ declare module "babylonjs-serializers/glTF/2.0/glTFAnimation" {
         /**
         /**
          * The glTF accessor type for the data.
          * The glTF accessor type for the data.
          */
          */
-        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4;
+        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
         /**
         /**
          * Specifies if quaternions should be used.
          * Specifies if quaternions should be used.
          */
          */
@@ -1033,8 +1053,25 @@ declare module "babylonjs-serializers/glTF/2.0/glTFAnimation" {
             [key: number]: number;
             [key: number]: number;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         /**
         /**
+     * @ignore
+     * Create individual morph animations from the mesh's morph target animation tracks
+     * @param babylonNode
+     * @param runtimeGLTFAnimation
+     * @param idleGLTFAnimations
+     * @param nodeMap
+     * @param nodes
+     * @param binaryWriter
+     * @param bufferViews
+     * @param accessors
+     * @param convertToRightHandedSystem
+     * @param animationSampleRate
+     */
+        static _CreateMorphTargetAnimationFromMorphTargets(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
+            [key: number]: number;
+        }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
+        /**
          * @ignore
          * @ignore
-         * Create node animations from the animation groups
+         * Create node and morph animations from the animation groups
          * @param babylonScene
          * @param babylonScene
          * @param glTFAnimations
          * @param glTFAnimations
          * @param nodeMap
          * @param nodeMap
@@ -1834,6 +1871,7 @@ declare module BABYLON.GLTF2.Exporter {
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _NormalizeTangentFromRef(tangent: Vector4): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
         static _GetRightHandedMatrixFromRef(matrix: Matrix): void;
+        static _GetDataAccessorElementCount(accessorType: AccessorType): 1 | 3 | 2 | 4 | 9 | 16;
     }
     }
 }
 }
 declare module BABYLON.GLTF2.Exporter {
 declare module BABYLON.GLTF2.Exporter {
@@ -2054,6 +2092,16 @@ declare module BABYLON.GLTF2.Exporter {
          */
          */
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         writeAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, babylonTransformNode: TransformNode): void;
         /**
         /**
+         * Writes mesh attribute data to a data buffer
+         * Returns the bytelength of the data
+         * @param vertexBufferKind Indicates what kind of vertex data is being passed in
+         * @param meshAttributeArray Array containing the attribute data
+         * @param byteStride Specifies the space between data
+         * @param binaryWriter The buffer to write the binary data to
+         * @param convertToRightHandedSystem Converts the values to right-handed
+         */
+        writeMorphTargetAttributeData(vertexBufferKind: string, attributeComponentKind: AccessorComponentType, meshPrimitive: SubMesh, morphTarget: MorphTarget, meshAttributeArray: FloatArray, morphTargetAttributeArray: FloatArray, stride: number, binaryWriter: _BinaryWriter, convertToRightHandedSystem: boolean, minMax?: any): void;
+        /**
          * Generates glTF json data
          * Generates glTF json data
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param shouldUseGlb Indicates whether the json should be written for a glb file
          * @param glTFPrefix Text to use when prefixing a glTF file
          * @param glTFPrefix Text to use when prefixing a glTF file
@@ -2101,6 +2149,14 @@ declare module BABYLON.GLTF2.Exporter {
          */
          */
         private createBufferViewKind;
         private createBufferViewKind;
         /**
         /**
+     * Creates a bufferview based on the vertices type for the Babylon mesh
+     * @param babylonSubMesh The Babylon submesh that the morph target is applied to
+     * @param babylonMorphTarget the morph target to be exported
+     * @param binaryWriter The buffer to write the bufferview data to
+     * @param convertToRightHandedSystem Converts the values to right-handed
+     */
+        private setMorphTargetAttributes;
+        /**
          * The primitive mode of the Babylon mesh
          * The primitive mode of the Babylon mesh
          * @param babylonMesh The BabylonJS mesh
          * @param babylonMesh The BabylonJS mesh
          */
          */
@@ -2276,7 +2332,7 @@ declare module BABYLON.GLTF2.Exporter {
         /**
         /**
          * The glTF accessor type for the data.
          * The glTF accessor type for the data.
          */
          */
-        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4;
+        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
         /**
         /**
          * Specifies if quaternions should be used.
          * Specifies if quaternions should be used.
          */
          */
@@ -2318,8 +2374,25 @@ declare module BABYLON.GLTF2.Exporter {
             [key: number]: number;
             [key: number]: number;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
         /**
         /**
+     * @ignore
+     * Create individual morph animations from the mesh's morph target animation tracks
+     * @param babylonNode
+     * @param runtimeGLTFAnimation
+     * @param idleGLTFAnimations
+     * @param nodeMap
+     * @param nodes
+     * @param binaryWriter
+     * @param bufferViews
+     * @param accessors
+     * @param convertToRightHandedSystem
+     * @param animationSampleRate
+     */
+        static _CreateMorphTargetAnimationFromMorphTargets(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
+            [key: number]: number;
+        }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
+        /**
          * @ignore
          * @ignore
-         * Create node animations from the animation groups
+         * Create node and morph animations from the animation groups
          * @param babylonScene
          * @param babylonScene
          * @param glTFAnimations
          * @param glTFAnimations
          * @param nodeMap
          * @param nodeMap

+ 87 - 62
dist/preview release/viewer/babylon.module.d.ts

@@ -9534,6 +9534,7 @@ declare module "babylonjs/Actions/action" {
     import { Observable } from "babylonjs/Misc/observable";
     import { Observable } from "babylonjs/Misc/observable";
     import { Condition } from "babylonjs/Actions/condition";
     import { Condition } from "babylonjs/Actions/condition";
     import { AbstractActionManager } from "babylonjs/Actions/abstractActionManager";
     import { AbstractActionManager } from "babylonjs/Actions/abstractActionManager";
+    import { Nullable } from "babylonjs/types";
     import { Scene } from "babylonjs/scene";
     import { Scene } from "babylonjs/scene";
     import { ActionManager } from "babylonjs/Actions/actionManager";
     import { ActionManager } from "babylonjs/Actions/actionManager";
     import { ActionEvent } from "babylonjs/Actions/actionEvent";
     import { ActionEvent } from "babylonjs/Actions/actionEvent";
@@ -9573,7 +9574,7 @@ declare module "babylonjs/Actions/action" {
          * Internal only - manager for action
          * Internal only - manager for action
          * @hidden
          * @hidden
          */
          */
-        _actionManager: AbstractActionManager;
+        _actionManager: Nullable<AbstractActionManager>;
         /**
         /**
          * Adds action to chain of actions, may be a DoNothingAction
          * Adds action to chain of actions, may be a DoNothingAction
          * @param action defines the next action to execute
          * @param action defines the next action to execute
@@ -11924,7 +11925,6 @@ declare module "babylonjs/Materials/Textures/Procedurals/proceduralTexture" {
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      */
      */
     export class ProceduralTexture extends Texture {
     export class ProceduralTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
          * Define if the texture is enabled or not (disabled texture will not render)
          */
          */
@@ -16443,6 +16443,8 @@ declare module "babylonjs/Bones/skeleton" {
         _numBonesWithLinkedTransformNode: number;
         _numBonesWithLinkedTransformNode: number;
         /** @hidden */
         /** @hidden */
         _hasWaitingData: Nullable<boolean>;
         _hasWaitingData: Nullable<boolean>;
+        /** @hidden */
+        _waitingOverrideMeshId: Nullable<string>;
         /**
         /**
          * Specifies if the skeleton should be serialized
          * Specifies if the skeleton should be serialized
          */
          */
@@ -24118,6 +24120,8 @@ declare module "babylonjs/Materials/Textures/texture" {
         private _delayedOnLoad;
         private _delayedOnLoad;
         private _delayedOnError;
         private _delayedOnError;
         private _mimeType?;
         private _mimeType?;
+        /** Returns the texture mime type if it was defined by a loader (undefined else) */
+        get mimeType(): string | undefined;
         /**
         /**
          * Observable triggered once the texture has been loaded.
          * Observable triggered once the texture has been loaded.
          */
          */
@@ -24320,7 +24324,6 @@ declare module "babylonjs/Materials/Textures/renderTargetTexture" {
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      */
      */
     export class RenderTargetTexture extends Texture {
     export class RenderTargetTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          */
          */
@@ -24365,10 +24368,6 @@ declare module "babylonjs/Materials/Textures/renderTargetTexture" {
          */
          */
         renderSprites: boolean;
         renderSprites: boolean;
         /**
         /**
-         * Override the default coordinates mode to projection for RTT as it is the most common case for rendered textures.
-         */
-        coordinatesMode: number;
-        /**
          * Define the camera used to render the texture.
          * Define the camera used to render the texture.
          */
          */
         activeCamera: Nullable<Camera>;
         activeCamera: Nullable<Camera>;
@@ -24459,7 +24458,7 @@ declare module "babylonjs/Materials/Textures/renderTargetTexture" {
         _generateMipMaps: boolean;
         _generateMipMaps: boolean;
         protected _renderingManager: RenderingManager;
         protected _renderingManager: RenderingManager;
         /** @hidden */
         /** @hidden */
-        _waitingRenderList: string[];
+        _waitingRenderList?: string[];
         protected _doNotChangeAspectRatio: boolean;
         protected _doNotChangeAspectRatio: boolean;
         protected _currentRefreshId: number;
         protected _currentRefreshId: number;
         protected _refreshRate: number;
         protected _refreshRate: number;
@@ -30407,11 +30406,13 @@ declare module "babylonjs/Cameras/camera" {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
+        protected _upVector: Vector3;
         /**
         /**
          * The vector the camera should consider as up.
          * The vector the camera should consider as up.
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          */
          */
-        upVector: Vector3;
+        set upVector(vec: Vector3);
+        get upVector(): Vector3;
         /**
         /**
          * Define the current limit on the left side for an orthographic camera
          * Define the current limit on the left side for an orthographic camera
          * In scene unit
          * In scene unit
@@ -33276,11 +33277,13 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          */
          */
         enablePointerMoveEvents: boolean;
         enablePointerMoveEvents: boolean;
+        private _renderingGroupId;
         /**
         /**
          * Specifies the rendering group id for this mesh (0 by default)
          * Specifies the rendering group id for this mesh (0 by default)
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          */
          */
-        renderingGroupId: number;
+        get renderingGroupId(): number;
+        set renderingGroupId(value: number);
         private _material;
         private _material;
         /** Gets or sets current material */
         /** Gets or sets current material */
         get material(): Nullable<Material>;
         get material(): Nullable<Material>;
@@ -35065,7 +35068,7 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
          * This is part of the texture as textures usually maps to one uv set.
          * This is part of the texture as textures usually maps to one uv set.
          */
          */
         coordinatesIndex: number;
         coordinatesIndex: number;
-        private _coordinatesMode;
+        protected _coordinatesMode: number;
         /**
         /**
         * How a texture is mapped.
         * How a texture is mapped.
         *
         *
@@ -35084,6 +35087,7 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
         */
         */
         set coordinatesMode(value: number);
         set coordinatesMode(value: number);
         get coordinatesMode(): number;
         get coordinatesMode(): number;
+        private _wrapU;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -35091,7 +35095,9 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapU: number;
+        get wrapU(): number;
+        set wrapU(value: number);
+        private _wrapV;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -35099,7 +35105,8 @@ declare module "babylonjs/Materials/Textures/baseTexture" {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapV: number;
+        get wrapV(): number;
+        set wrapV(value: number);
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -40731,8 +40738,6 @@ declare module "babylonjs/scene" {
          * The material properties need to be setup according to the type of texture in use.
          * The material properties need to be setup according to the type of texture in use.
          */
          */
         environmentBRDFTexture: BaseTexture;
         environmentBRDFTexture: BaseTexture;
-        /** @hidden */
-        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
          * Texture used in all pbr material as the reflection texture.
          * Texture used in all pbr material as the reflection texture.
          * As in the majority of the scene they are the same (exception for multi room and so on),
          * As in the majority of the scene they are the same (exception for multi room and so on),
@@ -42510,6 +42515,13 @@ declare module "babylonjs/scene" {
          */
          */
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         /**
         /**
+         * Get a list of transform nodes by tags
+         * @param tagsQuery defines the tags query to use
+         * @param forEach defines a predicate used to filter results
+         * @returns an array of TransformNode
+         */
+        getTransformNodesByTags(tagsQuery: string, forEach?: (transform: TransformNode) => void): TransformNode[];
+        /**
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          *
          *
@@ -42795,10 +42807,15 @@ declare module "babylonjs/abstractScene" {
          * Textures to keep.
          * Textures to keep.
          */
          */
         textures: BaseTexture[];
         textures: BaseTexture[];
+        /** @hidden */
+        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
-         * Environment texture for the scene
+         * Texture used in all pbr material as the reflection texture.
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
          */
          */
-        environmentTexture: Nullable<BaseTexture>;
+        get environmentTexture(): Nullable<BaseTexture>;
+        set environmentTexture(value: Nullable<BaseTexture>);
         /**
         /**
          * The list of postprocesses added to the scene
          * The list of postprocesses added to the scene
          */
          */
@@ -44312,7 +44329,6 @@ declare module "babylonjs/Cameras/arcRotateCamera" {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
-        protected _upVector: Vector3;
         protected _upToYMatrix: Matrix;
         protected _upToYMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         /**
         /**
@@ -52255,7 +52271,12 @@ declare module "babylonjs/Gizmos/gizmo" {
         /**
         /**
          * Ratio for the scale of the gizmo (Default: 1)
          * Ratio for the scale of the gizmo (Default: 1)
          */
          */
-        scaleRatio: number;
+        protected _scaleRatio: number;
+        /**
+         * Ratio for the scale of the gizmo (Default: 1)
+         */
+        set scaleRatio(value: number);
+        get scaleRatio(): number;
         /**
         /**
          * If a custom mesh has been set (Default: false)
          * If a custom mesh has been set (Default: false)
          */
          */
@@ -52277,10 +52298,12 @@ declare module "babylonjs/Gizmos/gizmo" {
          * @param mesh The mesh to replace the default mesh of the gizmo
          * @param mesh The mesh to replace the default mesh of the gizmo
          */
          */
         setCustomMesh(mesh: Mesh): void;
         setCustomMesh(mesh: Mesh): void;
+        protected _updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
         /**
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          */
          */
-        updateGizmoRotationToMatchAttachedMesh: boolean;
+        set updateGizmoRotationToMatchAttachedMesh(value: boolean);
+        get updateGizmoRotationToMatchAttachedMesh(): boolean;
         /**
         /**
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          */
          */
@@ -52421,9 +52444,7 @@ declare module "babylonjs/Gizmos/positionGizmo" {
          */
          */
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
         /** Fires an event when any of it's sub gizmos are dragged */
         onDragStartObservable: Observable<unknown>;
         onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
         /** Fires an event when any of it's sub gizmos are released from dragging */
@@ -52550,7 +52571,7 @@ declare module "babylonjs/Debug/axesViewer" {
         /**
         /**
          * Gets the hosting scene
          * Gets the hosting scene
          */
          */
-        scene: Scene;
+        scene: Nullable<Scene>;
         /**
         /**
          * Gets or sets a number used to scale line length
          * Gets or sets a number used to scale line length
          */
          */
@@ -55638,9 +55659,7 @@ declare module "babylonjs/Gizmos/scaleGizmo" {
         uniformScaleGizmo: AxisScaleGizmo;
         uniformScaleGizmo: AxisScaleGizmo;
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         private _uniformScalingMesh;
         private _uniformScalingMesh;
         private _octahedron;
         private _octahedron;
         private _sensitivity;
         private _sensitivity;
@@ -63036,10 +63055,6 @@ declare module "babylonjs/Materials/Textures/hdrCubeTexture" {
          * The texture URL.
          * The texture URL.
          */
          */
         url: string;
         url: string;
-        /**
-         * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.
-         */
-        coordinatesMode: number;
         protected _isBlocking: boolean;
         protected _isBlocking: boolean;
         /**
         /**
          * Sets wether or not the texture is blocking during loading.
          * Sets wether or not the texture is blocking during loading.
@@ -64219,8 +64234,6 @@ declare module "babylonjs/Materials/Textures/equiRectangularCubeTexture" {
         private _height;
         private _height;
         /** The URL to the image. */
         /** The URL to the image. */
         url: string;
         url: string;
-        /** The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. */
-        coordinatesMode: number;
         /**
         /**
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * @param url The location of the image
          * @param url The location of the image
@@ -89036,7 +89049,7 @@ declare module BABYLON {
          * Internal only - manager for action
          * Internal only - manager for action
          * @hidden
          * @hidden
          */
          */
-        _actionManager: AbstractActionManager;
+        _actionManager: Nullable<AbstractActionManager>;
         /**
         /**
          * Adds action to chain of actions, may be a DoNothingAction
          * Adds action to chain of actions, may be a DoNothingAction
          * @param action defines the next action to execute
          * @param action defines the next action to execute
@@ -91285,7 +91298,6 @@ declare module BABYLON {
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      * @see https://doc.babylonjs.com/how_to/how_to_use_procedural_textures
      */
      */
     export class ProceduralTexture extends Texture {
     export class ProceduralTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * Define if the texture is enabled or not (disabled texture will not render)
          * Define if the texture is enabled or not (disabled texture will not render)
          */
          */
@@ -95643,6 +95655,8 @@ declare module BABYLON {
         _numBonesWithLinkedTransformNode: number;
         _numBonesWithLinkedTransformNode: number;
         /** @hidden */
         /** @hidden */
         _hasWaitingData: Nullable<boolean>;
         _hasWaitingData: Nullable<boolean>;
+        /** @hidden */
+        _waitingOverrideMeshId: Nullable<string>;
         /**
         /**
          * Specifies if the skeleton should be serialized
          * Specifies if the skeleton should be serialized
          */
          */
@@ -102909,6 +102923,8 @@ declare module BABYLON {
         private _delayedOnLoad;
         private _delayedOnLoad;
         private _delayedOnError;
         private _delayedOnError;
         private _mimeType?;
         private _mimeType?;
+        /** Returns the texture mime type if it was defined by a loader (undefined else) */
+        get mimeType(): string | undefined;
         /**
         /**
          * Observable triggered once the texture has been loaded.
          * Observable triggered once the texture has been loaded.
          */
          */
@@ -103090,7 +103106,6 @@ declare module BABYLON {
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      * Actually, It is the base of lot of effects in the framework like post process, shadows, effect layers and rendering pipelines...
      */
      */
     export class RenderTargetTexture extends Texture {
     export class RenderTargetTexture extends Texture {
-        isCube: boolean;
         /**
         /**
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          * The texture will only be rendered once which can be useful to improve performance if everything in your render is static for instance.
          */
          */
@@ -103135,10 +103150,6 @@ declare module BABYLON {
          */
          */
         renderSprites: boolean;
         renderSprites: boolean;
         /**
         /**
-         * Override the default coordinates mode to projection for RTT as it is the most common case for rendered textures.
-         */
-        coordinatesMode: number;
-        /**
          * Define the camera used to render the texture.
          * Define the camera used to render the texture.
          */
          */
         activeCamera: Nullable<Camera>;
         activeCamera: Nullable<Camera>;
@@ -103229,7 +103240,7 @@ declare module BABYLON {
         _generateMipMaps: boolean;
         _generateMipMaps: boolean;
         protected _renderingManager: RenderingManager;
         protected _renderingManager: RenderingManager;
         /** @hidden */
         /** @hidden */
-        _waitingRenderList: string[];
+        _waitingRenderList?: string[];
         protected _doNotChangeAspectRatio: boolean;
         protected _doNotChangeAspectRatio: boolean;
         protected _currentRefreshId: number;
         protected _currentRefreshId: number;
         protected _refreshRate: number;
         protected _refreshRate: number;
@@ -108996,11 +109007,13 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
+        protected _upVector: Vector3;
         /**
         /**
          * The vector the camera should consider as up.
          * The vector the camera should consider as up.
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          * (default is Vector3(0, 1, 0) aka Vector3.Up())
          */
          */
-        upVector: Vector3;
+        set upVector(vec: Vector3);
+        get upVector(): Vector3;
         /**
         /**
          * Define the current limit on the left side for an orthographic camera
          * Define the current limit on the left side for an orthographic camera
          * In scene unit
          * In scene unit
@@ -111744,11 +111757,13 @@ declare module BABYLON {
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)
          */
          */
         enablePointerMoveEvents: boolean;
         enablePointerMoveEvents: boolean;
+        private _renderingGroupId;
         /**
         /**
          * Specifies the rendering group id for this mesh (0 by default)
          * Specifies the rendering group id for this mesh (0 by default)
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
          */
          */
-        renderingGroupId: number;
+        get renderingGroupId(): number;
+        set renderingGroupId(value: number);
         private _material;
         private _material;
         /** Gets or sets current material */
         /** Gets or sets current material */
         get material(): Nullable<Material>;
         get material(): Nullable<Material>;
@@ -113480,7 +113495,7 @@ declare module BABYLON {
          * This is part of the texture as textures usually maps to one uv set.
          * This is part of the texture as textures usually maps to one uv set.
          */
          */
         coordinatesIndex: number;
         coordinatesIndex: number;
-        private _coordinatesMode;
+        protected _coordinatesMode: number;
         /**
         /**
         * How a texture is mapped.
         * How a texture is mapped.
         *
         *
@@ -113499,6 +113514,7 @@ declare module BABYLON {
         */
         */
         set coordinatesMode(value: number);
         set coordinatesMode(value: number);
         get coordinatesMode(): number;
         get coordinatesMode(): number;
+        private _wrapU;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -113506,7 +113522,9 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapU: number;
+        get wrapU(): number;
+        set wrapU(value: number);
+        private _wrapV;
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -113514,7 +113532,8 @@ declare module BABYLON {
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 1     | WRAP_ADDRESSMODE   |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         * | 2     | MIRROR_ADDRESSMODE |             |
         */
         */
-        wrapV: number;
+        get wrapV(): number;
+        set wrapV(value: number);
         /**
         /**
         * | Value | Type               | Description |
         * | Value | Type               | Description |
         * | ----- | ------------------ | ----------- |
         * | ----- | ------------------ | ----------- |
@@ -118975,8 +118994,6 @@ declare module BABYLON {
          * The material properties need to be setup according to the type of texture in use.
          * The material properties need to be setup according to the type of texture in use.
          */
          */
         environmentBRDFTexture: BaseTexture;
         environmentBRDFTexture: BaseTexture;
-        /** @hidden */
-        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
          * Texture used in all pbr material as the reflection texture.
          * Texture used in all pbr material as the reflection texture.
          * As in the majority of the scene they are the same (exception for multi room and so on),
          * As in the majority of the scene they are the same (exception for multi room and so on),
@@ -120754,6 +120771,13 @@ declare module BABYLON {
          */
          */
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[];
         /**
         /**
+         * Get a list of transform nodes by tags
+         * @param tagsQuery defines the tags query to use
+         * @param forEach defines a predicate used to filter results
+         * @returns an array of TransformNode
+         */
+        getTransformNodesByTags(tagsQuery: string, forEach?: (transform: TransformNode) => void): TransformNode[];
+        /**
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * Overrides the default sort function applied in the renderging group to prepare the meshes.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          * This allowed control for front to back rendering or reversly depending of the special needs.
          *
          *
@@ -121012,10 +121036,15 @@ declare module BABYLON {
          * Textures to keep.
          * Textures to keep.
          */
          */
         textures: BaseTexture[];
         textures: BaseTexture[];
+        /** @hidden */
+        protected _environmentTexture: Nullable<BaseTexture>;
         /**
         /**
-         * Environment texture for the scene
+         * Texture used in all pbr material as the reflection texture.
+         * As in the majority of the scene they are the same (exception for multi room and so on),
+         * this is easier to reference from here than from all the materials.
          */
          */
-        environmentTexture: Nullable<BaseTexture>;
+        get environmentTexture(): Nullable<BaseTexture>;
+        set environmentTexture(value: Nullable<BaseTexture>);
         /**
         /**
          * The list of postprocesses added to the scene
          * The list of postprocesses added to the scene
          */
          */
@@ -122434,7 +122463,6 @@ declare module BABYLON {
          */
          */
         get position(): Vector3;
         get position(): Vector3;
         set position(newPosition: Vector3);
         set position(newPosition: Vector3);
-        protected _upVector: Vector3;
         protected _upToYMatrix: Matrix;
         protected _upToYMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         protected _YToUpMatrix: Matrix;
         /**
         /**
@@ -129899,7 +129927,12 @@ declare module BABYLON {
         /**
         /**
          * Ratio for the scale of the gizmo (Default: 1)
          * Ratio for the scale of the gizmo (Default: 1)
          */
          */
-        scaleRatio: number;
+        protected _scaleRatio: number;
+        /**
+         * Ratio for the scale of the gizmo (Default: 1)
+         */
+        set scaleRatio(value: number);
+        get scaleRatio(): number;
         /**
         /**
          * If a custom mesh has been set (Default: false)
          * If a custom mesh has been set (Default: false)
          */
          */
@@ -129921,10 +129954,12 @@ declare module BABYLON {
          * @param mesh The mesh to replace the default mesh of the gizmo
          * @param mesh The mesh to replace the default mesh of the gizmo
          */
          */
         setCustomMesh(mesh: Mesh): void;
         setCustomMesh(mesh: Mesh): void;
+        protected _updateGizmoRotationToMatchAttachedMesh: boolean;
         /**
         /**
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
          */
          */
-        updateGizmoRotationToMatchAttachedMesh: boolean;
+        set updateGizmoRotationToMatchAttachedMesh(value: boolean);
+        get updateGizmoRotationToMatchAttachedMesh(): boolean;
         /**
         /**
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          * If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
          */
          */
@@ -130044,9 +130079,7 @@ declare module BABYLON {
          */
          */
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         /** Fires an event when any of it's sub gizmos are dragged */
         /** Fires an event when any of it's sub gizmos are dragged */
         onDragStartObservable: Observable<unknown>;
         onDragStartObservable: Observable<unknown>;
         /** Fires an event when any of it's sub gizmos are released from dragging */
         /** Fires an event when any of it's sub gizmos are released from dragging */
@@ -130157,7 +130190,7 @@ declare module BABYLON.Debug {
         /**
         /**
          * Gets the hosting scene
          * Gets the hosting scene
          */
          */
-        scene: Scene;
+        scene: Nullable<Scene>;
         /**
         /**
          * Gets or sets a number used to scale line length
          * Gets or sets a number used to scale line length
          */
          */
@@ -133006,9 +133039,7 @@ declare module BABYLON {
         uniformScaleGizmo: AxisScaleGizmo;
         uniformScaleGizmo: AxisScaleGizmo;
         private _meshAttached;
         private _meshAttached;
         private _nodeAttached;
         private _nodeAttached;
-        private _updateGizmoRotationToMatchAttachedMesh;
         private _snapDistance;
         private _snapDistance;
-        private _scaleRatio;
         private _uniformScalingMesh;
         private _uniformScalingMesh;
         private _octahedron;
         private _octahedron;
         private _sensitivity;
         private _sensitivity;
@@ -139856,10 +139887,6 @@ declare module BABYLON {
          * The texture URL.
          * The texture URL.
          */
          */
         url: string;
         url: string;
-        /**
-         * The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.
-         */
-        coordinatesMode: number;
         protected _isBlocking: boolean;
         protected _isBlocking: boolean;
         /**
         /**
          * Sets wether or not the texture is blocking during loading.
          * Sets wether or not the texture is blocking during loading.
@@ -140964,8 +140991,6 @@ declare module BABYLON {
         private _height;
         private _height;
         /** The URL to the image. */
         /** The URL to the image. */
         url: string;
         url: string;
-        /** The texture coordinates mode. As this texture is stored in a cube format, please modify carefully. */
-        coordinatesMode: number;
         /**
         /**
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * Instantiates an EquiRectangularCubeTexture from the following parameters.
          * @param url The location of the image
          * @param url The location of the image

+ 1 - 1
dist/preview release/viewer/babylon.viewer.d.ts

@@ -1416,7 +1416,7 @@ declare module BabylonViewer {
             /**
             /**
                 * Babylon's scene optimizer
                 * Babylon's scene optimizer
                 */
                 */
-            sceneOptimizer: BABYLON.SceneOptimizer;
+            sceneOptimizer?: BABYLON.SceneOptimizer;
             /**
             /**
                 * Models displayed in this viewer.
                 * Models displayed in this viewer.
                 */
                 */

文件差异内容过多而无法显示
+ 521 - 521
dist/preview release/viewer/babylon.viewer.js


文件差异内容过多而无法显示
+ 14 - 14
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 1
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -1550,7 +1550,7 @@ declare module 'babylonjs-viewer/managers/sceneManager' {
             /**
             /**
                 * Babylon's scene optimizer
                 * Babylon's scene optimizer
                 */
                 */
-            sceneOptimizer: SceneOptimizer;
+            sceneOptimizer?: SceneOptimizer;
             /**
             /**
                 * Models displayed in this viewer.
                 * Models displayed in this viewer.
                 */
                 */

+ 4 - 1
dist/preview release/what's new.md

@@ -43,6 +43,7 @@
 - Added `AssetContainerTask` support to `AssetsManager` class ([MackeyK24](https://github.com/MackeyK24))
 - Added `AssetContainerTask` support to `AssetsManager` class ([MackeyK24](https://github.com/MackeyK24))
 - Changed DeviceSourceManager getInput contract to no longer return nullable values ([Drigax](https://github.com/drigax))
 - Changed DeviceSourceManager getInput contract to no longer return nullable values ([Drigax](https://github.com/drigax))
 - Photo Dome and Video Dome now use the same abstract class and support the same parameters ([#8771](https://github.com/BabylonJS/Babylon.js/issues/8771)) ([RaananW](https://github.com/RaananW))
 - Photo Dome and Video Dome now use the same abstract class and support the same parameters ([#8771](https://github.com/BabylonJS/Babylon.js/issues/8771)) ([RaananW](https://github.com/RaananW))
+- Added `getTransformNodesByTags` support to `Scene` class ([MackeyK24](https://github.com/MackeyK24))
 
 
 ### Engine
 ### Engine
 
 
@@ -84,7 +85,7 @@
 - Popup Window available (To be used in Curve Editor) ([pixelspace](https://github.com/devpixelspace))
 - Popup Window available (To be used in Curve Editor) ([pixelspace](https://github.com/devpixelspace))
 - Add support to update inspector when switching to a new scene ([belfortk](https://github.com/belfortk))
 - Add support to update inspector when switching to a new scene ([belfortk](https://github.com/belfortk))
 - Hex Component for Hex inputs on layer masks. ([msDestiny14](https://github.com/msDestiny14))
 - Hex Component for Hex inputs on layer masks. ([msDestiny14](https://github.com/msDestiny14))
-- View & edit textures in pop out inspector using canvas and postprocesses. Supports region selection and individual channel editing. ([DarraghBurkeMS](https://github.com/DarraghBurkeMS))
+- View & edit textures in pop out inspector using 5 tools. Supports region selection and individual channel editing. ([DarraghBurkeMS](https://github.com/DarraghBurkeMS))
 
 
 ### Cameras
 ### Cameras
 
 
@@ -130,6 +131,7 @@
 
 
 - Added support for KHR_materials_unlit to glTF serializer ([Popov72](https://github.com/Popov72))
 - Added support for KHR_materials_unlit to glTF serializer ([Popov72](https://github.com/Popov72))
 - Added support for glTF Skins to glTF serializer ([Drigax](https://github.com/Drigax))
 - Added support for glTF Skins to glTF serializer ([Drigax](https://github.com/Drigax))
+- Added support for glTF Morph Target serialization ([Drigax](https://github.com/Drigax))
 
 
 ### Navigation
 ### Navigation
 
 
@@ -290,6 +292,7 @@
 - Fix the bounding box of instances that does not match the instance position / rotation / scaling ([Popov72](https://github.com/Popov72))
 - Fix the bounding box of instances that does not match the instance position / rotation / scaling ([Popov72](https://github.com/Popov72))
 - Fix an issue with sound updateOptions not updating the underlying sound buffer/html element ([RaananW](https://github.com/RaananW))
 - Fix an issue with sound updateOptions not updating the underlying sound buffer/html element ([RaananW](https://github.com/RaananW))
 - Fixed bug in sphereBuilder where top and bottom segments added 6 indices per triangle instead of 3. ([aWeirdo](https://github.com/aWeirdo))
 - Fixed bug in sphereBuilder where top and bottom segments added 6 indices per triangle instead of 3. ([aWeirdo](https://github.com/aWeirdo))
+- Fixed issue with Babylon scene export of loaded glTF meshes.([Drigax]/(https://github.com/drigax))
 
 
 ## Breaking changes
 ## Breaking changes
 - `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh))
 - `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh))

+ 2 - 0
gui/src/2D/controls/image.ts

@@ -384,6 +384,7 @@ export class Image extends Control {
     }
     }
 
 
     private _onImageLoaded(): void {
     private _onImageLoaded(): void {
+        this._imageDataCache.data = null;
         this._imageWidth = this._domImage.width;
         this._imageWidth = this._domImage.width;
         this._imageHeight = this._domImage.height;
         this._imageHeight = this._domImage.height;
         this._loaded = true;
         this._loaded = true;
@@ -652,6 +653,7 @@ export class Image extends Control {
             const context = canvas.getContext("2d")!;
             const context = canvas.getContext("2d")!;
 
 
             this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data;
             this._imageDataCache.data = imageData = context.getImageData(0, 0, width, height).data;
+            this._imageDataCache.key = key;
         }
         }
 
 
         x = (x - this._currentMeasure.left) | 0;
         x = (x - this._currentMeasure.left) | 0;

+ 0 - 6
gui/src/3D/materials/fluentMaterial.ts

@@ -49,12 +49,6 @@ export class FluentMaterial extends PushMaterial {
     public innerGlowColor = new Color3(1.0, 1.0, 1.0);
     public innerGlowColor = new Color3(1.0, 1.0, 1.0);
 
 
     /**
     /**
-     * Gets or sets alpha value (default is 1.0)
-     */
-    @serialize()
-    public alpha = 1.0;
-
-    /**
      * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
      * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
      */
      */
     @serializeAsColor3()
     @serializeAsColor3()

+ 13 - 2
inspector/src/components/actionTabs/lines/numericInputComponent.tsx

@@ -23,7 +23,6 @@ export class NumericInputComponent extends React.Component<INumericInputComponen
 
 
     shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: { value: string }) {
     shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: { value: string }) {
         if (this._localChange) {
         if (this._localChange) {
-            this._localChange = false;
             return true;
             return true;
         }
         }
 
 
@@ -53,6 +52,18 @@ export class NumericInputComponent extends React.Component<INumericInputComponen
         this.props.onChange(valueAsNumber);
         this.props.onChange(valueAsNumber);
     }
     }
 
 
+    onBlur() {
+        this._localChange = false;
+        let valueAsNumber = parseFloat(this.state.value);
+
+        if (isNaN(valueAsNumber)) {
+            this.props.onChange(this.props.value);
+            return;
+        }
+
+        this.props.onChange(valueAsNumber);
+    }
+
     render() {
     render() {
         return (
         return (
             <div className="numeric">
             <div className="numeric">
@@ -62,7 +73,7 @@ export class NumericInputComponent extends React.Component<INumericInputComponen
                         {`${this.props.label}: `}
                         {`${this.props.label}: `}
                     </div>
                     </div>
                 }
                 }
-                <input type="number" step={this.props.step} className="numeric-input" value={this.state.value} onChange={evt => this.updateValue(evt)} />
+                <input type="number" step={this.props.step} className="numeric-input" value={this.state.value} onChange={evt => this.updateValue(evt)} onBlur={() => this.onBlur()}/>
             </div>
             </div>
         )
         )
     }
     }

+ 13 - 9
inspector/src/components/actionTabs/tabs/propertyGrids/materials/texturePropertyGridComponent.tsx

@@ -48,6 +48,8 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
     private popoutWindowRef : React.RefObject<PopupComponent>;
     private popoutWindowRef : React.RefObject<PopupComponent>;
     private textureLineRef: React.RefObject<TextureLineComponent>;
     private textureLineRef: React.RefObject<TextureLineComponent>;
 
 
+    private _textureInspectorSize = {width: 1024, height: 490};
+
 
 
     constructor(props: ITexturePropertyGridComponentProps) {
     constructor(props: ITexturePropertyGridComponentProps) {
         super(props);
         super(props);
@@ -70,6 +72,9 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
         this._adtInstrumentation = new AdvancedDynamicTextureInstrumentation(adt);
         this._adtInstrumentation = new AdvancedDynamicTextureInstrumentation(adt);
         this._adtInstrumentation!.captureRenderTime = true;
         this._adtInstrumentation!.captureRenderTime = true;
         this._adtInstrumentation!.captureLayoutTime = true;
         this._adtInstrumentation!.captureLayoutTime = true;
+        
+        this.onOpenTextureEditor.bind(this);
+        this.onCloseTextureEditor.bind(this);
     }
     }
 
 
     componentWillUnmount() {
     componentWillUnmount() {
@@ -106,9 +111,9 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
         }, undefined, true);
         }, undefined, true);
     }
     }
 
 
-    onOpenTextureEditor() {
+    openTextureEditor() {
         if (this.state.isTextureEditorOpen && this.state.textureEditing !== this.props.texture) {
         if (this.state.isTextureEditorOpen && this.state.textureEditing !== this.props.texture) {
-            this.onCloseTextureEditor(null, () => this.onOpenTextureEditor());
+            this.onCloseTextureEditor(null, () => this.openTextureEditor());
             return;
             return;
         }
         }
         this.setState({
         this.setState({
@@ -116,6 +121,8 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
             textureEditing: this.props.texture
             textureEditing: this.props.texture
         });
         });
     }
     }
+
+    onOpenTextureEditor(window: Window) {}
     
     
     onCloseTextureEditor(window: Window | null, callback?: {() : void}) {
     onCloseTextureEditor(window: Window | null, callback?: {() : void}) {
         this.setState({
         this.setState({
@@ -169,7 +176,7 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
                 <LineContainerComponent globalState={this.props.globalState} title="PREVIEW">
                 <LineContainerComponent globalState={this.props.globalState} title="PREVIEW">
                     <TextureLineComponent ref={this.textureLineRef} texture={texture} width={256} height={256} globalState={this.props.globalState} />
                     <TextureLineComponent ref={this.textureLineRef} texture={texture} width={256} height={256} globalState={this.props.globalState} />
                     <FileButtonLineComponent label="Load texture from file" onClick={(file) => this.updateTexture(file)} accept=".jpg, .png, .tga, .dds, .env" />
                     <FileButtonLineComponent label="Load texture from file" onClick={(file) => this.updateTexture(file)} accept=".jpg, .png, .tga, .dds, .env" />
-                    <ButtonLineComponent label="Edit" onClick={() => this.onOpenTextureEditor()} />
+                    <ButtonLineComponent label="Edit" onClick={() => this.openTextureEditor()} />
                     <TextInputLineComponent label="URL" value={textureUrl} lockObject={this.props.lockObject} onChange={url => {
                     <TextInputLineComponent label="URL" value={textureUrl} lockObject={this.props.lockObject} onChange={url => {
                         (texture as Texture).updateURL(url);
                         (texture as Texture).updateURL(url);
                         this.forceRefresh();
                         this.forceRefresh();
@@ -179,15 +186,12 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
                 <PopupComponent
                 <PopupComponent
                   id='texture-editor'
                   id='texture-editor'
                   title='Texture Inspector'
                   title='Texture Inspector'
-                  size={{ width: 1024, height: 490 }}
-                  onOpen={(window: Window) => {}}
-                  onClose={(window: Window) =>
-                    this.onCloseTextureEditor(window)
-                  }
+                  size={this._textureInspectorSize}
+                  onOpen={this.onOpenTextureEditor}
+                  onClose={this.onCloseTextureEditor}
                   ref={this.popoutWindowRef}
                   ref={this.popoutWindowRef}
                 >
                 >
                     <TextureEditorComponent
                     <TextureEditorComponent
-                        globalState={this.props.globalState}
                         texture={this.props.texture}
                         texture={this.props.texture}
                         url={textureUrl}
                         url={textureUrl}
                         window={this.popoutWindowRef}
                         window={this.popoutWindowRef}

+ 2 - 2
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/bottomBar.tsx

@@ -1,12 +1,12 @@
 import * as React from 'react';
 import * as React from 'react';
 
 
-interface BottomBarProps {
+interface IBottomBarProps {
     name: string;
     name: string;
     mipLevel: number;
     mipLevel: number;
     hasMips: boolean;
     hasMips: boolean;
 }
 }
 
 
-export class BottomBar extends React.Component<BottomBarProps> {
+export class BottomBar extends React.PureComponent<IBottomBarProps> {
     render() {
     render() {
         return <div id='bottom-bar'>
         return <div id='bottom-bar'>
             <span id='file-url'>{this.props.name}</span>
             <span id='file-url'>{this.props.name}</span>

+ 1 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/channelsBar.tsx

@@ -16,7 +16,7 @@ interface IChannelsBarProps {
 const eyeOpen = require('./assets/eyeOpen.svg');
 const eyeOpen = require('./assets/eyeOpen.svg');
 const eyeClosed = require('./assets/eyeClosed.svg');
 const eyeClosed = require('./assets/eyeClosed.svg');
 
 
-export class ChannelsBar extends React.Component<IChannelsBarProps> {
+export class ChannelsBar extends React.PureComponent<IChannelsBarProps> {
     render() {
     render() {
         return <div id='channels-bar'>
         return <div id='channels-bar'>
             {this.props.channels.map(
             {this.props.channels.map(

+ 0 - 108
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/contrast.ts

@@ -1,108 +0,0 @@
-import { IToolData, IToolParameters, IToolType } from '../textureEditorComponent';
-import { TextBlock } from 'babylonjs-gui/2D/controls/textBlock';
-import { Slider } from 'babylonjs-gui/2D/controls/sliders/slider';
-
-export const Contrast : IToolData = {
-    name: 'Contrast/Exposure',
-    type: class implements IToolType {
-        getParameters: () => IToolParameters;
-        contrast : number = 1.0;
-        exposure : number = 1.0;
-        GUI: {
-            contrastLabel : TextBlock;
-            contrastSlider : Slider;
-            exposureLabel : TextBlock;
-            exposureSlider : Slider;
-        }
-        constructor(getParameters: () => IToolParameters) {
-            this.getParameters = getParameters;
-        }
-        setExposure(exposure : number) {
-            this.exposure = exposure;
-            this.GUI.exposureLabel.text = `Exposure: ${this.exposure}`;
-            const {scene3D, updateTexture} = this.getParameters();
-            scene3D.imageProcessingConfiguration.isEnabled = true;
-            scene3D.imageProcessingConfiguration.exposure = this.computeExposure(this.exposure);
-            updateTexture();
-        }
-        setContrast(contrast : number) {
-            this.contrast = contrast;
-            this.GUI.contrastLabel.text = `Contrast: ${this.contrast}`;
-            const {scene3D, updateTexture} = this.getParameters();
-            scene3D.imageProcessingConfiguration.isEnabled = true;
-            scene3D.imageProcessingConfiguration.contrast = this.computeContrast(contrast);
-            updateTexture();
-        }
-        /** Maps slider values to post processing values using an exponential regression */
-        computeExposure(sliderValue : number) {
-            if (sliderValue <= 0) {
-                return 1 - (-sliderValue / 100);
-            } else {
-                return Math.pow(1.05698, sliderValue) + 0.0000392163 * sliderValue;
-            }
-        }
-        /** Maps slider values to post processing values using an exponential regression */
-        computeContrast(sliderValue : number) {
-            if (sliderValue <= 0) {
-                return 1 - (-sliderValue / 100);
-            } else {
-                return Math.pow(1.05698, sliderValue) + 0.0000392163 * sliderValue;
-            }
-        }
-        setup() {
-            this.contrast = 0;
-            this.exposure = 0;
-            const {GUI} = this.getParameters();
-            const contrastLabel = new TextBlock();
-            contrastLabel.style = GUI.style;
-            contrastLabel.height = '20px';
-            contrastLabel.color = '#ffffff';
-            const contrastSlider = new Slider();
-            contrastSlider.value = this.contrast;
-            contrastSlider.minimum = -100;
-            contrastSlider.maximum = 100;
-            contrastSlider.height = '20px';
-            contrastSlider.isThumbCircle = true;
-            contrastSlider.background = '#a3a3a3';
-            contrastSlider.color = '#33648f';
-            contrastSlider.borderColor = '#33648f';
-            contrastSlider.onValueChangedObservable.add(evt => this.setContrast(evt.valueOf()));
-            const exposureLabel = new TextBlock();
-            exposureLabel.style = GUI.style;
-            exposureLabel.height = '20px';
-            exposureLabel.color = '#ffffff';
-            const exposureSlider = new Slider();
-            exposureSlider.value = this.exposure;
-            exposureSlider.minimum = -100;
-            exposureSlider.maximum = 100;
-            exposureSlider.height = '20px';
-            exposureSlider.isThumbCircle = true;
-            exposureSlider.background = '#a3a3a3';
-            exposureSlider.color = '#33648f';
-            exposureSlider.borderColor = '#33648f';
-            exposureSlider.onValueChangedObservable.add(evt => this.setExposure(evt.valueOf()));
-            GUI.toolWindow.addControl(contrastLabel);
-            GUI.toolWindow.addControl(contrastSlider);
-            GUI.toolWindow.addControl(exposureLabel);
-            GUI.toolWindow.addControl(exposureSlider);
-            this.GUI = {contrastLabel, contrastSlider, exposureLabel, exposureSlider};
-            this.setExposure(this.exposure);
-            this.setContrast(this.contrast);
-        }
-        cleanup() {
-            Object.entries(this.GUI).forEach(([key, value]) => value.dispose());
-        }
-        onReset() {
-            this.GUI.contrastSlider.value = 0;
-            this.GUI.exposureSlider.value = 0;
-        }
-    },
-    usesWindow: true,
-    is3D: true,
-    icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0i
-    NDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNTUsMjYuNTVsOC41OS0zLjIxQTYuODYsNi44NiwwLDAsMSwyNCwyNS43NWwtMy4x
-    OSwxLjE5QTcsNywwLDAsMSwxNy41NSwyNi41NVpNMjAsMTEuNUE4LjUsOC41LDAsMSwwLDI4LjUsMjAsOC41MSw4LjUxLDAsMCwwLDIwLDExLjVNMjAsMTBBMTAsMTAs
-    MCwxLDEsMTAsMjAsMTAsMTAsMCwwLDEsMjAsMTBabS0yLjQ1LDUuMzQsNS0xLjg2QTcsNywwLDAsMCwxOS40NCwxM2wtMS44OS43MVptMCwzLjIsNy44OC0yLjk0YTYu
-    ODgsNi44OCwwLDAsMC0xLjE5LTEuMTZsLTYuNjksMi41Wm0wLDMuMiw5LjIzLTMuNDRhNy42OCw3LjY4LDAsMCwwLS41Mi0xLjQxbC04LjcxLDMuMjVabTAsMS42djEu
-    Nmw5LjI4LTMuNDZBNi42Nyw2LjY3LDAsMCwwLDI3LDE5LjgyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==`
-}

+ 99 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/contrast.tsx

@@ -0,0 +1,99 @@
+import * as React from 'react';
+import { IToolData, IToolParameters, IToolType, IToolGUIProps } from '../textureEditorComponent';
+
+class contrastTool implements IToolType {
+    getParameters: () => IToolParameters;
+    contrast : number = 1.0;
+    exposure : number = 1.0;
+    constructor(getParameters: () => IToolParameters) {
+        this.getParameters = getParameters;
+    }
+    setExposure(exposure : number) {
+        this.exposure = exposure;
+        const {scene3D, updateTexture} = this.getParameters();
+        scene3D.imageProcessingConfiguration.isEnabled = true;
+        scene3D.imageProcessingConfiguration.exposure = this.computeExposure(this.exposure);
+        updateTexture();
+        
+    }
+    setContrast(contrast : number) {
+        this.contrast = contrast;
+        const {scene3D, updateTexture} = this.getParameters();
+        scene3D.imageProcessingConfiguration.isEnabled = true;
+        scene3D.imageProcessingConfiguration.contrast = this.computeContrast(contrast);
+        updateTexture();
+    }
+    /** Maps slider values to post processing values using an exponential regression */
+    computeExposure(sliderValue : number) {
+        if (sliderValue <= 0) {
+            return 1 - (-sliderValue / 100);
+        } else {
+            return Math.pow(1.05698, sliderValue) + 0.0000392163 * sliderValue;
+        }
+    }
+    /** Maps slider values to post processing values using an exponential regression */
+    computeContrast(sliderValue : number) {
+        if (sliderValue <= 0) {
+            return 1 - (-sliderValue / 100);
+        } else {
+            return Math.pow(1.05698, sliderValue) + 0.0000392163 * sliderValue;
+        }
+    }
+    setup() {
+        this.contrast = 0;
+        this.exposure = 0;
+        this.setExposure(this.exposure);
+        this.setContrast(this.contrast);
+    }
+    cleanup() {
+    }
+    onReset() {
+        this.contrast = 0;
+        this.exposure = 0;
+    }
+};
+
+class Settings extends React.Component<IToolGUIProps> {
+    render() {
+        const instance = this.props.instance as contrastTool;
+        return (
+            <div>
+                <div>
+                <label className='tool-slider-input'>
+                    <span>Contrast: {instance.contrast}</span>
+                    <input id='contrast-slider'
+                        type='range'
+                        min={-100}
+                        max={100}
+                        value={instance.contrast}
+                        onChange={evt => {instance.setContrast(evt.target.valueAsNumber); this.forceUpdate();}}/>
+                </label>
+                </div>
+                <div>
+                <label className='tool-slider-input'>
+                    <span>Exposure: {instance.exposure}</span>
+                    <input
+                        type='range'
+                        min={-100}
+                        max={100}
+                        value={instance.exposure}
+                        onChange={evt => {instance.setExposure(evt.target.valueAsNumber); this.forceUpdate();}}/>
+                </label>
+                </div>
+            </div>
+        )
+    }
+}
+
+export const Contrast : IToolData = {
+    name: 'Contrast/Exposure',
+    type: contrastTool,
+    is3D: true,
+    settingsComponent: Settings,
+    icon: `PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0i
+    NDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNTUsMjYuNTVsOC41OS0zLjIxQTYuODYsNi44NiwwLDAsMSwyNCwyNS43NWwtMy4x
+    OSwxLjE5QTcsNywwLDAsMSwxNy41NSwyNi41NVpNMjAsMTEuNUE4LjUsOC41LDAsMSwwLDI4LjUsMjAsOC41MSw4LjUxLDAsMCwwLDIwLDExLjVNMjAsMTBBMTAsMTAs
+    MCwxLDEsMTAsMjAsMTAsMTAsMCwwLDEsMjAsMTBabS0yLjQ1LDUuMzQsNS0xLjg2QTcsNywwLDAsMCwxOS40NCwxM2wtMS44OS43MVptMCwzLjIsNy44OC0yLjk0YTYu
+    ODgsNi44OCwwLDAsMC0xLjE5LTEuMTZsLTYuNjksMi41Wm0wLDMuMiw5LjIzLTMuNDRhNy42OCw3LjY4LDAsMCwwLS41Mi0xLjQxbC04LjcxLDMuMjVabTAsMS42djEu
+    Nmw5LjI4LTMuNDZBNi42Nyw2LjY3LDAsMCwwLDI3LDE5LjgyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==`
+}

文件差异内容过多而无法显示
+ 0 - 149
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.ts


文件差异内容过多而无法显示
+ 144 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/defaultTools/paintbrush.tsx


+ 1 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/propertiesBar.tsx

@@ -25,7 +25,7 @@ interface IPixelDataProps {
     data: number | undefined;
     data: number | undefined;
 }
 }
 
 
-export class PropertiesBar extends React.Component<IPropertiesBarProps,IPropertiesBarState> {
+export class PropertiesBar extends React.PureComponent<IPropertiesBarProps,IPropertiesBarState> {
     private _resetButton = require('./assets/reset.svg');
     private _resetButton = require('./assets/reset.svg');
     private _uploadButton = require('./assets/upload.svg');
     private _uploadButton = require('./assets/upload.svg');
     private _saveButton = require('./assets/save.svg');
     private _saveButton = require('./assets/save.svg');

+ 1 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasComponent.tsx

@@ -8,7 +8,7 @@ interface ITextureCanvasComponentProps {
     texture : BaseTexture;
     texture : BaseTexture;
 }
 }
 
 
-export class TextureCanvasComponent extends React.Component<ITextureCanvasComponentProps> {
+export class TextureCanvasComponent extends React.PureComponent<ITextureCanvasComponentProps> {
     shouldComponentUpdate(nextProps : ITextureCanvasComponentProps) {
     shouldComponentUpdate(nextProps : ITextureCanvasComponentProps) {
         return (nextProps.texture !== this.props.texture);
         return (nextProps.texture !== this.props.texture);
     }
     }

+ 0 - 75
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureCanvasManager.ts

@@ -28,12 +28,6 @@ import { TextureHelper } from '../../../../../../textureHelper';
 
 
 import { ITool } from './toolBar';
 import { ITool } from './toolBar';
 import { IChannel } from './channelsBar';
 import { IChannel } from './channelsBar';
-import { TextBlock } from 'babylonjs-gui/2D/controls/textBlock';
-import { Rectangle } from 'babylonjs-gui/2D/controls/rectangle';
-import { StackPanel } from 'babylonjs-gui/2D/controls/stackPanel';
-import { Control } from 'babylonjs-gui/2D/controls/control';
-import { Style } from 'babylonjs-gui/2D/style';
-import { AdvancedDynamicTexture } from 'babylonjs-gui/2D/advancedDynamicTexture';
 import { IMetadata } from './textureEditorComponent';
 import { IMetadata } from './textureEditorComponent';
 
 
 
 
@@ -46,14 +40,6 @@ export interface IPixelData {
     a? : number;
     a? : number;
 }
 }
 
 
-export interface IToolGUI {
-    adt: AdvancedDynamicTexture;
-    toolWindow: StackPanel;
-    isDragging: boolean;
-    dragCoords: Nullable<Vector2>;
-    style: Style;
-}
-
 export class TextureCanvasManager {
 export class TextureCanvasManager {
     private _engine: Engine;
     private _engine: Engine;
     private _scene: Scene;
     private _scene: Scene;
@@ -118,8 +104,6 @@ export class TextureCanvasManager {
 
 
     private _setPixelData : (pixelData : IPixelData) => void;
     private _setPixelData : (pixelData : IPixelData) => void;
 
 
-    private _GUI : IToolGUI;
-
     private _window : Window;
     private _window : Window;
 
 
     private _metadata : IMetadata;
     private _metadata : IMetadata;
@@ -314,53 +298,6 @@ export class TextureCanvasManager {
         this._planeMaterial.setInt('time', 0);
         this._planeMaterial.setInt('time', 0);
         this._plane.material = this._planeMaterial;
         this._plane.material = this._planeMaterial;
         
         
-        const adt = AdvancedDynamicTexture.CreateFullscreenUI('gui', true, this._scene);
-        const style = adt.createStyle();
-        style.fontFamily = 'acumin-pro-condensed';
-        style.fontSize = '15px';
-
-        const toolWindow = new StackPanel();
-        toolWindow.background = '#333333';
-        toolWindow.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_RIGHT;
-        toolWindow.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM;
-        toolWindow.left = '0px';
-        toolWindow.top = '-30px';
-        toolWindow.width = '200px';
-        toolWindow.isVisible = false;
-        toolWindow.isPointerBlocker = true;
-        adt.addControl(toolWindow);
-
-        this._GUI = {adt, style, toolWindow, isDragging: false, dragCoords: null};
-
-        const topBar = new Rectangle();
-        topBar.width = '100%';
-        topBar.height = '20px';
-        topBar.background = '#666666';
-        topBar.thickness = 0;
-        topBar.hoverCursor = 'grab';
-        topBar.onPointerDownObservable.add(() => {this._GUI.isDragging = true; topBar.hoverCursor = 'grabbing';});
-        topBar.onPointerUpObservable.add(() => {this._GUI.isDragging = false; this._GUI.dragCoords = null; topBar.hoverCursor = 'grab';});
-
-        const title = new TextBlock();
-        title.text = 'Tool Settings';
-        title.color = 'white';
-        title.height = '20px';
-        title.style = this._GUI.style;
-        topBar.addControl(title);
-        this._GUI.toolWindow.addControl(topBar);
-
-        this._window.addEventListener('pointermove', evt => {
-            if (!this._GUI.isDragging) return;
-            if (!this._GUI.dragCoords) {
-                this._GUI.dragCoords = new Vector2(evt.x, evt.y);
-                return;
-            }
-            this._GUI.toolWindow.leftInPixels += evt.x - this._GUI.dragCoords.x;
-            this._GUI.toolWindow.topInPixels += evt.y - this._GUI.dragCoords.y;
-            this._GUI.dragCoords.x = evt.x;
-            this._GUI.dragCoords.y = evt.y;
-        });
-
         this._window.addEventListener('keydown', evt => {
         this._window.addEventListener('keydown', evt => {
             this._keyMap[evt.code] = true;
             this._keyMap[evt.code] = true;
             if (evt.code === TextureCanvasManager.SELECT_ALL_KEY && evt.ctrlKey) {
             if (evt.code === TextureCanvasManager.SELECT_ALL_KEY && evt.ctrlKey) {
@@ -392,8 +329,6 @@ export class TextureCanvasManager {
 
 
         this._engine.runRenderLoop(() => {
         this._engine.runRenderLoop(() => {
             this._engine.resize();
             this._engine.resize();
-            this.GUI.toolWindow.left = Math.min(Math.max(this._GUI.toolWindow.leftInPixels, -this._UICanvas.width + this._GUI.toolWindow.widthInPixels), 0);
-            this.GUI.toolWindow.top = Math.min(Math.max(this._GUI.toolWindow.topInPixels, -this._UICanvas.height + this._GUI.toolWindow.heightInPixels), 0);
             this._scene.render();
             this._scene.render();
             this._planeMaterial.setInt('time', new Date().getTime());
             this._planeMaterial.setInt('time', new Date().getTime());
         });
         });
@@ -667,11 +602,6 @@ export class TextureCanvasManager {
         this._tool = tool;
         this._tool = tool;
         if (this._tool) {
         if (this._tool) {
             this._tool.instance.setup();
             this._tool.instance.setup();
-            if (this._tool.usesWindow) {
-                this._GUI.toolWindow.isVisible = true;
-            } else {
-                this._GUI.toolWindow.isVisible = false;
-            }
             if (this._editing3D && !this._tool.is3D) {
             if (this._editing3D && !this._tool.is3D) {
                 this._editing3D = false;
                 this._editing3D = false;
                 this._2DCanvas.getContext('2d')?.drawImage(this._3DCanvas, 0, 0);
                 this._2DCanvas.getContext('2d')?.drawImage(this._3DCanvas, 0, 0);
@@ -701,11 +631,6 @@ export class TextureCanvasManager {
         this.grabOriginalTexture(false);
         this.grabOriginalTexture(false);
     }
     }
 
 
-    /** Returns the tool GUI object, allowing tools to access the GUI */
-    public get GUI() {
-        return this._GUI;
-    }
-
     /** Returns the 3D scene used for postprocesses */
     /** Returns the 3D scene used for postprocesses */
     public get scene3D() {
     public get scene3D() {
         return this._3DScene;
         return this._3DScene;

+ 17 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditor.scss

@@ -231,6 +231,23 @@
         height: calc(100% - 70px);
         height: calc(100% - 70px);
         outline: none;
         outline: none;
     }
     }
+
+    #tool-ui {
+        background-color: #333;
+        position: absolute;
+        right: 0;
+        bottom: 30px;
+
+        label {
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+        }
+
+        input[type='range'] {
+            background: #d3d3d3;
+        }
+    }
     
     
     #bottom-bar {
     #bottom-bar {
         height: 30px;
         height: 30px;

+ 8 - 6
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import * as React from 'react';
-import { GlobalState } from '../../../../../globalState';
-import { TextureCanvasManager, IPixelData, IToolGUI } from './textureCanvasManager';
+import { TextureCanvasManager, IPixelData } from './textureCanvasManager';
 import { ITool, ToolBar } from './toolBar';
 import { ITool, ToolBar } from './toolBar';
 import { PropertiesBar } from './propertiesBar';
 import { PropertiesBar } from './propertiesBar';
 import { IChannel, ChannelsBar } from './channelsBar';
 import { IChannel, ChannelsBar } from './channelsBar';
@@ -16,11 +15,11 @@ import { Vector2 } from 'babylonjs/Maths/math.vector';
 import { PointerInfo } from 'babylonjs/Events/pointerEvents';
 import { PointerInfo } from 'babylonjs/Events/pointerEvents';
 
 
 import { PopupComponent } from '../../../../../popupComponent';
 import { PopupComponent } from '../../../../../popupComponent';
+import { ToolSettings } from './toolSettings';
 
 
 require('./textureEditor.scss');
 require('./textureEditor.scss');
 
 
 interface ITextureEditorComponentProps {
 interface ITextureEditorComponentProps {
-    globalState: GlobalState;
     texture: BaseTexture;
     texture: BaseTexture;
     url: string;
     url: string;
     window: React.RefObject<PopupComponent>;
     window: React.RefObject<PopupComponent>;
@@ -54,8 +53,6 @@ export interface IToolParameters {
     setMetadata: (data : any) => void;
     setMetadata: (data : any) => void;
     /** Returns the texture coordinates under the cursor */
     /** Returns the texture coordinates under the cursor */
     getMouseCoordinates: (pointerInfo : PointerInfo) => Vector2;
     getMouseCoordinates: (pointerInfo : PointerInfo) => Vector2;
-    /** An object which holds the GUI's ADT as well as the tool window. */
-    GUI: IToolGUI;
     /** Provides access to the BABYLON namespace */
     /** Provides access to the BABYLON namespace */
     BABYLON: any;
     BABYLON: any;
     /** Provides a canvas that you can use the canvas API to paint on. */
     /** Provides a canvas that you can use the canvas API to paint on. */
@@ -66,6 +63,9 @@ export interface IToolParameters {
     stopPainting: () => void;
     stopPainting: () => void;
 }
 }
 
 
+export interface IToolGUIProps {
+    instance: IToolType
+}
 
 
 /** An interface representing the definition of a tool */
 /** An interface representing the definition of a tool */
 export interface IToolData {
 export interface IToolData {
@@ -79,6 +79,7 @@ export interface IToolData {
     usesWindow? : boolean;
     usesWindow? : boolean;
     /** Whether the tool uses postprocesses */
     /** Whether the tool uses postprocesses */
     is3D? : boolean;
     is3D? : boolean;
+    settingsComponent? : React.ComponentType<IToolGUIProps>;
 }
 }
 
 
 export interface IToolType {
 export interface IToolType {
@@ -229,7 +230,6 @@ export class TextureEditorComponent extends React.Component<ITextureEditorCompon
             metadata: this.state.metadata,
             metadata: this.state.metadata,
             setMetadata: (data : any) => this.setMetadata(data),
             setMetadata: (data : any) => this.setMetadata(data),
             getMouseCoordinates: (pointerInfo : PointerInfo) => this._textureCanvasManager.getMouseCoordinates(pointerInfo),
             getMouseCoordinates: (pointerInfo : PointerInfo) => this._textureCanvasManager.getMouseCoordinates(pointerInfo),
-            GUI: this._textureCanvasManager.GUI,
             BABYLON: BABYLON,
             BABYLON: BABYLON,
         };
         };
     }
     }
@@ -271,6 +271,7 @@ export class TextureEditorComponent extends React.Component<ITextureEditorCompon
     }
     }
 
 
     render() {
     render() {
+        const currentTool : ITool | undefined = this.state.tools[this.state.activeToolIndex];
         return <div id="texture-editor">
         return <div id="texture-editor">
             <PropertiesBar
             <PropertiesBar
                 texture={this.props.texture}
                 texture={this.props.texture}
@@ -294,6 +295,7 @@ export class TextureEditorComponent extends React.Component<ITextureEditorCompon
             />}
             />}
             <ChannelsBar channels={this.state.channels} setChannels={(channels) => {this.setState({channels})}}/>
             <ChannelsBar channels={this.state.channels} setChannels={(channels) => {this.setState({channels})}}/>
             <TextureCanvasComponent canvas2D={this._2DCanvas} canvas3D={this._3DCanvas} canvasUI={this._UICanvas} texture={this.props.texture}/>
             <TextureCanvasComponent canvas2D={this._2DCanvas} canvas3D={this._3DCanvas} canvasUI={this._UICanvas} texture={this.props.texture}/>
+            <ToolSettings tool={currentTool} />
             <BottomBar name={this.props.url} mipLevel={this.state.mipLevel} hasMips={!this.props.texture.noMipmap}/>
             <BottomBar name={this.props.url} mipLevel={this.state.mipLevel} hasMips={!this.props.texture.noMipmap}/>
         </div>
         </div>
     }
     }

+ 15 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/materials/textures/toolSettings.tsx

@@ -0,0 +1,15 @@
+import * as React from 'react';
+import { ITool } from './toolBar';
+
+interface IToolSettingsProps {
+    tool: ITool | undefined;
+}
+
+export class ToolSettings extends React.Component<IToolSettingsProps> {
+    render() {
+        if (!this.props.tool || !this.props.tool.settingsComponent) return <></>;
+        return <div id='tool-ui'>
+            {<this.props.tool.settingsComponent instance={this.props.tool.instance}/>}
+        </div>;
+    }
+}

+ 10 - 0
inspector/src/components/sceneExplorer/sceneExplorerComponent.tsx

@@ -25,6 +25,7 @@ import { SSAO2RenderingPipeline } from 'babylonjs/PostProcesses/RenderPipeline/P
 import { StandardMaterial } from 'babylonjs/Materials/standardMaterial';
 import { StandardMaterial } from 'babylonjs/Materials/standardMaterial';
 import { PBRMaterial } from 'babylonjs/Materials/PBR/pbrMaterial';
 import { PBRMaterial } from 'babylonjs/Materials/PBR/pbrMaterial';
 import { SpriteManager } from 'babylonjs/Sprites/spriteManager';
 import { SpriteManager } from 'babylonjs/Sprites/spriteManager';
+import { TargetCamera } from 'babylonjs/Cameras/targetCamera';
 
 
 require("./sceneExplorer.scss");
 require("./sceneExplorer.scss");
 
 
@@ -320,6 +321,15 @@ export class SceneExplorerComponent extends React.Component<ISceneExplorerCompon
             label: "Add new free camera",
             label: "Add new free camera",
             action: () => {
             action: () => {
                 let newFreeCamera = new FreeCamera("free camera", scene.activeCamera ? scene.activeCamera.globalPosition : new Vector3(0, 0, -5), scene);
                 let newFreeCamera = new FreeCamera("free camera", scene.activeCamera ? scene.activeCamera.globalPosition : new Vector3(0, 0, -5), scene);
+
+                if (scene.activeCamera) {
+                    newFreeCamera.minZ = scene.activeCamera.minZ;
+                    newFreeCamera.maxZ = scene.activeCamera.maxZ;
+                    if ((scene.activeCamera as any).getTarget) {
+                        newFreeCamera.setTarget((scene.activeCamera as TargetCamera).getTarget());
+                    }
+                }
+    
                 this.props.globalState.onSelectionChangedObservable.notifyObservers(newFreeCamera);
                 this.props.globalState.onSelectionChangedObservable.notifyObservers(newFreeCamera);
             }
             }
         });
         });

+ 9 - 3
inspector/src/inspector.ts

@@ -27,7 +27,7 @@ export class Inspector {
     private static _SceneExplorerHost: Nullable<HTMLElement>;
     private static _SceneExplorerHost: Nullable<HTMLElement>;
     private static _ActionTabsHost: Nullable<HTMLElement>;
     private static _ActionTabsHost: Nullable<HTMLElement>;
     private static _EmbedHost: Nullable<HTMLElement>;
     private static _EmbedHost: Nullable<HTMLElement>;
-    private static _NewCanvasContainer: HTMLElement;
+    private static _NewCanvasContainer: Nullable<HTMLElement>;
 
 
     private static _SceneExplorerWindow: Window;
     private static _SceneExplorerWindow: Window;
     private static _ActionTabsWindow: Window;
     private static _ActionTabsWindow: Window;
@@ -382,7 +382,10 @@ export class Inspector {
             if (options.popup) {
             if (options.popup) {
                 this._CreateEmbedHost(scene, options, this._CreatePopup("INSPECTOR", "_EmbedHostWindow"), Inspector.OnSelectionChangeObservable);
                 this._CreateEmbedHost(scene, options, this._CreatePopup("INSPECTOR", "_EmbedHostWindow"), Inspector.OnSelectionChangeObservable);
             } else {
             } else {
-                let parentControl = (options.globalRoot ? options.globalRoot : rootElement!.parentElement) as HTMLElement;
+                if (!rootElement) {
+                    return;
+                }
+                let parentControl = (options.globalRoot ? options.globalRoot : rootElement.parentElement) as HTMLElement;
 
 
                 if (!options.overlay && !this._NewCanvasContainer) {
                 if (!options.overlay && !this._NewCanvasContainer) {
                     this._CreateCanvasContainer(parentControl);
                     this._CreateCanvasContainer(parentControl);
@@ -468,6 +471,9 @@ export class Inspector {
     }
     }
 
 
     private static _DestroyCanvasContainer() {
     private static _DestroyCanvasContainer() {
+        if (!this._NewCanvasContainer) {
+            return;
+        }
         const parentControl = this._NewCanvasContainer.parentElement!;
         const parentControl = this._NewCanvasContainer.parentElement!;
 
 
         while (this._NewCanvasContainer.childElementCount > 0) {
         while (this._NewCanvasContainer.childElementCount > 0) {
@@ -478,7 +484,7 @@ export class Inspector {
 
 
         parentControl.removeChild(this._NewCanvasContainer);
         parentControl.removeChild(this._NewCanvasContainer);
         parentControl.style.display = this._NewCanvasContainer.style.display;
         parentControl.style.display = this._NewCanvasContainer.style.display;
-        delete this._NewCanvasContainer;
+        this._NewCanvasContainer = null;
     }
     }
 
 
     private static _Cleanup() {
     private static _Cleanup() {

+ 1 - 1
loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts

@@ -45,7 +45,7 @@ export class EXT_lights_image_based implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
         delete this._lights;
         delete this._lights;
     }
     }
 
 

+ 1 - 1
loaders/src/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.ts

@@ -36,7 +36,7 @@ export class EXT_mesh_gpu_instancing implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/EXT_texture_webp.ts

@@ -27,7 +27,7 @@ export class EXT_texture_webp implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/ExtrasAsMetadata.ts

@@ -48,7 +48,7 @@ export class ExtrasAsMetadata implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose(): void {
     public dispose(): void {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts

@@ -45,7 +45,7 @@ export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
     /** @hidden */
     /** @hidden */
     public dispose(): void {
     public dispose(): void {
         delete this.dracoCompression;
         delete this.dracoCompression;
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts

@@ -39,7 +39,7 @@ export class KHR_lights implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
         delete this._lights;
         delete this._lights;
     }
     }
 
 

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_clearcoat.ts

@@ -40,7 +40,7 @@ export class KHR_materials_clearcoat implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_ior.ts

@@ -44,7 +44,7 @@ export class KHR_materials_ior implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts

@@ -39,7 +39,7 @@ export class KHR_materials_pbrSpecularGlossiness implements IGLTFLoaderExtension
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_sheen.ts

@@ -41,7 +41,7 @@ export class KHR_materials_sheen implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_specular.ts

@@ -40,7 +40,7 @@ export class KHR_materials_specular implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_transmission.ts

@@ -42,7 +42,7 @@ export class KHR_materials_transmission implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts

@@ -38,7 +38,7 @@ export class KHR_materials_unlit implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_variants.ts

@@ -47,7 +47,7 @@ export class KHR_materials_variants implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /**
     /**
@@ -194,7 +194,7 @@ export class KHR_materials_variants implements IGLTFLoaderExtension {
 
 
                     // For each mapping, look at the variants and make a new entry for them.
                     // For each mapping, look at the variants and make a new entry for them.
                     const variants = extensionMetadata.variants;
                     const variants = extensionMetadata.variants;
-                    for (const mapping of extension.mapping) {
+                    for (const mapping of extension.mappings) {
                         for (const variantIndex of mapping.variants) {
                         for (const variantIndex of mapping.variants) {
                             const variant = ArrayItem.Get(`${extensionContext}/mapping/${variantIndex}`, this._variants, variantIndex);
                             const variant = ArrayItem.Get(`${extensionContext}/mapping/${variantIndex}`, this._variants, variantIndex);
                             const material = ArrayItem.Get(`#/materials/`, this._loader.gltf.materials, mapping.material);
                             const material = ArrayItem.Get(`#/materials/`, this._loader.gltf.materials, mapping.material);

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts

@@ -28,7 +28,7 @@ export class KHR_texture_basisu implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -33,7 +33,7 @@ export class KHR_texture_transform implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/KHR_xmp.ts

@@ -34,7 +34,7 @@ export class KHR_xmp implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     /**
     /**

+ 3 - 3
loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts

@@ -64,9 +64,9 @@ export class MSFT_audio_emitter implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
-        delete this._clips;
-        delete this._emitters;
+        (this._loader as any) = null;
+        (this._clips as any) = null;
+        (this._emitters as any) = null;
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 1 - 1
loaders/src/glTF/2.0/Extensions/MSFT_lod.ts

@@ -78,7 +78,7 @@ export class MSFT_lod implements IGLTFLoaderExtension {
 
 
     /** @hidden */
     /** @hidden */
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
 
 
         this._nodeIndexLOD = null;
         this._nodeIndexLOD = null;
         this._nodeSignalLODs.length = 0;
         this._nodeSignalLODs.length = 0;

+ 1 - 1
loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts

@@ -21,7 +21,7 @@ export class MSFT_minecraftMesh implements IGLTFLoaderExtension {
     }
     }
 
 
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
     public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {

+ 1 - 1
loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts

@@ -21,7 +21,7 @@ export class MSFT_sRGBFactors implements IGLTFLoaderExtension {
     }
     }
 
 
     public dispose() {
     public dispose() {
-        delete this._loader;
+        (this._loader as any) = null;
     }
     }
 
 
     public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
     public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {

+ 3 - 3
loaders/src/glTF/2.0/glTFLoader.ts

@@ -216,9 +216,9 @@ export class GLTFLoader implements IGLTFLoader {
             delete this._extensions[name];
             delete this._extensions[name];
         }
         }
 
 
-        delete this._gltf;
-        delete this._babylonScene;
-        delete this._rootBabylonMesh;
+        (this._gltf as any) = null;
+        (this._babylonScene as any) = null;
+        (this._rootBabylonMesh as any) = null;
 
 
         this._parent.dispose();
         this._parent.dispose();
     }
     }

文件差异内容过多而无法显示
+ 10 - 0
nodeEditor/imgs/add.svg


文件差异内容过多而无法显示
+ 10 - 0
nodeEditor/imgs/delete.svg


+ 75 - 18
nodeEditor/src/components/nodeList/nodeList.scss

@@ -75,33 +75,90 @@
                         color: white;
                         color: white;
                     }
                     }
                 }
                 }
-            
-                .buttonLine {
+
+                .nonDraggableLine {
                     height: 30px;
                     height: 30px;
                     display: grid;
                     display: grid;
                     align-items: center;
                     align-items: center;
                     justify-items: stretch;
                     justify-items: stretch;
+                    background: #222222;
+                    text-align: center;
+                    margin: 0;
+                    box-sizing: border-box;
+                }
 
 
-                    button {
-                        background: #222222;
-                        margin: 5px 10px 5px 10px;
-                        color:white;
-                        padding: 4px 5px;
-                        opacity: 0.9;
-                    }
+                .withButton {
+                    height: 30px;
+                    position: relative;
+                    .icon {
+                        position: absolute;
+                        right: 4px;
+                        top: 5px;
+                        &:hover {
+                            cursor: pointer;
+                        }
 
 
-                    button:hover {
-                        opacity: 1.0;
+                        .img {
+                            height: 17px;
+                            width: 17px;
+                        }
                     }
                     }
 
 
-                    button:active {
-                        background: #282828;
-                    }   
+                    .buttonLine {
+                        height: 30px;
+                        display: grid;
+                        align-items: center;
+                        justify-items: stretch;
+                        padding-bottom: 5px;
+                        position: absolute;
+                        right: 0px;
+                        top: 2px;
+                        input[type="file"] {
+                            display: none;
+                        }
+                
+                        .file-upload {            
+                            background: transparent;
+                            border: transparent;
+                            padding: 15px 200px;
+                            opacity: 0.9;
+                            cursor: pointer;
+                            text-align: center;
+                        }
+                
+                        .file-upload:hover {
+                            opacity: 1.0;
+                        }
+                
+                        .file-upload:active {
+                            transform: scale(0.98);
+                            transform-origin: 0.5 0.5;
+                        }
+                
+                        button {
+                            background: transparent;
+                            border: transparent;
+                            margin: 5px 10px 5px 10px;
+                            color:white;
+                            padding: 4px 5px;
+                            opacity: 0.9;
+                        }
+                
+                        button:hover {
+                            opacity: 0.0;
+                        }
+                
+                        button:active {
+                            background: transparent;
+                        }   
+                        
+                        button:focus {
+                            border: transparent;
+                            outline: 0px;
+                        }  
+                    }
                     
                     
-                    button:focus {
-                        outline: 0px;
-                    }  
-                }
+                }                
 
 
                 .paneContainer {
                 .paneContainer {
                     margin-top: 3px;
                     margin-top: 3px;

+ 74 - 7
nodeEditor/src/components/nodeList/nodeListComponent.tsx

@@ -6,6 +6,11 @@ import { DraggableLineComponent } from '../../sharedComponents/draggableLineComp
 import { NodeMaterialModes } from 'babylonjs/Materials/Node/Enums/nodeMaterialModes';
 import { NodeMaterialModes } from 'babylonjs/Materials/Node/Enums/nodeMaterialModes';
 import { Observer } from 'babylonjs/Misc/observable';
 import { Observer } from 'babylonjs/Misc/observable';
 import { Nullable } from 'babylonjs/types';
 import { Nullable } from 'babylonjs/types';
+import { DraggableLineWithButtonComponent } from '../../sharedComponents/draggableLineWithButtonComponent';
+import { LineWithFileButtonComponent } from '../../sharedComponents/lineWithFileButtonComponent';
+import { Tools } from 'babylonjs/Misc/tools';
+const addButton = require("../../../imgs/add.svg");
+const deleteButton = require('../../../imgs/delete.svg');
 
 
 require("./nodeList.scss");
 require("./nodeList.scss");
 
 
@@ -144,12 +149,19 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
         "FragCoordBlock": "The gl_FragCoord predefined variable that contains the window relative coordinate (x, y, z, 1/w)",
         "FragCoordBlock": "The gl_FragCoord predefined variable that contains the window relative coordinate (x, y, z, 1/w)",
         "ScreenSizeBlock": "The size (in pixels) of the screen window",
         "ScreenSizeBlock": "The size (in pixels) of the screen window",
     };
     };
+    
+    private _customFrameList: {[key: string]: string};
 
 
     constructor(props: INodeListComponentProps) {
     constructor(props: INodeListComponentProps) {
         super(props);
         super(props);
 
 
         this.state = { filter: "" };
         this.state = { filter: "" };
 
 
+        let frameJson = localStorage.getItem("Custom-Frame-List");
+        if(frameJson) {
+            this._customFrameList = JSON.parse(frameJson);
+        }
+
         this._onResetRequiredObserver = this.props.globalState.onResetRequiredObservable.add(() => {
         this._onResetRequiredObserver = this.props.globalState.onResetRequiredObservable.add(() => {
             this.forceUpdate();
             this.forceUpdate();
         });
         });
@@ -163,10 +175,56 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
         this.setState({ filter: filter });
         this.setState({ filter: filter });
     }
     }
 
 
+    loadCustomFrame(file: File) {
+        Tools.ReadFile(file, async (data) => {
+            // get Frame Data from file
+            let decoder = new TextDecoder("utf-8");
+            const frameData = JSON.parse(decoder.decode(data));
+            let frameName = frameData.editorData.frames[0].name + "Custom";
+            let frameToolTip = frameData.editorData.frames[0].comments || "";
+
+            try {
+                localStorage.setItem(frameName, JSON.stringify(frameData));
+            } catch (error) {
+                this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers("Error Saving Frame");
+                return;
+            }
+
+            let frameJson = localStorage.getItem("Custom-Frame-List");
+            let frameList:  {[key: string]: string} = {};
+            if(frameJson) {
+                frameList = JSON.parse(frameJson); 
+            }
+            frameList[frameName] = frameToolTip;
+            localStorage.setItem("Custom-Frame-List", JSON.stringify(frameList));
+                this._customFrameList = frameList;
+                this.forceUpdate();
+
+        }, undefined, true);
+    }
+
+    removeItem(value : string) : void {
+        let frameJson = localStorage.getItem("Custom-Frame-List");
+            if(frameJson) {
+                let frameList = JSON.parse(frameJson);
+                delete frameList[value];
+                localStorage.removeItem(value);
+                localStorage.setItem("Custom-Frame-List", JSON.stringify(frameList));
+                this._customFrameList = frameList;
+                this.forceUpdate();
+            }        
+    }
+
     render() {
     render() {
-        // Block types used to create the menu from
-        const allBlocks = {
 
 
+        let customFrameNames: string[] = [];
+        for(let frame in this._customFrameList){
+            customFrameNames.push(frame);
+        }
+        
+        // Block types used to create the menu from
+        const allBlocks: any = {
+            Custom_Frames: customFrameNames,
             Animation: ["BonesBlock", "MorphTargetsBlock"],
             Animation: ["BonesBlock", "MorphTargetsBlock"],
             Color_Management: ["ReplaceColorBlock", "PosterizeBlock", "GradientBlock", "DesaturateBlock"],
             Color_Management: ["ReplaceColorBlock", "PosterizeBlock", "GradientBlock", "DesaturateBlock"],
             Conversion_Blocks: ["ColorMergerBlock", "ColorSplitterBlock", "VectorMergerBlock", "VectorSplitterBlock"],
             Conversion_Blocks: ["ColorMergerBlock", "ColorSplitterBlock", "VectorMergerBlock", "VectorSplitterBlock"],
@@ -211,18 +269,28 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
             var blockList = (allBlocks as any)[key].filter((b: string) => !this.state.filter || b.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1)
             var blockList = (allBlocks as any)[key].filter((b: string) => !this.state.filter || b.toLowerCase().indexOf(this.state.filter.toLowerCase()) !== -1)
             .sort((a: string, b: string) => a.localeCompare(b))
             .sort((a: string, b: string) => a.localeCompare(b))
             .map((block: any, i: number) => {
             .map((block: any, i: number) => {
-                let tooltip = NodeListComponent._Tooltips[block] || "";
+                if(key === "Custom_Frames") {
+                    return <DraggableLineWithButtonComponent key={block} data={block} tooltip={this._customFrameList[block] || ""} iconImage={deleteButton} iconTitle="Delete"
+                    onIconClick={ value => this.removeItem(value)}/>;
+                }
+                return <DraggableLineComponent key={block} data={block} tooltip={ NodeListComponent._Tooltips[block] || ""}/>;
 
 
-                return <DraggableLineComponent key={block} data={block} tooltip={tooltip}/>;
             });
             });
 
 
-            if (blockList.length) {
+            if(key === "Custom_Frames") {
+                let line =  <LineWithFileButtonComponent title={"Add Custom Frame"} closed={false}
+                label="Add..." uploadName={'custom-frame-upload'} iconImage={addButton} accept=".json" onIconClick={(file) => {
+                    this.loadCustomFrame(file);
+                }}/>;
+                blockList.push(line);
+            }         
+            if(blockList.length) {
                 blockMenu.push(
                 blockMenu.push(
                     <LineContainerComponent key={key + " blocks"} title={key.replace("__", ": ").replace("_", " ")} closed={false}>
                     <LineContainerComponent key={key + " blocks"} title={key.replace("__", ": ").replace("_", " ")} closed={false}>
                         {blockList}
                         {blockList}
                     </LineContainerComponent>
                     </LineContainerComponent>
                 );
                 );
-            }
+           }
         }
         }
 
 
         return (
         return (
@@ -244,6 +312,5 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
                 </div>
                 </div>
             </div>
             </div>
         );
         );
-
     }
     }
 }
 }

+ 0 - 0
nodeEditor/src/graphEditor.tsx


部分文件因为文件数量过多而无法显示