@loaders.gl/scene 5.0.0-beta.2 → 5.0.0-beta.4

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 (151) hide show
  1. package/dist/dist.dev.js +3393 -407
  2. package/dist/dist.min.js +24 -16
  3. package/dist/draco/lib/utils/version.cjs +1 -1
  4. package/dist/draco/lib/utils/version.js +1 -1
  5. package/dist/draco-worker-node.js +415 -54
  6. package/dist/draco-worker-node.js.map +4 -4
  7. package/dist/draco-worker.js +390 -54
  8. package/dist/draco-worker.js.map +4 -4
  9. package/dist/draco-writer-worker-node.cjs +1401 -67
  10. package/dist/draco-writer-worker-node.cjs.map +4 -4
  11. package/dist/draco-writer-worker.js +1345 -67
  12. package/dist/draco-writer-worker.js.map +4 -4
  13. package/dist/gltf/gltf-loader-types.cjs.map +2 -2
  14. package/dist/gltf/gltf-loader-types.d.ts +6 -0
  15. package/dist/gltf/gltf-loader-types.d.ts.map +1 -1
  16. package/dist/gltf/gltf-loader-types.js.map +1 -1
  17. package/dist/gltf/index.cjs +2 -0
  18. package/dist/gltf/index.cjs.map +2 -2
  19. package/dist/gltf/index.d.ts +2 -2
  20. package/dist/gltf/index.d.ts.map +1 -1
  21. package/dist/gltf/index.js +1 -1
  22. package/dist/gltf/index.js.map +1 -1
  23. package/dist/gltf/lib/api/gltf-extensions.cjs +7 -2
  24. package/dist/gltf/lib/api/gltf-extensions.cjs.map +2 -2
  25. package/dist/gltf/lib/api/gltf-extensions.d.ts.map +1 -1
  26. package/dist/gltf/lib/api/gltf-extensions.js +7 -5
  27. package/dist/gltf/lib/api/gltf-extensions.js.map +1 -1
  28. package/dist/gltf/lib/extensions/EXT_texture_webp.cjs +1 -0
  29. package/dist/gltf/lib/extensions/EXT_texture_webp.cjs.map +2 -2
  30. package/dist/gltf/lib/extensions/EXT_texture_webp.d.ts.map +1 -1
  31. package/dist/gltf/lib/extensions/EXT_texture_webp.js +3 -0
  32. package/dist/gltf/lib/extensions/EXT_texture_webp.js.map +1 -1
  33. package/dist/gltf/lib/extensions/KHR_accessor_float64.cjs +45 -0
  34. package/dist/gltf/lib/extensions/KHR_accessor_float64.cjs.map +7 -0
  35. package/dist/gltf/lib/extensions/KHR_accessor_float64.d.ts +6 -0
  36. package/dist/gltf/lib/extensions/KHR_accessor_float64.d.ts.map +1 -0
  37. package/dist/gltf/lib/extensions/KHR_accessor_float64.js +20 -0
  38. package/dist/gltf/lib/extensions/KHR_accessor_float64.js.map +1 -0
  39. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs +12 -3
  40. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs.map +2 -2
  41. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts +2 -1
  42. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts.map +1 -1
  43. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js +9 -3
  44. package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js.map +1 -1
  45. package/dist/gltf/lib/extensions/MSFT_texture_dds.cjs +64 -0
  46. package/dist/gltf/lib/extensions/MSFT_texture_dds.cjs.map +7 -0
  47. package/dist/gltf/lib/extensions/MSFT_texture_dds.d.ts +12 -0
  48. package/dist/gltf/lib/extensions/MSFT_texture_dds.d.ts.map +1 -0
  49. package/dist/gltf/lib/extensions/MSFT_texture_dds.js +39 -0
  50. package/dist/gltf/lib/extensions/MSFT_texture_dds.js.map +1 -0
  51. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.cjs +1 -1
  52. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.cjs.map +2 -2
  53. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -1
  54. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.js +3 -1
  55. package/dist/gltf/lib/extensions/utils/3d-tiles-utils.js.map +1 -1
  56. package/dist/gltf/lib/parsers/parse-gltf.cjs +25 -0
  57. package/dist/gltf/lib/parsers/parse-gltf.cjs.map +2 -2
  58. package/dist/gltf/lib/parsers/parse-gltf.d.ts.map +1 -1
  59. package/dist/gltf/lib/parsers/parse-gltf.js +18 -0
  60. package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
  61. package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.cjs.map +1 -1
  62. package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.d.ts +1 -1
  63. package/dist/gltf/lib/types/gltf-ext-gaussian-splatting-schema.d.ts.map +1 -1
  64. package/dist/gltf/lib/types/gltf-texture-procedurals.cjs +19 -0
  65. package/dist/gltf/lib/types/gltf-texture-procedurals.cjs.map +7 -0
  66. package/dist/gltf/lib/types/gltf-texture-procedurals.d.ts +45 -0
  67. package/dist/gltf/lib/types/gltf-texture-procedurals.d.ts.map +1 -0
  68. package/dist/gltf/lib/types/gltf-texture-procedurals.js +5 -0
  69. package/dist/gltf/lib/types/gltf-texture-procedurals.js.map +1 -0
  70. package/dist/gltf/lib/types/gltf-types.cjs.map +1 -1
  71. package/dist/gltf/lib/types/gltf-types.d.ts +7 -0
  72. package/dist/gltf/lib/types/gltf-types.d.ts.map +1 -1
  73. package/dist/gltf/lib/types/gltf-zod-schema.cjs +3 -0
  74. package/dist/gltf/lib/types/gltf-zod-schema.cjs.map +2 -2
  75. package/dist/gltf/lib/types/gltf-zod-schema.d.ts +5 -0
  76. package/dist/gltf/lib/types/gltf-zod-schema.d.ts.map +1 -1
  77. package/dist/gltf/lib/types/gltf-zod-schema.js +4 -0
  78. package/dist/gltf/lib/types/gltf-zod-schema.js.map +1 -1
  79. package/dist/gltf/lib/utils/version.cjs +1 -1
  80. package/dist/gltf/lib/utils/version.js +1 -1
  81. package/dist/gltf/schema.cjs +3 -0
  82. package/dist/gltf/schema.cjs.map +2 -2
  83. package/dist/gltf/schema.d.ts +1 -0
  84. package/dist/gltf/schema.d.ts.map +1 -1
  85. package/dist/gltf/schema.js +1 -0
  86. package/dist/gltf/schema.js.map +1 -1
  87. package/dist/gltf-loader-types.cjs.map +2 -2
  88. package/dist/index.cjs +3 -0
  89. package/dist/index.cjs.map +2 -2
  90. package/dist/index.d.ts +2 -0
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1 -0
  93. package/dist/index.js.map +1 -1
  94. package/dist/materialx/parse-materialx.cjs +61 -0
  95. package/dist/materialx/parse-materialx.cjs.map +7 -0
  96. package/dist/materialx/parse-materialx.d.ts +23 -0
  97. package/dist/materialx/parse-materialx.d.ts.map +1 -0
  98. package/dist/materialx/parse-materialx.js +39 -0
  99. package/dist/materialx/parse-materialx.js.map +1 -0
  100. package/dist/materialx/procedural-graph.cjs +77 -0
  101. package/dist/materialx/procedural-graph.cjs.map +7 -0
  102. package/dist/materialx/procedural-graph.d.ts +40 -0
  103. package/dist/materialx/procedural-graph.d.ts.map +1 -0
  104. package/dist/materialx/procedural-graph.js +59 -0
  105. package/dist/materialx/procedural-graph.js.map +1 -0
  106. package/dist/materialx-loader-types.cjs +57 -0
  107. package/dist/materialx-loader-types.cjs.map +7 -0
  108. package/dist/materialx-loader-types.d.ts +34 -0
  109. package/dist/materialx-loader-types.d.ts.map +1 -0
  110. package/dist/materialx-loader-types.js +20 -0
  111. package/dist/materialx-loader-types.js.map +1 -0
  112. package/dist/materialx-loader.cjs +40 -0
  113. package/dist/materialx-loader.cjs.map +7 -0
  114. package/dist/materialx-loader.d.ts +19 -0
  115. package/dist/materialx-loader.d.ts.map +1 -0
  116. package/dist/materialx-loader.js +14 -0
  117. package/dist/materialx-loader.js.map +1 -0
  118. package/dist/mtl-loader-types.cjs +1 -1
  119. package/dist/obj/mtl-loader-types.cjs +1 -1
  120. package/dist/obj/mtl-loader-types.js +1 -1
  121. package/dist/obj/obj-loader-types.cjs +1 -1
  122. package/dist/obj/obj-loader-types.js +1 -1
  123. package/dist/obj/obj-writer.cjs +1 -1
  124. package/dist/obj/obj-writer.js +1 -1
  125. package/dist/obj-loader-types.cjs +1 -1
  126. package/dist/obj-worker.js +393 -57
  127. package/dist/obj-writer.cjs +1 -1
  128. package/dist/usd/usd-loader-types.cjs +1 -1
  129. package/dist/usd/usd-loader-types.js +1 -1
  130. package/dist/usd-loader-types.cjs +1 -1
  131. package/package.json +11 -5
  132. package/src/gltf/gltf-loader-types.ts +6 -0
  133. package/src/gltf/index.ts +4 -1
  134. package/src/gltf/lib/api/gltf-extensions.ts +7 -2
  135. package/src/gltf/lib/extensions/EXT_texture_webp.ts +3 -0
  136. package/src/gltf/lib/extensions/KHR_accessor_float64.ts +22 -0
  137. package/src/gltf/lib/extensions/KHR_gaussian_splatting.ts +17 -3
  138. package/src/gltf/lib/extensions/MSFT_texture_dds.ts +52 -0
  139. package/src/gltf/lib/extensions/utils/3d-tiles-utils.ts +5 -1
  140. package/src/gltf/lib/parsers/parse-gltf.ts +29 -0
  141. package/src/gltf/lib/types/gltf-ext-gaussian-splatting-schema.ts +1 -1
  142. package/src/gltf/lib/types/gltf-texture-procedurals.ts +67 -0
  143. package/src/gltf/lib/types/gltf-types.ts +8 -0
  144. package/src/gltf/lib/types/gltf-zod-schema.ts +5 -0
  145. package/src/gltf/schema.ts +1 -0
  146. package/src/index.ts +3 -0
  147. package/src/materialx/README.md +5 -0
  148. package/src/materialx/parse-materialx.ts +70 -0
  149. package/src/materialx/procedural-graph.ts +94 -0
  150. package/src/materialx-loader-types.ts +24 -0
  151. package/src/materialx-loader.ts +15 -0
