@babylonjs/loaders 8.2.0 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/OBJ/index.d.ts +4 -4
  2. package/OBJ/objFileLoader.d.ts +2 -2
  3. package/OBJ/solidParser.d.ts +1 -1
  4. package/SPLAT/index.d.ts +2 -2
  5. package/SPLAT/splatFileLoader.d.ts +2 -2
  6. package/STL/index.d.ts +1 -1
  7. package/STL/stlFileLoader.d.ts +1 -1
  8. package/glTF/1.0/glTFBinaryExtension.d.ts +3 -3
  9. package/glTF/1.0/glTFLoader.d.ts +2 -2
  10. package/glTF/1.0/glTFLoaderUtils.d.ts +2 -2
  11. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +2 -2
  12. package/glTF/1.0/index.d.ts +5 -5
  13. package/glTF/2.0/Extensions/EXT_lights_ies.d.ts +4 -4
  14. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +4 -4
  15. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +4 -4
  16. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +4 -4
  17. package/glTF/2.0/Extensions/EXT_texture_avif.d.ts +4 -4
  18. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +4 -4
  19. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +4 -4
  20. package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +5 -5
  21. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +4 -4
  22. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +6 -3
  23. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +46 -24
  24. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
  25. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +1 -1
  26. package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +3 -3
  27. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +3 -3
  28. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +7 -2
  29. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
  30. package/glTF/2.0/Extensions/KHR_interactivity.d.ts +3 -3
  31. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +4 -4
  32. package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +4 -4
  33. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +4 -4
  34. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.d.ts +4 -4
  35. package/glTF/2.0/Extensions/KHR_materials_dispersion.d.ts +4 -4
  36. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +4 -4
  37. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +4 -4
  38. package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +4 -4
  39. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +4 -4
  40. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +4 -4
  41. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +4 -4
  42. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +4 -4
  43. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +4 -4
  44. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +5 -5
  45. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +4 -4
  46. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +3 -3
  47. package/glTF/2.0/Extensions/KHR_node_hoverability.d.ts +3 -3
  48. package/glTF/2.0/Extensions/KHR_node_selectability.d.ts +3 -3
  49. package/glTF/2.0/Extensions/KHR_node_visibility.d.ts +3 -3
  50. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +4 -4
  51. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +4 -4
  52. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +3 -3
  53. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +4 -4
  54. package/glTF/2.0/Extensions/MSFT_lod.d.ts +4 -4
  55. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +4 -4
  56. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +4 -4
  57. package/glTF/2.0/Extensions/gltfPathToObjectConverter.d.ts +9 -1
  58. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js +17 -2
  59. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js.map +1 -1
  60. package/glTF/2.0/Extensions/index.d.ts +38 -38
  61. package/glTF/2.0/Extensions/objectModelMapping.d.ts +2 -2
  62. package/glTF/2.0/glTFLoader.d.ts +5 -5
  63. package/glTF/2.0/glTFLoaderAnimation.d.ts +1 -1
  64. package/glTF/2.0/glTFLoaderExtension.d.ts +2 -2
  65. package/glTF/2.0/glTFLoaderExtensionRegistry.d.ts +2 -2
  66. package/glTF/2.0/index.d.ts +6 -6
  67. package/glTF/glTFFileLoader.d.ts +1 -1
  68. package/glTF/index.d.ts +4 -4
  69. package/index.d.ts +4 -4
  70. package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
  71. package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
  72. package/legacy/legacy-glTFFileLoader.d.ts +3 -3
  73. package/legacy/legacy.d.ts +5 -5
  74. package/package.json +3 -3
