@onerjs/loaders 8.49.3 → 8.49.5

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.
@@ -6,11 +6,13 @@ import { RichTypeAny } from "@onerjs/core/FlowGraph/flowGraphRichTypes.js";
6
6
  */
7
7
  export class FlowGraphGLTFDataProvider extends FlowGraphBlock {
8
8
  constructor(config) {
9
- super();
9
+ super(config);
10
10
  const glTF = config.glTF;
11
- const animationGroups = glTF.animations?.map((a) => a._babylonAnimationGroup) || [];
11
+ // glTF may be undefined when the block is re-created from serialized data
12
+ // (e.g. in the Flow Graph Editor) where the live glTF parse tree is unavailable.
13
+ const animationGroups = glTF?.animations?.map((a) => a._babylonAnimationGroup) || [];
12
14
  this.animationGroups = this.registerDataOutput("animationGroups", RichTypeAny, animationGroups);
13
- const nodes = glTF.nodes?.map((n) => n._babylonTransformNode) || [];
15
+ const nodes = glTF?.nodes?.map((n) => n._babylonTransformNode) || [];
14
16
  this.nodes = this.registerDataOutput("nodes", RichTypeAny, nodes);
15
17
  }
16
18
  getClassName() {
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphGLTFDataProvider.js","sourceRoot":"","sources":["../../../../../../../dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAKlG,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAYhE;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAazD,YAAY,MAAoD;QAC5D,KAAK,EAAE,CAAC;QACR,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC;QACpF,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;QAChG,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;QACpE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAEe,YAAY;QACxB,OAAO,2BAA2B,CAAC;IACvC,CAAC;CACJ","sourcesContent":["import { type IFlowGraphBlockConfiguration, FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport { type IGLTF } from \"../../glTFLoaderInterfaces\";\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { type AnimationGroup } from \"core/Animations/animationGroup\";\nimport { type TransformNode } from \"core/Meshes/transformNode\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\n\n/**\n * a configuration interface for this block\n */\nexport interface IFlowGraphGLTFDataProviderBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * the glTF object to provide data from\n */\n glTF: IGLTF;\n}\n\n/**\n * a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree\n * Can be used, for example, to get animation index from a glTF animation\n */\nexport class FlowGraphGLTFDataProvider extends FlowGraphBlock {\n /**\n * Output: an array of animation groups\n * Corresponds directly to the glTF animations array\n */\n public readonly animationGroups: FlowGraphDataConnection<AnimationGroup[]>;\n\n /**\n * Output an array of (Transform) nodes\n * Corresponds directly to the glTF nodes array\n */\n public readonly nodes: FlowGraphDataConnection<TransformNode[]>;\n\n constructor(config: IFlowGraphGLTFDataProviderBlockConfiguration) {\n super();\n const glTF = config.glTF;\n const animationGroups = glTF.animations?.map((a) => a._babylonAnimationGroup) || [];\n this.animationGroups = this.registerDataOutput(\"animationGroups\", RichTypeAny, animationGroups);\n const nodes = glTF.nodes?.map((n) => n._babylonTransformNode) || [];\n this.nodes = this.registerDataOutput(\"nodes\", RichTypeAny, nodes);\n }\n\n public override getClassName(): string {\n return \"FlowGraphGLTFDataProvider\";\n }\n}\n"]}
1
+ {"version":3,"file":"flowGraphGLTFDataProvider.js","sourceRoot":"","sources":["../../../../../../../dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAKlG,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAYhE;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAazD,YAAY,MAAoD;QAC5D,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,0EAA0E;QAC1E,iFAAiF;QACjF,MAAM,eAAe,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC;QACrF,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;QAChG,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAEe,YAAY;QACxB,OAAO,2BAA2B,CAAC;IACvC,CAAC;CACJ","sourcesContent":["import { type IFlowGraphBlockConfiguration, FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport { type IGLTF } from \"../../glTFLoaderInterfaces\";\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { type AnimationGroup } from \"core/Animations/animationGroup\";\nimport { type TransformNode } from \"core/Meshes/transformNode\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\n\n/**\n * a configuration interface for this block\n */\nexport interface IFlowGraphGLTFDataProviderBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * the glTF object to provide data from\n */\n glTF: IGLTF;\n}\n\n/**\n * a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree\n * Can be used, for example, to get animation index from a glTF animation\n */\nexport class FlowGraphGLTFDataProvider extends FlowGraphBlock {\n /**\n * Output: an array of animation groups\n * Corresponds directly to the glTF animations array\n */\n public readonly animationGroups: FlowGraphDataConnection<AnimationGroup[]>;\n\n /**\n * Output an array of (Transform) nodes\n * Corresponds directly to the glTF nodes array\n */\n public readonly nodes: FlowGraphDataConnection<TransformNode[]>;\n\n constructor(config: IFlowGraphGLTFDataProviderBlockConfiguration) {\n super(config);\n const glTF = config.glTF;\n // glTF may be undefined when the block is re-created from serialized data\n // (e.g. in the Flow Graph Editor) where the live glTF parse tree is unavailable.\n const animationGroups = glTF?.animations?.map((a) => a._babylonAnimationGroup) || [];\n this.animationGroups = this.registerDataOutput(\"animationGroups\", RichTypeAny, animationGroups);\n const nodes = glTF?.nodes?.map((n) => n._babylonTransformNode) || [];\n this.nodes = this.registerDataOutput(\"nodes\", RichTypeAny, nodes);\n }\n\n public override getClassName(): string {\n return \"FlowGraphGLTFDataProvider\";\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onerjs/loaders",
3
- "version": "8.49.3",
3
+ "version": "8.49.5",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,10 +18,10 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@onerjs/core": "8.49.3",
21
+ "@onerjs/core": "8.49.5",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@dev/loaders": "^1.0.0",
24
- "babylonjs-gltf2interface": "^8.49.3"
24
+ "babylonjs-gltf2interface": "^8.49.5"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@onerjs/core": "^8.0.0",