@@ -0,0 +1,39 @@
1
+ import { parseXMLSync } from '@loaders.gl/documents/xml-parser';
2
+ /**
3
+ * Parses a MaterialX XML document using the native documents XML parser.
4
+ * Preserves unknown categories, connection references and value strings.
5
+ * Does not load includes, resolve node definitions, or evaluate shader graphs.
6
+ */
7
+ export function parseMaterialX(text) {
8
+ if (/<!DOCTYPE|<!ENTITY/i.test(text)) {
9
+ throw new Error('MaterialX: document types and entity declarations are unsupported.');
10
+ }
11
+ let element;
12
+ try {
13
+ element = parseXMLSync(text, {
14
+ preserveOrder: true,
15
+ parseAttributeValue: false,
16
+ trimValues: false
17
+ });
18
+ }
19
+ catch (error) {
20
+ throw new Error('MaterialX: malformed XML.', { cause: error });
21
+ }
22
+ if (element.name !== 'materialx') {
23
+ throw new Error('MaterialX: expected a materialx root element.');
24
+ }
25
+ const version = element.attributes.version;
26
+ if (!version || !/^1\.\d+$/.test(version)) {
27
+ throw new Error('MaterialX: expected a MaterialX 1.x version.');
28
+ }
29
+ return { version, root: parseElement(element, 0) };
30
+ }
31
+ /** Converts the native XML tree to MaterialX categories. */
32
+ function parseElement(element, depth) {
33
+ return {
34
+ category: element.name,
35
+ attributes: element.attributes,
36
+ children: element.children.map(child => parseElement(child, depth + 1))
37
+ };
38
+ }
39
+ //# sourceMappingURL=parse-materialx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-materialx.js","sourceRoot":"","sources":["../../src/materialx/parse-materialx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAuB9D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IACD,IAAI,OAA0B,CAAC;IAC/B,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE;YAC3B,aAAa,EAAE,IAAI;YACnB,mBAAmB,EAAE,KAAK;YAC1B,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,EAAE,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;IAC/D,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IAC3C,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,EAAC,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,EAAC,CAAC;AACnD,CAAC;AAYD,4DAA4D;AAC5D,SAAS,YAAY,CAAC,OAA0B,EAAE,KAAa;IAC7D,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,IAAI;QACtB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;KACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/materialx/procedural-graph.ts
21
+ var procedural_graph_exports = {};
22
+ __export(procedural_graph_exports, {
23
+ orderProceduralGraph: () => orderProceduralGraph
24
+ });
25
+ module.exports = __toCommonJS(procedural_graph_exports);
26
+ function orderProceduralGraph(graph) {
27
+ const nodes = /* @__PURE__ */ new Map();
28
+ for (const node of graph.nodes) {
29
+ if (!node.id || nodes.has(node.id))
30
+ throw new Error("Procedural graph: duplicate or empty node ID.");
31
+ nodes.set(node.id, node);
32
+ }
33
+ const dependencies = /* @__PURE__ */ new Map();
34
+ const dependents = /* @__PURE__ */ new Map();
35
+ for (const node of graph.nodes) {
36
+ const upstream = /* @__PURE__ */ new Set();
37
+ for (const input of Object.values(node.inputs)) {
38
+ if (!input.connection) continue;
39
+ if (Object.hasOwn(input, "value"))
40
+ throw new Error("Procedural graph: connected input also has a value.");
41
+ const source = resolveOutput(input.connection);
42
+ if (source.outputs[input.connection.output] !== input.type) {
43
+ throw new Error("Procedural graph: incompatible connection types.");
44
+ }
45
+ upstream.add(source.id);
46
+ }
47
+ dependencies.set(node.id, upstream);
48
+ for (const identifier of upstream) {
49
+ const downstream = dependents.get(identifier) || [];
50
+ downstream.push(node.id);
51
+ dependents.set(identifier, downstream);
52
+ }
53
+ }
54
+ for (const output of Object.values(graph.outputs)) resolveOutput(output);
55
+ const ordered = graph.nodes.filter((node) => dependencies.get(node.id).size === 0);
56
+ for (let index = 0; index < ordered.length; index++) {
57
+ for (const identifier of dependents.get(ordered[index].id) || []) {
58
+ const upstream = dependencies.get(identifier);
59
+ upstream.delete(ordered[index].id);
60
+ if (!upstream.size) ordered.push(nodes.get(identifier));
61
+ }
62
+ }
63
+ if (ordered.length !== graph.nodes.length) throw new Error("Procedural graph: cycle detected.");
64
+ return ordered;
65
+ function resolveOutput(connection) {
66
+ const node = nodes.get(connection.node);
67
+ if (!node || !Object.hasOwn(node.outputs, connection.output)) {
68
+ throw new Error("Procedural graph: missing node or output.");
69
+ }
70
+ return node;
71
+ }
72
+ }
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ orderProceduralGraph
76
+ });
77
+ //# sourceMappingURL=procedural-graph.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/materialx/procedural-graph.ts"],
4
+ "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n\n/** Typed connection to one node output. */\nexport interface ProceduralConnection {\n /** Stable identifier of the upstream node. */\n node: string;\n /** Name of its output port. */\n output: string;\n}\n\n/** Input supplied by a constant or another node. */\nexport interface ProceduralInput {\n /** Declared value type. */\n type: string;\n /** Constant value, retained without implicit conversion. */\n value?: unknown;\n /** Optional upstream connection. */\n connection?: ProceduralConnection;\n}\n\n/** Renderer-independent operation with explicitly declared ports. */\nexport interface ProceduralNode {\n /** Stable node identifier, unique within the graph. */\n id: string;\n /** Operation identifier for a downstream implementation registry. */\n operation: string;\n /** Named inputs. */\n inputs: Record<string, ProceduralInput>;\n /** Named output value types. */\n outputs: Record<string, string>;\n}\n\n/** Graph contract independent of GPU resources or shader languages. */\nexport interface ProceduralGraph {\n /** Nodes in authored order. */\n nodes: ProceduralNode[];\n /** Named graph outputs and their upstream connections. */\n outputs: Record<string, ProceduralConnection>;\n}\n\n/**\n * Validates explicit references and exact port types, returning dependency-first nodes.\n * Does not infer conversions, resolve MaterialX definitions, or evaluate operations.\n */\nexport function orderProceduralGraph(graph: ProceduralGraph): ProceduralNode[] {\n const nodes = new Map<string, ProceduralNode>();\n for (const node of graph.nodes) {\n if (!node.id || nodes.has(node.id))\n throw new Error('Procedural graph: duplicate or empty node ID.');\n nodes.set(node.id, node);\n }\n const dependencies = new Map<string, Set<string>>();\n const dependents = new Map<string, string[]>();\n for (const node of graph.nodes) {\n const upstream = new Set<string>();\n for (const input of Object.values(node.inputs)) {\n if (!input.connection) continue;\n if (Object.hasOwn(input, 'value'))\n throw new Error('Procedural graph: connected input also has a value.');\n const source = resolveOutput(input.connection);\n if (source.outputs[input.connection.output] !== input.type) {\n throw new Error('Procedural graph: incompatible connection types.');\n }\n upstream.add(source.id);\n }\n dependencies.set(node.id, upstream);\n for (const identifier of upstream) {\n const downstream = dependents.get(identifier) || [];\n downstream.push(node.id);\n dependents.set(identifier, downstream);\n }\n }\n for (const output of Object.values(graph.outputs)) resolveOutput(output);\n const ordered = graph.nodes.filter(node => dependencies.get(node.id)!.size === 0);\n for (let index = 0; index < ordered.length; index++) {\n for (const identifier of dependents.get(ordered[index].id) || []) {\n const upstream = dependencies.get(identifier)!;\n upstream.delete(ordered[index].id);\n if (!upstream.size) ordered.push(nodes.get(identifier)!);\n }\n }\n if (ordered.length !== graph.nodes.length) throw new Error('Procedural graph: cycle detected.');\n return ordered;\n\n /** Resolves an explicitly named output without accepting inherited properties. */\n function resolveOutput(connection: ProceduralConnection): ProceduralNode {\n const node = nodes.get(connection.node);\n if (!node || !Object.hasOwn(node.outputs, connection.output)) {\n throw new Error('Procedural graph: missing node or output.');\n }\n return node;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CO,SAAS,qBAAqB,OAA0C;AAC7E,QAAM,QAAQ,oBAAI,IAA4B;AAC9C,aAAW,QAAQ,MAAM,OAAO;AAC9B,QAAI,CAAC,KAAK,MAAM,MAAM,IAAI,KAAK,EAAE;AAC/B,YAAM,IAAI,MAAM,+CAA+C;AACjE,UAAM,IAAI,KAAK,IAAI,IAAI;AAAA,EACzB;AACA,QAAM,eAAe,oBAAI,IAAyB;AAClD,QAAM,aAAa,oBAAI,IAAsB;AAC7C,aAAW,QAAQ,MAAM,OAAO;AAC9B,UAAM,WAAW,oBAAI,IAAY;AACjC,eAAW,SAAS,OAAO,OAAO,KAAK,MAAM,GAAG;AAC9C,UAAI,CAAC,MAAM,WAAY;AACvB,UAAI,OAAO,OAAO,OAAO,OAAO;AAC9B,cAAM,IAAI,MAAM,qDAAqD;AACvE,YAAM,SAAS,cAAc,MAAM,UAAU;AAC7C,UAAI,OAAO,QAAQ,MAAM,WAAW,MAAM,MAAM,MAAM,MAAM;AAC1D,cAAM,IAAI,MAAM,kDAAkD;AAAA,MACpE;AACA,eAAS,IAAI,OAAO,EAAE;AAAA,IACxB;AACA,iBAAa,IAAI,KAAK,IAAI,QAAQ;AAClC,eAAW,cAAc,UAAU;AACjC,YAAM,aAAa,WAAW,IAAI,UAAU,KAAK,CAAC;AAClD,iBAAW,KAAK,KAAK,EAAE;AACvB,iBAAW,IAAI,YAAY,UAAU;AAAA,IACvC;AAAA,EACF;AACA,aAAW,UAAU,OAAO,OAAO,MAAM,OAAO,EAAG,eAAc,MAAM;AACvE,QAAM,UAAU,MAAM,MAAM,OAAO,UAAQ,aAAa,IAAI,KAAK,EAAE,EAAG,SAAS,CAAC;AAChF,WAAS,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,SAAS;AACnD,eAAW,cAAc,WAAW,IAAI,QAAQ,KAAK,EAAE,EAAE,KAAK,CAAC,GAAG;AAChE,YAAM,WAAW,aAAa,IAAI,UAAU;AAC5C,eAAS,OAAO,QAAQ,KAAK,EAAE,EAAE;AACjC,UAAI,CAAC,SAAS,KAAM,SAAQ,KAAK,MAAM,IAAI,UAAU,CAAE;AAAA,IACzD;AAAA,EACF;AACA,MAAI,QAAQ,WAAW,MAAM,MAAM,OAAQ,OAAM,IAAI,MAAM,mCAAmC;AAC9F,SAAO;AAGP,WAAS,cAAc,YAAkD;AACvE,UAAM,OAAO,MAAM,IAAI,WAAW,IAAI;AACtC,QAAI,CAAC,QAAQ,CAAC,OAAO,OAAO,KAAK,SAAS,WAAW,MAAM,GAAG;AAC5D,YAAM,IAAI,MAAM,2CAA2C;AAAA,IAC7D;AACA,WAAO;AAAA,EACT;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ /** Typed connection to one node output. */
2
+ export interface ProceduralConnection {
3
+ /** Stable identifier of the upstream node. */
4
+ node: string;
5
+ /** Name of its output port. */
6
+ output: string;
7
+ }
8
+ /** Input supplied by a constant or another node. */
9
+ export interface ProceduralInput {
10
+ /** Declared value type. */
11
+ type: string;
12
+ /** Constant value, retained without implicit conversion. */
13
+ value?: unknown;
14
+ /** Optional upstream connection. */
15
+ connection?: ProceduralConnection;
16
+ }
17
+ /** Renderer-independent operation with explicitly declared ports. */
18
+ export interface ProceduralNode {
19
+ /** Stable node identifier, unique within the graph. */
20
+ id: string;
21
+ /** Operation identifier for a downstream implementation registry. */
22
+ operation: string;
23
+ /** Named inputs. */
24
+ inputs: Record<string, ProceduralInput>;
25
+ /** Named output value types. */
26
+ outputs: Record<string, string>;
27
+ }
28
+ /** Graph contract independent of GPU resources or shader languages. */
29
+ export interface ProceduralGraph {
30
+ /** Nodes in authored order. */
31
+ nodes: ProceduralNode[];
32
+ /** Named graph outputs and their upstream connections. */
33
+ outputs: Record<string, ProceduralConnection>;
34
+ }
35
+ /**
36
+ * Validates explicit references and exact port types, returning dependency-first nodes.
37
+ * Does not infer conversions, resolve MaterialX definitions, or evaluate operations.
38
+ */
39
+ export declare function orderProceduralGraph(graph: ProceduralGraph): ProceduralNode[];
40
+ //# sourceMappingURL=procedural-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedural-graph.d.ts","sourceRoot":"","sources":["../../src/materialx/procedural-graph.ts"],"names":[],"mappings":"AAGA,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oCAAoC;IACpC,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,EAAE,CAgD7E"}
@@ -0,0 +1,59 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ /**
4
+ * Validates explicit references and exact port types, returning dependency-first nodes.
5
+ * Does not infer conversions, resolve MaterialX definitions, or evaluate operations.
6
+ */
7
+ export function orderProceduralGraph(graph) {
8
+ const nodes = new Map();
9
+ for (const node of graph.nodes) {
10
+ if (!node.id || nodes.has(node.id))
11
+ throw new Error('Procedural graph: duplicate or empty node ID.');
12
+ nodes.set(node.id, node);
13
+ }
14
+ const dependencies = new Map();
15
+ const dependents = new Map();
16
+ for (const node of graph.nodes) {
17
+ const upstream = new Set();
18
+ for (const input of Object.values(node.inputs)) {
19
+ if (!input.connection)
20
+ continue;
21
+ if (Object.hasOwn(input, 'value'))
22
+ throw new Error('Procedural graph: connected input also has a value.');
23
+ const source = resolveOutput(input.connection);
24
+ if (source.outputs[input.connection.output] !== input.type) {
25
+ throw new Error('Procedural graph: incompatible connection types.');
26
+ }
27
+ upstream.add(source.id);
28
+ }
29
+ dependencies.set(node.id, upstream);
30
+ for (const identifier of upstream) {
31
+ const downstream = dependents.get(identifier) || [];
32
+ downstream.push(node.id);
33
+ dependents.set(identifier, downstream);
34
+ }
35
+ }
36
+ for (const output of Object.values(graph.outputs))
37
+ resolveOutput(output);
38
+ const ordered = graph.nodes.filter(node => dependencies.get(node.id).size === 0);
39
+ for (let index = 0; index < ordered.length; index++) {
40
+ for (const identifier of dependents.get(ordered[index].id) || []) {
41
+ const upstream = dependencies.get(identifier);
42
+ upstream.delete(ordered[index].id);
43
+ if (!upstream.size)
44
+ ordered.push(nodes.get(identifier));
45
+ }
46
+ }
47
+ if (ordered.length !== graph.nodes.length)
48
+ throw new Error('Procedural graph: cycle detected.');
49
+ return ordered;
50
+ /** Resolves an explicitly named output without accepting inherited properties. */
51
+ function resolveOutput(connection) {
52
+ const node = nodes.get(connection.node);
53
+ if (!node || !Object.hasOwn(node.outputs, connection.output)) {
54
+ throw new Error('Procedural graph: missing node or output.');
55
+ }
56
+ return node;
57
+ }
58
+ }
59
+ //# sourceMappingURL=procedural-graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedural-graph.js","sourceRoot":"","sources":["../../src/materialx/procedural-graph.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/materialx-loader-types.ts
31
+ var materialx_loader_types_exports = {};
32
+ __export(materialx_loader_types_exports, {
33
+ MaterialXLoader: () => MaterialXLoader
34
+ });
35
+ module.exports = __toCommonJS(materialx_loader_types_exports);
36
+ async function preload() {
37
+ const { MaterialXLoaderWithParser } = await import("@loaders.gl/scene/materialx-loader");
38
+ return MaterialXLoaderWithParser;
39
+ }
40
+ var MaterialXLoader = {
41
+ name: "MaterialX",
42
+ id: "materialx",
43
+ module: "scene",
44
+ version: "latest",
45
+ extensions: ["mtlx"],
46
+ mimeTypes: ["application/xml"],
47
+ text: true,
48
+ dataType: null,
49
+ batchType: null,
50
+ options: {},
51
+ preload
52
+ };
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ MaterialXLoader
56
+ });
57
+ //# sourceMappingURL=materialx-loader-types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/materialx-loader-types.ts"],
4
+ "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\nimport type {MaterialXDocument} from './materialx/parse-materialx';\n\n/** Loads the parser-bearing MaterialX implementation. */\nasync function preload() {\n const {MaterialXLoaderWithParser} = await import('@loaders.gl/scene/materialx-loader');\n return MaterialXLoaderWithParser;\n}\n\n/** Metadata-only loader for MaterialX XML documents. */\nexport const MaterialXLoader = {\n name: 'MaterialX',\n id: 'materialx',\n module: 'scene',\n version: 'latest',\n extensions: ['mtlx'],\n mimeTypes: ['application/xml'],\n text: true,\n dataType: null as unknown as MaterialXDocument,\n batchType: null as never,\n options: {},\n preload\n} as const;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,eAAe,UAAU;AACvB,QAAM,EAAC,0BAAyB,IAAI,MAAM,OAAO,oCAAoC;AACrF,SAAO;AACT;AAGO,IAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY,CAAC,MAAM;AAAA,EACnB,WAAW,CAAC,iBAAiB;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS,CAAC;AAAA,EACV;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
1
+ import type { MaterialXDocument } from "./materialx/parse-materialx.js";
2
+ /** Loads the parser-bearing MaterialX implementation. */
3
+ declare function preload(): Promise<{
4
+ readonly parse: (data: ArrayBuffer) => Promise<MaterialXDocument>;
5
+ readonly parseSync: (data: ArrayBuffer) => MaterialXDocument;
6
+ readonly parseText: (text: string) => Promise<MaterialXDocument>;
7
+ readonly parseTextSync: typeof import("./materialx/parse-materialx").parseMaterialX;
8
+ readonly name: "MaterialX";
9
+ readonly id: "materialx";
10
+ readonly module: "scene";
11
+ readonly version: "latest";
12
+ readonly extensions: readonly ["mtlx"];
13
+ readonly mimeTypes: readonly ["application/xml"];
14
+ readonly text: true;
15
+ readonly dataType: MaterialXDocument;
16
+ readonly batchType: never;
17
+ readonly options: {};
18
+ }>;
19
+ /** Metadata-only loader for MaterialX XML documents. */
20
+ export declare const MaterialXLoader: {
21
+ readonly name: "MaterialX";
22
+ readonly id: "materialx";
23
+ readonly module: "scene";
24
+ readonly version: "latest";
25
+ readonly extensions: readonly ["mtlx"];
26
+ readonly mimeTypes: readonly ["application/xml"];
27
+ readonly text: true;
28
+ readonly dataType: MaterialXDocument;
29
+ readonly batchType: never;
30
+ readonly options: {};
31
+ readonly preload: typeof preload;
32
+ };
33
+ export {};
34
+ //# sourceMappingURL=materialx-loader-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materialx-loader-types.d.ts","sourceRoot":"","sources":["../src/materialx-loader-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,iBAAiB,EAAC,uCAAoC;AAEnE,yDAAyD;AACzD,iBAAe,OAAO;;;;;;;;;;;;uBAcS,iBAAiB;wBAC3B,KAAK;;GAZzB;AAED,wDAAwD;AACxD,eAAO,MAAM,eAAe;;;;;;;;uBAQG,iBAAiB;wBAC3B,KAAK;;;CAGhB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /** Loads the parser-bearing MaterialX implementation. */
2
+ async function preload() {
3
+ const { MaterialXLoaderWithParser } = await import('@loaders.gl/scene/materialx-loader');
4
+ return MaterialXLoaderWithParser;
5
+ }
6
+ /** Metadata-only loader for MaterialX XML documents. */
7
+ export const MaterialXLoader = {
8
+ name: 'MaterialX',
9
+ id: 'materialx',
10
+ module: 'scene',
11
+ version: 'latest',
12
+ extensions: ['mtlx'],
13
+ mimeTypes: ['application/xml'],
14
+ text: true,
15
+ dataType: null,
16
+ batchType: null,
17
+ options: {},
18
+ preload
19
+ };
20
+ //# sourceMappingURL=materialx-loader-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materialx-loader-types.js","sourceRoot":"","sources":["../src/materialx-loader-types.ts"],"names":[],"mappings":"AAIA,yDAAyD;AACzD,KAAK,UAAU,OAAO;IACpB,MAAM,EAAC,yBAAyB,EAAC,GAAG,MAAM,MAAM,CAAC,oCAAoC,CAAC,CAAC;IACvF,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED,wDAAwD;AACxD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,WAAW;IACf,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,iBAAiB,CAAC;IAC9B,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAoC;IAC9C,SAAS,EAAE,IAAa;IACxB,OAAO,EAAE,EAAE;IACX,OAAO;CACC,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/materialx-loader.ts
21
+ var materialx_loader_exports = {};
22
+ __export(materialx_loader_exports, {
23
+ MaterialXLoaderWithParser: () => MaterialXLoaderWithParser
24
+ });
25
+ module.exports = __toCommonJS(materialx_loader_exports);
26
+ var import_materialx_loader_types = require("./materialx-loader-types.cjs");
27
+ var import_parse_materialx = require("./materialx/parse-materialx.cjs");
28
+ var { preload: _preload, ...metadata } = import_materialx_loader_types.MaterialXLoader;
29
+ var MaterialXLoaderWithParser = {
30
+ ...metadata,
31
+ parse: async (data) => (0, import_parse_materialx.parseMaterialX)(new TextDecoder().decode(data)),
32
+ parseSync: (data) => (0, import_parse_materialx.parseMaterialX)(new TextDecoder().decode(data)),
33
+ parseText: async (text) => (0, import_parse_materialx.parseMaterialX)(text),
34
+ parseTextSync: import_parse_materialx.parseMaterialX
35
+ };
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ MaterialXLoaderWithParser
39
+ });
40
+ //# sourceMappingURL=materialx-loader.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/materialx-loader.ts"],
4
+ "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\nimport {MaterialXLoader} from './materialx-loader-types';\nimport {parseMaterialX} from './materialx/parse-materialx';\n\nconst {preload: _preload, ...metadata} = MaterialXLoader;\n\n/** Parser-bearing loader for MaterialX XML, using the native XML parser. */\nexport const MaterialXLoaderWithParser = {\n ...metadata,\n parse: async (data: ArrayBuffer) => parseMaterialX(new TextDecoder().decode(data)),\n parseSync: (data: ArrayBuffer) => parseMaterialX(new TextDecoder().decode(data)),\n parseText: async (text: string) => parseMaterialX(text),\n parseTextSync: parseMaterialX\n} as const;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oCAA8B;AAC9B,6BAA6B;AAE7B,IAAM,EAAC,SAAS,UAAU,GAAG,SAAQ,IAAI;AAGlC,IAAM,4BAA4B;AAAA,EACvC,GAAG;AAAA,EACH,OAAO,OAAO,aAAsB,uCAAe,IAAI,YAAY,EAAE,OAAO,IAAI,CAAC;AAAA,EACjF,WAAW,CAAC,aAAsB,uCAAe,IAAI,YAAY,EAAE,OAAO,IAAI,CAAC;AAAA,EAC/E,WAAW,OAAO,aAAiB,uCAAe,IAAI;AAAA,EACtD,eAAe;AACjB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { parseMaterialX } from "./materialx/parse-materialx.js";
2
+ /** Parser-bearing loader for MaterialX XML, using the native XML parser. */
3
+ export declare const MaterialXLoaderWithParser: {
4
+ readonly parse: (data: ArrayBuffer) => Promise<import(".").MaterialXDocument>;
5
+ readonly parseSync: (data: ArrayBuffer) => import(".").MaterialXDocument;
6
+ readonly parseText: (text: string) => Promise<import(".").MaterialXDocument>;
7
+ readonly parseTextSync: typeof parseMaterialX;
8
+ readonly name: "MaterialX";
9
+ readonly id: "materialx";
10
+ readonly module: "scene";
11
+ readonly version: "latest";
12
+ readonly extensions: readonly ["mtlx"];
13
+ readonly mimeTypes: readonly ["application/xml"];
14
+ readonly text: true;
15
+ readonly dataType: import(".").MaterialXDocument;
16
+ readonly batchType: never;
17
+ readonly options: {};
18
+ };
19
+ //# sourceMappingURL=materialx-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materialx-loader.d.ts","sourceRoot":"","sources":["../src/materialx-loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,EAAC,uCAAoC;AAI3D,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB;2BAEhB,WAAW;+BACb,WAAW;+BACL,MAAM;;;;;;;;;;;;CAEtB,CAAC"}
@@ -0,0 +1,14 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ import { MaterialXLoader } from "./materialx-loader-types.js";
4
+ import { parseMaterialX } from "./materialx/parse-materialx.js";
5
+ const { preload: _preload, ...metadata } = MaterialXLoader;
6
+ /** Parser-bearing loader for MaterialX XML, using the native XML parser. */
7
+ export const MaterialXLoaderWithParser = {
8
+ ...metadata,
9
+ parse: async (data) => parseMaterialX(new TextDecoder().decode(data)),
10
+ parseSync: (data) => parseMaterialX(new TextDecoder().decode(data)),
11
+ parseText: async (text) => parseMaterialX(text),
12
+ parseTextSync: parseMaterialX
13
+ };
14
+ //# sourceMappingURL=materialx-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materialx-loader.js","sourceRoot":"","sources":["../src/materialx-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,OAAO,EAAC,eAAe,EAAC,oCAAiC;AACzD,OAAO,EAAC,cAAc,EAAC,uCAAoC;AAE3D,MAAM,EAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAC,GAAG,eAAe,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,QAAQ;IACX,KAAK,EAAE,KAAK,EAAE,IAAiB,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClF,SAAS,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChF,SAAS,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC;IACvD,aAAa,EAAE,cAAc;CACrB,CAAC"}
@@ -37,7 +37,7 @@ module.exports = __toCommonJS(mtl_loader_types_exports);
37
37
 