package/OBJ/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./mtlFileLoader";
2
- export * from "./objLoadingOptions";
3
- export * from "./solidParser";
4
- export * from "./objFileLoader";
1
+ export * from "./mtlFileLoader.js";
2
+ export * from "./objLoadingOptions.js";
3
+ export * from "./solidParser.js";
4
+ export * from "./objFileLoader.js";
@@ -2,8 +2,8 @@ import { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
2
2
  import type { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderPlugin, ISceneLoaderAsyncResult, SceneLoaderPluginOptions } from "@babylonjs/core/Loading/sceneLoader.js";
3
3
  import { AssetContainer } from "@babylonjs/core/assetContainer.js";
4
4
  import type { Scene } from "@babylonjs/core/scene.js";
5
- import { OBJFileLoaderMetadata } from "./objFileLoader.metadata";
6
- import type { OBJLoadingOptions } from "./objLoadingOptions";
5
+ import { OBJFileLoaderMetadata } from "./objFileLoader.metadata.js";
6
+ import type { OBJLoadingOptions } from "./objLoadingOptions.js";
7
7
  declare module "@babylonjs/core/Loading/sceneLoader.js" {
8
8
  interface SceneLoaderPluginOptions {
9
9
  /**
@@ -2,7 +2,7 @@ import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
2
2
  import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
3
3
  import type { Scene } from "@babylonjs/core/scene.js";
4
4
  import type { Nullable } from "@babylonjs/core/types.js";
5
- import type { OBJLoadingOptions } from "./objLoadingOptions";
5
+ import type { OBJLoadingOptions } from "./objLoadingOptions.js";
6
6
  /**
7
7
  * Class used to load mesh data from OBJ content
8
8
  */
package/SPLAT/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./splatLoadingOptions";
2
- export * from "./splatFileLoader";
1
+ export * from "./splatLoadingOptions.js";
2
+ export * from "./splatFileLoader.js";
@@ -1,8 +1,8 @@
1
1
  import type { ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderAsyncResult, ISceneLoaderProgressEvent, SceneLoaderPluginOptions } from "@babylonjs/core/Loading/sceneLoader.js";
2
- import { SPLATFileLoaderMetadata } from "./splatFileLoader.metadata";
2
+ import { SPLATFileLoaderMetadata } from "./splatFileLoader.metadata.js";
3
3
  import { AssetContainer } from "@babylonjs/core/assetContainer.js";
4
4
  import type { Scene } from "@babylonjs/core/scene.js";
5
- import type { SPLATLoadingOptions } from "./splatLoadingOptions";
5
+ import type { SPLATLoadingOptions } from "./splatLoadingOptions.js";
6
6
  declare module "@babylonjs/core/Loading/sceneLoader.js" {
7
7
  interface SceneLoaderPluginOptions {
8
8
  /**
package/STL/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./stlFileLoader";
1
+ export * from "./stlFileLoader.js";
@@ -3,7 +3,7 @@ import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
3
3
  import type { ISceneLoaderPlugin } from "@babylonjs/core/Loading/sceneLoader.js";
4
4
  import { AssetContainer } from "@babylonjs/core/assetContainer.js";
5
5
  import type { Scene } from "@babylonjs/core/scene.js";
6
- import { STLFileLoaderMetadata } from "./stlFileLoader.metadata";
6
+ import { STLFileLoaderMetadata } from "./stlFileLoader.metadata.js";
7
7
  import "@babylonjs/core/Materials/standardMaterial.js";
8
8
  declare module "@babylonjs/core/Loading/sceneLoader.js" {
9
9
  interface SceneLoaderPluginOptions {
@@ -1,7 +1,7 @@
1
- import { GLTFLoaderExtension } from "./glTFLoader";
1
+ import { GLTFLoaderExtension } from "./glTFLoader.js";
2
2
  import type { Scene } from "@babylonjs/core/scene.js";
3
- import type { IGLTFLoaderData } from "../glTFFileLoader";
4
- import type { IGLTFRuntime } from "./glTFLoaderInterfaces";
3
+ import type { IGLTFLoaderData } from "../glTFFileLoader.js";
4
+ import type { IGLTFRuntime } from "./glTFLoaderInterfaces.js";
5
5
  /**
6
6
  * @internal
7
7
  * @deprecated
@@ -1,10 +1,10 @@
1
- import type { IGLTFRuntime } from "./glTFLoaderInterfaces";
1
+ import type { IGLTFRuntime } from "./glTFLoaderInterfaces.js";
2
2
  import type { Nullable } from "@babylonjs/core/types.js";
3
3
  import { Material } from "@babylonjs/core/Materials/material.js";
4
4
  import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
5
5
  import type { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
6
6
  import type { Scene } from "@babylonjs/core/scene.js";
7
- import type { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader";
7
+ import type { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader.js";
8
8
  import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
9
9
  /**
10
10
  * Implementation of the base glTF spec
@@ -1,5 +1,5 @@
1
- import type { IGLTFTechniqueParameter, IGLTFAccessor, IGLTFRuntime, IGLTFBufferView } from "./glTFLoaderInterfaces";
2
- import { EComponentType } from "./glTFLoaderInterfaces";
1
+ import type { IGLTFTechniqueParameter, IGLTFAccessor, IGLTFRuntime, IGLTFBufferView } from "./glTFLoaderInterfaces.js";
2
+ import { EComponentType } from "./glTFLoaderInterfaces.js";
3
3
  import { Effect } from "@babylonjs/core/Materials/effect.js";
4
4
  import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial.js";
5
5
  import type { Node } from "@babylonjs/core/node.js";
@@ -1,5 +1,5 @@
1
- import { GLTFLoaderExtension } from "./glTFLoader";
2
- import type { IGLTFRuntime } from "./glTFLoaderInterfaces";
1
+ import { GLTFLoaderExtension } from "./glTFLoader.js";
2
+ import type { IGLTFRuntime } from "./glTFLoaderInterfaces.js";
3
3
  import { Material } from "@babylonjs/core/Materials/material.js";
4
4
  /**
5
5
  * @internal
@@ -1,5 +1,5 @@
1
- export * from "./glTFBinaryExtension";
2
- export * from "./glTFLoader";
3
- export * from "./glTFLoaderInterfaces";
4
- export * from "./glTFLoaderUtils";
5
- export * from "./glTFMaterialsCommonExtension";
1
+ export * from "./glTFBinaryExtension.js";
2
+ export * from "./glTFLoader.js";
3
+ export * from "./glTFLoaderInterfaces.js";
4
+ export * from "./glTFLoaderUtils.js";
5
+ export * from "./glTFMaterialsCommonExtension.js";
@@ -1,9 +1,9 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
2
  import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
3
- import type { INode } from "../glTFLoaderInterfaces";
4
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
5
- import { GLTFLoader } from "../glTFLoader";
6
- declare module "../../glTFFileLoader" {
3
+ import type { INode } from "../glTFLoaderInterfaces.js";
4
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
5
+ import { GLTFLoader } from "../glTFLoader.js";
6
+ declare module "../../glTFFileLoader.js" {
7
7
  interface GLTFLoaderExtensionOptions {
8
8
  /**
9
9
  * Defines options for the EXT_lights_ies extension.
@@ -1,9 +1,9 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
2
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
3
- import type { IScene } from "../glTFLoaderInterfaces";
4
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
5
- import { GLTFLoader } from "../glTFLoader";
6
- declare module "../../glTFFileLoader" {
3
+ import type { IScene } from "../glTFLoaderInterfaces.js";
4
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
5
+ import { GLTFLoader } from "../glTFLoader.js";
6
+ declare module "../../glTFFileLoader.js" {
7
7
  interface GLTFLoaderExtensionOptions {
8
8
  /**
9
9
  * Defines options for the EXT_lights_image_based extension.
@@ -1,10 +1,10 @@
1
1
  import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
2
2
  import type { Nullable } from "@babylonjs/core/types.js";
3
- import { GLTFLoader } from "../glTFLoader";
4
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
5
- import type { INode } from "../glTFLoaderInterfaces";
3
+ import { GLTFLoader } from "../glTFLoader.js";
4
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
5
+ import type { INode } from "../glTFLoaderInterfaces.js";
6
6
  import "@babylonjs/core/Meshes/thinInstanceMesh.js";
7
- declare module "../../glTFFileLoader" {
7
+ declare module "../../glTFFileLoader.js" {
8
8
  interface GLTFLoaderExtensionOptions {
9
9
  /**
10
10
  * Defines options for the EXT_mesh_gpu_instancing extension.
@@ -1,8 +1,8 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
3
- import { GLTFLoader } from "../glTFLoader";
4
- import type { IBufferView } from "../glTFLoaderInterfaces";
5
- declare module "../../glTFFileLoader" {
2
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
3
+ import { GLTFLoader } from "../glTFLoader.js";
4
+ import type { IBufferView } from "../glTFLoaderInterfaces.js";
5
+ declare module "../../glTFFileLoader.js" {
6
6
  interface GLTFLoaderExtensionOptions {
7
7
  /**
8
8
  * Defines options for the EXT_meshopt_compression extension.
@@ -1,9 +1,9 @@
1
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
- import { GLTFLoader } from "../glTFLoader";
3
- import type { ITexture } from "../glTFLoaderInterfaces";
1
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
2
+ import { GLTFLoader } from "../glTFLoader.js";
3
+ import type { ITexture } from "../glTFLoaderInterfaces.js";
4
4
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
5
5
  import type { Nullable } from "@babylonjs/core/types.js";
6
- declare module "../../glTFFileLoader" {
6
+ declare module "../../glTFFileLoader.js" {
7
7
  interface GLTFLoaderExtensionOptions {
8
8
  /**
9
9
  * Defines options for the EXT_texture_avif extension.
@@ -1,9 +1,9 @@
1
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
- import { GLTFLoader } from "../glTFLoader";
3
- import type { ITexture } from "../glTFLoaderInterfaces";
1
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
2
+ import { GLTFLoader } from "../glTFLoader.js";
3
+ import type { ITexture } from "../glTFLoaderInterfaces.js";
4
4
  import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
5
5
  import type { Nullable } from "@babylonjs/core/types.js";
6
- declare module "../../glTFFileLoader" {
6
+ declare module "../../glTFFileLoader.js" {
7
7
  interface GLTFLoaderExtensionOptions {
8
8
  /**
9
9
  * Defines options for the EXT_texture_webp extension.
@@ -1,11 +1,11 @@
1
1
  import type { Nullable } from "@babylonjs/core/types.js";
2
2
  import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
3
3
  import type { Camera } from "@babylonjs/core/Cameras/camera.js";
4
- import type { INode, ICamera, IMaterial } from "../glTFLoaderInterfaces";
5
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
6
- import type { GLTFLoader } from "../glTFLoader";
4
+ import type { INode, ICamera, IMaterial } from "../glTFLoaderInterfaces.js";
5
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
6
+ import type { GLTFLoader } from "../glTFLoader.js";
7
7
  import type { Material } from "@babylonjs/core/Materials/material.js";
8
- declare module "../../glTFFileLoader" {
8
+ declare module "../../glTFFileLoader.js" {
9
9
  interface GLTFLoaderExtensionOptions {
10
10
  /**
11
11
  * Defines options for the ExtrasAsMetadata extension.
@@ -1,11 +1,11 @@
1
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
- import type { GLTFLoader } from "../glTFLoader";
1
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
2
+ import type { GLTFLoader } from "../glTFLoader.js";
3
3
  import type { Nullable } from "@babylonjs/core/types.js";
4
4
  import type { Animation } from "@babylonjs/core/Animations/animation.js";
5
5
  import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
6
- import type { IAnimation, IAnimationChannel } from "../glTFLoaderInterfaces";
7
- import "./KHR_animation_pointer.data";
8
- declare module "../../glTFFileLoader" {
6
+ import type { IAnimation, IAnimationChannel } from "../glTFLoaderInterfaces.js";
7
+ import "./KHR_animation_pointer.data.js";
8
+ declare module "../../glTFFileLoader.js" {
9
9
  interface GLTFLoaderExtensionOptions {
10
10
  /**
11
11
  * Defines options for the KHR_animation_pointer extension.
@@ -2,10 +2,10 @@ import { DracoDecoder } from "@babylonjs/core/Meshes/Compression/dracoDecoder.js
2
2
  import type { Nullable } from "@babylonjs/core/types.js";
3
3
  import type { Geometry } from "@babylonjs/core/Meshes/geometry.js";
4
4
  import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
5
- import type { IMeshPrimitive } from "../glTFLoaderInterfaces";
6
- import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
7
- import { GLTFLoader } from "../glTFLoader";
8
- declare module "../../glTFFileLoader" {
5
+ import type { IMeshPrimitive } from "../glTFLoaderInterfaces.js";
6
+ import type { IGLTFLoaderExtension } from "../glTFLoaderExtension.js";
7
+ import { GLTFLoader } from "../glTFLoader.js";
8
+ declare module "../../glTFFileLoader.js" {
9
9
  interface GLTFLoaderExtensionOptions {
10
10
  /**
11
11
  * Defines options for the KHR_draco_mesh_compression extension.
@@ -1,8 +1,8 @@
1
1
  import type { IKHRInteractivity_Declaration, IKHRInteractivity_Graph, IKHRInteractivity_Node } from "babylonjs-gltf2interface";
2
2
  import { FlowGraphBlockNames } from "@babylonjs/core/FlowGraph/Blocks/flowGraphBlockNames.js";
3
3
  import type { ISerializedFlowGraphBlock, ISerializedFlowGraphContext } from "@babylonjs/core/FlowGraph/typeDefinitions.js";
4
- import type { InteractivityGraphToFlowGraphParser } from "./interactivityGraphParser";
5
- import type { IGLTF } from "../../glTFLoaderInterfaces";
4
+ import type { InteractivityGraphToFlowGraphParser } from "./interactivityGraphParser.js";
5
+ import type { IGLTF } from "../../glTFLoaderInterfaces.js";
6
6
  interface IGLTFToFlowGraphMappingObject<I = any, O = any> {
7
7
  /**
8
8
  * The name of the property in the FlowGraph block.
@@ -139,7 +139,10 @@ export interface IGLTFToFlowGraphMapping {
139
139
  * @param glTFObject the glTF object
140
140
  * @returns true if validated, false if not.
141
141
  */
142
- validation?: (gltfBlock: IKHRInteractivity_Node, interactivityGraph: IKHRInteractivity_Graph, glTFObject?: IGLTF) => boolean;
142
+ validation?: (gltfBlock: IKHRInteractivity_Node, interactivityGraph: IKHRInteractivity_Graph, glTFObject?: IGLTF) => {
143
+ valid: boolean;
144
+ error?: string;
145
+ };
143
146
  /**
144
147
  * This is used if we need extra information for the constructor/options that is not provided directly by the glTF node.
145
148
  * This function can return more than one node, if extra nodes are needed for this block to function correctly.
@@ -96,11 +96,6 @@ const gltfToFlowGraphMapping = {
96
96
  },
97
97
  "event/send": {
98
98
  blocks: ["FlowGraphSendCustomEventBlock" /* FlowGraphBlockNames.SendCustomEvent */],
99
- outputs: {
100
- flows: {
101
- out: { name: "done" },
102
- },
103
- },
104
99
  extraProcessor(gltfBlock, declaration, _mapping, parser, serializedObjects) {
105
100
  // set eventId and eventData. The configuration object of the glTF should have a single object.
106
101
  // validate that we are running it on the right block.
@@ -130,24 +125,24 @@ const gltfToFlowGraphMapping = {
130
125
  validation(gltfBlock, interactivityGraph) {
131
126
  if (!gltfBlock.configuration) {
132
127
  Logger.Error("Receive event should have a configuration object");
133
- return false;
128
+ return { valid: false, error: "Receive event should have a configuration object" };
134
129
  }
135
130
  const eventConfiguration = gltfBlock.configuration["event"];
136
131
  if (!eventConfiguration) {
137
132
  Logger.Error("Receive event should have a single configuration object, the event itself");
138
- return false;
133
+ return { valid: false, error: "Receive event should have a single configuration object, the event itself" };
139
134
  }
140
135
  const eventId = eventConfiguration.value[0];
141
136
  if (typeof eventId !== "number") {
142
137
  Logger.Error("Event id should be a number");
143
- return false;
138
+ return { valid: false, error: "Event id should be a number" };
144
139
  }
145
140
  const event = interactivityGraph.events?.[eventId];
146
141
  if (!event) {
147
142
  Logger.Error(`Event with id ${eventId} not found`);
148
- return false;
143
+ return { valid: false, error: `Event with id ${eventId} not found` };
149
144
  }
150
- return true;
145
+ return { valid: true };
151
146
  },
152
147
  extraProcessor(gltfBlock, declaration, _mapping, parser, serializedObjects) {
153
148
  // set eventId and eventData. The configuration object of the glTF should have a single object.
@@ -207,6 +202,7 @@ const gltfToFlowGraphMapping = {
207
202
  // configure it to work the way glTF specifies
208
203
  serializedObjects[0].config = serializedObjects[0].config || {};
209
204
  serializedObjects[0].config.useMatrixPerComponent = true;
205
+ serializedObjects[0].config.preventIntegerFloatArithmetic = true;
210
206
  // try to infer the type or fallback to Integer
211
207
  // check the gltf block for the inputs, see if they have a type
212
208
  let type = -1;
@@ -222,6 +218,17 @@ const gltfToFlowGraphMapping = {
222
218
  }
223
219
  return serializedObjects;
224
220
  },
221
+ validation(gltfBlock) {
222
+ // make sure types are the same
223
+ if (gltfBlock.values) {
224
+ const types = Object.keys(gltfBlock.values).map((key) => gltfBlock.values[key].type);
225
+ const allSameType = types.every((type) => type === undefined || type === types[0]);
226
+ if (!allSameType) {
227
+ return { valid: false, error: "All inputs must be of the same type" };
228
+ }
229
+ }
230
+ return { valid: true };
231
+ },
225
232
  },
226
233
  "math/div": getSimpleInputMapping("FlowGraphDivideBlock" /* FlowGraphBlockNames.Divide */, ["a", "b"], true),
227
234
  "math/rem": getSimpleInputMapping("FlowGraphModuloBlock" /* FlowGraphBlockNames.Modulo */, ["a", "b"]),
@@ -767,13 +774,13 @@ const gltfToFlowGraphMapping = {
767
774
  });
768
775
  if (!onlyIntegers) {
769
776
  gltfBlock.configuration.cases.value = [];
770
- return true;
777
+ return { valid: true };
771
778
  }
772
779
  // check for duplicates
773
780
  const uniqueCases = new Set(cases);
774
781
  gltfBlock.configuration.cases.value = Array.from(uniqueCases);
775
782
  }
776
- return true;
783
+ return { valid: true };
777
784
  },
778
785
  extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {
779
786
  // convert all names of output flow to out_$1 apart from "default"
@@ -868,7 +875,7 @@ const gltfToFlowGraphMapping = {
868
875
  };
869
876
  gltfBlock.configuration.inputFlows.value = [0];
870
877
  }
871
- return true;
878
+ return { valid: true };
872
879
  },
873
880
  },
874
881
  "flow/throttle": {
@@ -895,9 +902,9 @@ const gltfToFlowGraphMapping = {
895
902
  validation(gltfBlock) {
896
903
  if (!gltfBlock.configuration?.variable?.value) {
897
904
  Logger.Error("Variable get block should have a variable configuration");
898
- return false;
905
+ return { valid: false, error: "Variable get block should have a variable configuration" };
899
906
  }
900
- return true;
907
+ return { valid: true };
901
908
  },
902
909
  configuration: {
903
910
  variable: {
@@ -1151,7 +1158,7 @@ const gltfToFlowGraphMapping = {
1151
1158
  },
1152
1159
  "pointer/interpolate": {
1153
1160
  // interpolate, parse the pointer and play the animation generated. 3 blocks!
1154
- blocks: ["FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */, "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */, "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */],
1161
+ blocks: ["FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */, "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */, "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */],
1155
1162
  configuration: {
1156
1163
  pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1157
1164
  },
@@ -1160,8 +1167,8 @@ const gltfToFlowGraphMapping = {
1160
1167
  value: { name: "value_1" },
1161
1168
  "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1162
1169
  duration: { name: "duration_1", gltfType: "number" /*, inOptions: true */ },
1163
- p1: { name: "controlPoint1", toBlock: "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */ },
1164
- p2: { name: "controlPoint2", toBlock: "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */ },
1170
+ p1: { name: "controlPoint1", toBlock: "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */ },
1171
+ p2: { name: "controlPoint2", toBlock: "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */ },
1165
1172
  },
1166
1173
  flows: {
1167
1174
  in: { name: "in", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
@@ -1375,13 +1382,13 @@ const gltfToFlowGraphMapping = {
1375
1382
  });
1376
1383
  if (!onlyIntegers) {
1377
1384
  gltfBlock.configuration.cases.value = [];
1378
- return true;
1385
+ return { valid: true };
1379
1386
  }
1380
1387
  // check for duplicates
1381
1388
  const uniqueCases = new Set(cases);
1382
1389
  gltfBlock.configuration.cases.value = Array.from(uniqueCases);
1383
1390
  }
1384
- return true;
1391
+ return { valid: true };
1385
1392
  },
1386
1393
  extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects) {
1387
1394
  const serializedObject = serializedObjects[0];
@@ -1414,16 +1421,17 @@ function getSimpleInputMapping(type, inputs = ["a"], inferType) {
1414
1421
  value: { name: "value" },
1415
1422
  },
1416
1423
  },
1417
- extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
1424
+ extraProcessor(gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
1418
1425
  if (inferType) {
1419
1426
  // configure it to work the way glTF specifies
1420
1427
  serializedObjects[0].config = serializedObjects[0].config || {};
1428
+ serializedObjects[0].config.preventIntegerFloatArithmetic = true;
1421
1429
  // try to infer the type or fallback to Integer
1422
1430
  // check the gltf block for the inputs, see if they have a type
1423
1431
  let type = -1;
1424
- Object.keys(_gltfBlock.values || {}).find((value) => {
1425
- if (_gltfBlock.values?.[value].type !== undefined) {
1426
- type = _gltfBlock.values[value].type;
1432
+ Object.keys(gltfBlock.values || {}).find((value) => {
1433
+ if (gltfBlock.values?.[value].type !== undefined) {
1434
+ type = gltfBlock.values[value].type;
1427
1435
  return true;
1428
1436
  }
1429
1437
  return false;
@@ -1434,6 +1442,20 @@ function getSimpleInputMapping(type, inputs = ["a"], inferType) {
1434
1442
  }
1435
1443
  return serializedObjects;
1436
1444
  },
1445
+ validation(gltfBlock) {
1446
+ if (inferType) {
1447
+ // make sure types are the same
1448
+ if (gltfBlock.values) {
1449
+ const types = Object.keys(gltfBlock.values).map((key) => gltfBlock.values[key].type);
1450
+ console.log(types);
1451
+ const allSameType = types.every((type) => type === undefined || type === types[0]);
1452
+ if (!allSameType) {
1453
+ return { valid: false, error: "All inputs must be of the same type" };
1454
+ }
1455
+ }
1456
+ }
1457
+ return { valid: true };
1458
+ },
1437
1459
  };
1438
1460
  }
1439
1461
  export function getAllSupportedNativeNodeTypes() {