38
38
  // src/obj/mtl-loader-types.ts
39
39
  var import_mtl_format = require("./mtl-format.cjs");
40
- var VERSION = true ? "5.0.0-beta.2" : "latest";
40
+ var VERSION = true ? "5.0.0-beta.4" : "latest";
41
41
  async function preload() {
42
42
  const { MTLLoaderWithParser } = await import("@loaders.gl/scene/mtl-loader");
43
43
  return MTLLoaderWithParser;
@@ -35,7 +35,7 @@ __export(mtl_loader_types_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(mtl_loader_types_exports);
37
37
  var import_mtl_format = require("./mtl-format.cjs");
38
- var VERSION = true ? "5.0.0-beta.2" : "latest";
38
+ var VERSION = true ? "5.0.0-beta.4" : "latest";
39
39
  async function preload() {
40
40
  const { MTLLoaderWithParser } = await import("@loaders.gl/scene/mtl-loader");
41
41
  return MTLLoaderWithParser;
@@ -4,7 +4,7 @@
4
4
  import { MTLFormat } from "./mtl-format.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
7
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
8
8
  /**
9
9
  * Preloads the parser-bearing MTL loader implementation.
10
10
  */
@@ -36,7 +36,7 @@ __export(obj_loader_types_exports, {
36
36
  module.exports = __toCommonJS(obj_loader_types_exports);
37
37
  var import_obj_format = require("./obj-format.cjs");
38
38
  var import_arrow_transport = require("@loaders.gl/core/schema-utils/arrow-transport");
39
- var VERSION = true ? "5.0.0-beta.2" : "latest";
39
+ var VERSION = true ? "5.0.0-beta.4" : "latest";
40
40
  async function preload() {
41
41
  const { OBJLoaderWithParser } = await import("@loaders.gl/scene/obj-loader");
42
42
  return OBJLoaderWithParser;
@@ -5,7 +5,7 @@ import { OBJFormat } from "./obj-format.js";
5
5
  import { serializeArrowWorkerTable } from '@loaders.gl/core/schema-utils/arrow-transport';
6
6
  // __VERSION__ is injected by babel-plugin-version-inline
7
7
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
8
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
8
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
9
9
  /**
10
10
  * Preloads the parser-bearing OBJ loader implementation.
11
11
  */
@@ -25,7 +25,7 @@ __export(obj_writer_exports, {
25
25
  module.exports = __toCommonJS(obj_writer_exports);
26
26
  var import_schema_utils = require("@loaders.gl/core/schema-utils");
27
27
  var import_obj_format = require("./obj-format.cjs");
28
- var VERSION = true ? "5.0.0-beta.2" : "latest";
28
+ var VERSION = true ? "5.0.0-beta.4" : "latest";
29
29
  var OBJWriter = {
30
30
  ...import_obj_format.OBJFormat,
31
31
  dataType: null,
@@ -5,7 +5,7 @@ import { convertMeshToTable, convertTableToMesh } from '@loaders.gl/core/schema-
5
5
  import { OBJFormat } from "./obj-format.js";
6
6
  // __VERSION__ is injected by babel-plugin-version-inline
7
7
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
8
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
8
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
9
9
  /**
10
10
  * Writer for the OBJ geometry format.
11
11
  */
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(obj_loader_types_exports);
38
38
  // src/obj/obj-loader-types.ts
39
39
  var import_obj_format = require("./obj-format.cjs");
40
40
  var import_arrow_transport = require("@loaders.gl/core/schema-utils/arrow-transport");
41
- var VERSION = true ? "5.0.0-beta.2" : "latest";
41
+ var VERSION = true ? "5.0.0-beta.4" : "latest";
42
42
  async function preload() {
43
43
  const { OBJLoaderWithParser } = await import("@loaders.gl/scene/obj-loader");
44
44
  return OBJLoaderWithParser;