@needle-tools/gltf-build-pipeline 2.16.0-next.fc19d36 → 3.0.0-alpha

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 (117) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +41 -2
  3. package/dist/cli/index.js +4154 -232
  4. package/package.json +9 -14
  5. package/tools/pmrem/pkg/pmrem_wasm.d.ts +25 -0
  6. package/tools/pmrem/pkg/pmrem_wasm.js +110 -0
  7. package/tools/pmrem/pkg/pmrem_wasm_bg.wasm +0 -0
  8. package/dist/cache/cache.d.ts +0 -58
  9. package/dist/cache/cache.js +0 -330
  10. package/dist/cache/index.d.ts +0 -2
  11. package/dist/cache/index.js +0 -2
  12. package/dist/cache/job-cache.d.ts +0 -26
  13. package/dist/cache/job-cache.js +0 -84
  14. package/dist/cli/index.d.ts +0 -2
  15. package/dist/config/index.d.ts +0 -53
  16. package/dist/config/index.js +0 -156
  17. package/dist/constants.d.ts +0 -7
  18. package/dist/constants.js +0 -7
  19. package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.d.ts +0 -24
  20. package/dist/extensions/NEEDLE_compression_texture/NEEDLE_compression_texture.js +0 -54
  21. package/dist/extensions/NEEDLE_compression_texture/index.d.ts +0 -1
  22. package/dist/extensions/NEEDLE_compression_texture/index.js +0 -1
  23. package/dist/extensions/NEEDLE_lightmaps/index.d.ts +0 -39
  24. package/dist/extensions/NEEDLE_lightmaps/index.js +0 -257
  25. package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.d.ts +0 -27
  26. package/dist/extensions/NEEDLE_mesh_compression/NEEDLE_mesh_compression.js +0 -88
  27. package/dist/extensions/NEEDLE_mesh_compression/index.d.ts +0 -1
  28. package/dist/extensions/NEEDLE_mesh_compression/index.js +0 -1
  29. package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.d.ts +0 -27
  30. package/dist/extensions/NEEDLE_opaque/NEEDLE_opaque.js +0 -1048
  31. package/dist/extensions/NEEDLE_opaque/index.d.ts +0 -3
  32. package/dist/extensions/NEEDLE_opaque/index.js +0 -30
  33. package/dist/extensions/NEEDLE_pmrem/index.d.ts +0 -21
  34. package/dist/extensions/NEEDLE_pmrem/index.js +0 -95
  35. package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.d.ts +0 -48
  36. package/dist/extensions/NEEDLE_progressive/NEEDLE_progressive.js +0 -69
  37. package/dist/extensions/NEEDLE_progressive/index.d.ts +0 -1
  38. package/dist/extensions/NEEDLE_progressive/index.js +0 -1
  39. package/dist/extensions/NEEDLE_progressive_mesh_settings/index.d.ts +0 -23
  40. package/dist/extensions/NEEDLE_progressive_mesh_settings/index.js +0 -41
  41. package/dist/extensions/NEEDLE_progressive_texture_settings/index.d.ts +0 -25
  42. package/dist/extensions/NEEDLE_progressive_texture_settings/index.js +0 -38
  43. package/dist/extensions/index.d.ts +0 -15
  44. package/dist/extensions/index.js +0 -34
  45. package/dist/extensions/utils.d.ts +0 -9
  46. package/dist/extensions/utils.js +0 -79
  47. package/dist/functions/weld.3.d.ts +0 -76
  48. package/dist/functions/weld.3.js +0 -414
  49. package/dist/index.d.ts +0 -8
  50. package/dist/index.js +0 -8
  51. package/dist/scripts/index.d.ts +0 -2
  52. package/dist/scripts/index.js +0 -2
  53. package/dist/scripts/pack-gltf.d.ts +0 -17
  54. package/dist/scripts/pack-gltf.js +0 -152
  55. package/dist/scripts/stats.d.ts +0 -5
  56. package/dist/scripts/stats.js +0 -20
  57. package/dist/transforms/index.d.ts +0 -9
  58. package/dist/transforms/index.js +0 -9
  59. package/dist/transforms/needle_animation_transform.d.ts +0 -2
  60. package/dist/transforms/needle_animation_transform.js +0 -5
  61. package/dist/transforms/needle_asset.d.ts +0 -3
  62. package/dist/transforms/needle_asset.js +0 -50
  63. package/dist/transforms/needle_common.d.ts +0 -17
  64. package/dist/transforms/needle_common.js +0 -1
  65. package/dist/transforms/needle_mesh_transform.d.ts +0 -15
  66. package/dist/transforms/needle_mesh_transform.js +0 -223
  67. package/dist/transforms/needle_pmrem.d.ts +0 -21
  68. package/dist/transforms/needle_pmrem.js +0 -238
  69. package/dist/transforms/needle_progressive.d.ts +0 -45
  70. package/dist/transforms/needle_progressive.js +0 -1101
  71. package/dist/transforms/needle_texture_transform.d.ts +0 -15
  72. package/dist/transforms/needle_texture_transform.js +0 -267
  73. package/dist/transforms/needle_toktx.d.ts +0 -26
  74. package/dist/transforms/needle_toktx.js +0 -250
  75. package/dist/transforms/needle_webp.d.ts +0 -15
  76. package/dist/transforms/needle_webp.js +0 -53
  77. package/dist/transforms/toktx.d.ts +0 -52
  78. package/dist/transforms/toktx.js +0 -221
  79. package/dist/transforms/toktx_types.d.ts +0 -78
  80. package/dist/transforms/toktx_types.js +0 -62
  81. package/dist/transforms/util.d.ts +0 -21
  82. package/dist/transforms/util.js +0 -90
  83. package/dist/utils/analytics.d.ts +0 -24
  84. package/dist/utils/analytics.js +0 -128
  85. package/dist/utils/compression_utils.d.ts +0 -2
  86. package/dist/utils/compression_utils.js +0 -6
  87. package/dist/utils/fileutils.d.ts +0 -22
  88. package/dist/utils/fileutils.js +0 -195
  89. package/dist/utils/guid.d.ts +0 -1
  90. package/dist/utils/guid.js +0 -5
  91. package/dist/utils/index.d.ts +0 -10
  92. package/dist/utils/index.js +0 -10
  93. package/dist/utils/merge.d.ts +0 -12
  94. package/dist/utils/merge.js +0 -31
  95. package/dist/utils/mesh.d.ts +0 -13
  96. package/dist/utils/mesh.js +0 -124
  97. package/dist/utils/nodeio.d.ts +0 -11
  98. package/dist/utils/nodeio.js +0 -116
  99. package/dist/utils/stats.d.ts +0 -70
  100. package/dist/utils/stats.js +0 -265
  101. package/dist/utils/test-assert.d.ts +0 -8
  102. package/dist/utils/test-assert.js +0 -18
  103. package/dist/utils/texture.d.ts +0 -5
  104. package/dist/utils/texture.js +0 -14
  105. package/dist/utils/validate.d.ts +0 -6
  106. package/dist/utils/validate.js +0 -17
  107. package/dist/utils/version.d.ts +0 -1
  108. package/dist/utils/version.gen.d.ts +0 -1
  109. package/dist/utils/version.gen.js +0 -1
  110. package/dist/utils/version.js +0 -4
  111. package/scripts/clear-caches.mjs +0 -4
  112. package/scripts/defaults.mjs +0 -12
  113. package/scripts/fileutils.mjs +0 -6
  114. package/scripts/index.mjs +0 -41
  115. package/scripts/limit-caches.mjs +0 -4
  116. package/scripts/make-progressive.mjs +0 -16
  117. package/scripts/pack-gltf.mjs +0 -107
@@ -1,84 +0,0 @@
1
- // TODO: avoid storing LOD files twice in cache. Currently LODs are stored by the per-asset cache
2
- // (e.g. "image-{hash}", "packed-{hash}") AND again by the job cache ("job-{key}-fN").
3
- // Instead, progressive_results should carry { path, cacheKey? } so the job manifest can reference
4
- // existing per-asset cache keys for LODs and only store the main GLB under a job-specific key.
5
- // This requires threading cache key collection through make_progressive and packGLTF.
6
- import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
7
- import path from 'path';
8
- import { addMetaToCache, addToCache, tryGetFromCache, tryGetMetaFromCache, hashBuffer, hashString } from './cache.js';
9
- /**
10
- * Compute a job cache key from pipeline options and input file content.
11
- * The key uniquely identifies a specific input + configuration combination.
12
- * Currently only supports .glb files (hashes the full file content).
13
- * @returns The job key string, or null if the file format is not supported.
14
- */
15
- // TODO: add support for .gltf files (need to hash referenced .bin files as well)
16
- export function computeJobKey(options, inputFilePath) {
17
- if (!inputFilePath.endsWith('.glb'))
18
- return null;
19
- const fileBytes = readFileSync(inputFilePath);
20
- const fileHash = hashBuffer(fileBytes.buffer, fileBytes.byteOffset, fileBytes.byteLength);
21
- const optionsStr = JSON.stringify({
22
- compress: options.compress,
23
- progressive: options.progressive,
24
- config: options.config,
25
- });
26
- const optionsHash = hashString(optionsStr);
27
- return `job-${optionsHash}-${fileHash}`;
28
- }
29
- /**
30
- * Save the result of a completed job to the cache.
31
- * Stores the content of each output file and a manifest linking them.
32
- */
33
- export function saveJobResult(jobKey, outputFiles, logger) {
34
- const entries = [];
35
- for (let i = 0; i < outputFiles.length; i++) {
36
- const filePath = outputFiles[i];
37
- if (!existsSync(filePath))
38
- continue;
39
- const cacheKey = `${jobKey}-f${i}`;
40
- const content = readFileSync(filePath);
41
- addToCache(cacheKey, content);
42
- entries.push({
43
- fileName: path.basename(filePath),
44
- cacheKey,
45
- });
46
- }
47
- if (entries.length === 0)
48
- return;
49
- const manifest = { entries };
50
- addMetaToCache(jobKey, manifest);
51
- logger.debug(`[Job Cache] Saved ${entries.length} file(s) for job ${jobKey}`);
52
- }
53
- /**
54
- * Try to restore a previously cached job result.
55
- * Loads all cached files into memory first, then writes them only if all are available.
56
- * Returns the list of restored file paths, or null if the cache is incomplete.
57
- */
58
- export function tryRestoreJobResult(jobKey, outputDir, logger) {
59
- const manifest = tryGetMetaFromCache(jobKey);
60
- if (!manifest?.entries?.length)
61
- return null;
62
- // Load all entries into memory — fail fast if any are missing
63
- const loaded = [];
64
- for (const entry of manifest.entries) {
65
- const cached = tryGetFromCache(entry.cacheKey);
66
- if (!cached) {
67
- logger.debug(`[Job Cache] Cache miss: missing entry ${entry.cacheKey}`);
68
- return null;
69
- }
70
- loaded.push({ entry, data: cached });
71
- }
72
- // All entries present — write to output directory
73
- if (!existsSync(outputDir)) {
74
- mkdirSync(outputDir, { recursive: true });
75
- }
76
- const restoredPaths = [];
77
- for (const { entry, data } of loaded) {
78
- const outPath = path.join(outputDir, entry.fileName);
79
- writeFileSync(outPath, data);
80
- restoredPaths.push(outPath);
81
- }
82
- logger.info(`[Job Cache] Restored ${restoredPaths.length} file(s) from cache`);
83
- return restoredPaths;
84
- }
@@ -1,2 +0,0 @@
1
- #! /usr/bin/env node
2
- export {};
@@ -1,53 +0,0 @@
1
- import { ILogger } from "@gltf-transform/core";
2
- declare type Usecase = "default" | "product" | "world";
3
- export declare const UsecaseOptions: string[];
4
- /**
5
- * The config object contains information about how a file should be processed.
6
- */
7
- export type Config = {
8
- /** High-level configuration */
9
- usecase: Usecase;
10
- textures?: {
11
- lods: boolean;
12
- };
13
- meshes?: {
14
- lods: boolean;
15
- };
16
- };
17
- /**
18
- * Create a config object with the given usecase.
19
- */
20
- export declare function createConfig(usecase: string): {
21
- usecase: Usecase;
22
- };
23
- /**
24
- * Get the config object either provided by a CLI path or a needle.config.json file in the parent directory.
25
- *
26
- * @example CLI argument where the path points to a json file containing the config as `Config`
27
- * ```sh
28
- * node script.js --config path/to/my-optimization-config.json
29
- * ```
30
- *
31
- * @example needle.config.json - the usecase can be provided as a string
32
- * ```json
33
- * {
34
- * "optimization": "product"
35
- * }
36
- * ```
37
- *
38
- * @example needle.config.json - the whole config object can be provided
39
- * ```json
40
- * {
41
- * "optimization": {
42
- * "usecase": "product"
43
- * }
44
- * }
45
- * ```
46
- *
47
- *
48
- */
49
- export declare function getConfig(configPath?: string, fallbackSearchDirectory?: string, opts?: {
50
- logger: ILogger;
51
- }): Config;
52
- export declare function searchConfig(directory: string, logger: ILogger): Config | null;
53
- export {};
@@ -1,156 +0,0 @@
1
- import { Logger, Verbosity } from "@gltf-transform/core";
2
- import { existsSync, readFileSync, statSync } from "fs";
3
- import path, { dirname, resolve } from "path";
4
- export const UsecaseOptions = ["product", "world"];
5
- const defaultConfig = {
6
- usecase: "default",
7
- };
8
- /**
9
- * Create a config object with the given usecase.
10
- */
11
- export function createConfig(usecase) {
12
- if (!UsecaseOptions.includes(usecase)) {
13
- throw new Error(`Invalid usecase: \"${usecase}\". Valid usecases: ${UsecaseOptions.join(", ")}`);
14
- }
15
- return {
16
- usecase: usecase
17
- };
18
- }
19
- /**
20
- * Get the config object either provided by a CLI path or a needle.config.json file in the parent directory.
21
- *
22
- * @example CLI argument where the path points to a json file containing the config as `Config`
23
- * ```sh
24
- * node script.js --config path/to/my-optimization-config.json
25
- * ```
26
- *
27
- * @example needle.config.json - the usecase can be provided as a string
28
- * ```json
29
- * {
30
- * "optimization": "product"
31
- * }
32
- * ```
33
- *
34
- * @example needle.config.json - the whole config object can be provided
35
- * ```json
36
- * {
37
- * "optimization": {
38
- * "usecase": "product"
39
- * }
40
- * }
41
- * ```
42
- *
43
- *
44
- */
45
- export function getConfig(configPath, fallbackSearchDirectory, opts) {
46
- let logger = opts?.logger;
47
- if (!logger) {
48
- logger = new Logger(Verbosity.WARN);
49
- }
50
- if (configPath != null) {
51
- configPath = resolve(process.cwd(), configPath);
52
- if (!existsSync(configPath)) {
53
- throw new Error(`No config found at \"${configPath}\"`);
54
- }
55
- const isDirectory = statSync(configPath).isDirectory();
56
- if (isDirectory) {
57
- const res = searchConfig(configPath, logger);
58
- if (res) {
59
- return res;
60
- }
61
- else {
62
- throw new Error(`No config found in directory \"${configPath}\"`);
63
- }
64
- }
65
- const res = resolveConfig(configPath, readFileSync(configPath, "utf8"), logger);
66
- if (res) {
67
- return res;
68
- }
69
- else {
70
- throw new Error(`Failed parsing config at \"${configPath}\"`);
71
- }
72
- }
73
- if (_cachedConfig !== undefined) {
74
- return _cachedConfig;
75
- }
76
- // Resolve the config once and cache it
77
- // Check if a needle.config.json exists in the directory from which the script is run (or any parent directory)
78
- if (fallbackSearchDirectory) {
79
- const result = searchConfig(fallbackSearchDirectory, logger);
80
- if (result) {
81
- _cachedConfig = { ...defaultConfig, ...result };
82
- logger.info(`Using config with usecase: ${_cachedConfig.usecase}`);
83
- }
84
- }
85
- // If no config was found, use the default config
86
- if (!_cachedConfig) {
87
- logger.debug("No config found. Using default config.");
88
- _cachedConfig = defaultConfig;
89
- }
90
- return _cachedConfig;
91
- }
92
- let _cachedConfig = undefined;
93
- export function searchConfig(directory, logger) {
94
- if (statSync(directory).isFile()) {
95
- directory = dirname(directory);
96
- }
97
- directory = directory.replaceAll("\\", "/");
98
- while (directory.length > 0) {
99
- const configPath = path.join(directory, "needle.config.json");
100
- if (existsSync(configPath)) {
101
- const content = readFileSync(configPath, "utf8");
102
- const config = resolveConfig(configPath, content, logger);
103
- if (config) {
104
- return config;
105
- }
106
- }
107
- const lastSlash = directory.lastIndexOf("/");
108
- if (lastSlash < 0) {
109
- break;
110
- }
111
- directory = directory.slice(0, lastSlash);
112
- }
113
- return null;
114
- }
115
- const loggedConfigPaths = new Set();
116
- function resolveConfig(filename, content, logger) {
117
- // Handle config being part of `needle.config.json`
118
- if (filename.endsWith("needle.config.json")) {
119
- try {
120
- const config = JSON.parse(content);
121
- if (config.gltf) {
122
- logger.info(`Found \"gltf\" config at \"${filename.replaceAll("\\", "/")}\".`);
123
- // If the optimization config is a string, it's the usecase
124
- if (typeof config.gltf === "string") {
125
- return createConfig(config.gltf);
126
- }
127
- return config.gltf;
128
- }
129
- else {
130
- if (!loggedConfigPaths.has(filename)) {
131
- logger.debug(`No \"gltf\" config found in needle.config.json at \"${filename.replaceAll("\\", "/")}\". You may add a \"gltf\" field to the config with the optimization config. Example: { \"gltf\": { \"usecase\": \"product\" } }. Using default config for glTF optimization now.`);
132
- loggedConfigPaths.add(filename);
133
- }
134
- return null;
135
- }
136
- }
137
- catch (err) {
138
- logger.error(`Failed parsing config \"${err.message}\" at ${filename.replaceAll("\\", "/")}`);
139
- }
140
- }
141
- // Handle config being the content of the file
142
- else if (content.trimStart().startsWith("{")) {
143
- try {
144
- return JSON.parse(content);
145
- }
146
- catch (err) {
147
- if (err instanceof Error)
148
- logger.error(`Failed parsing config \"${err.message}\" at ${filename.replaceAll("\\", "/")}`);
149
- else
150
- logger.error(`Failed parsing config \"${err}\" at ${filename.replaceAll("\\", "/")}`);
151
- }
152
- }
153
- else {
154
- logger.error("Invalid config file format. Expected JSON object at " + filename.replaceAll("\\", "/"));
155
- }
156
- }
@@ -1,7 +0,0 @@
1
- export declare const ERROR_CODES: {
2
- UNKNOWN_ERROR: number;
3
- PACKING_FAILED: number;
4
- PROGRESSIVE_FAILED: number;
5
- INVALID_ARGS: number;
6
- LOST_FILE: number;
7
- };
package/dist/constants.js DELETED
@@ -1,7 +0,0 @@
1
- export const ERROR_CODES = {
2
- UNKNOWN_ERROR: 1,
3
- PACKING_FAILED: 2,
4
- PROGRESSIVE_FAILED: 3,
5
- INVALID_ARGS: 4,
6
- LOST_FILE: 5,
7
- };
@@ -1,24 +0,0 @@
1
- import { Extension, ExtensionProperty, PropertyType, ReaderContext, WriterContext } from "@gltf-transform/core";
2
- export declare const EXTENSION_NAME = "NEEDLE_compression_texture";
3
- export declare interface NEEDLE_compression_texture_schema {
4
- mode: "none" | "auto" | "webp" | "UASTC" | "ETC1S" | "world" | "product";
5
- slot: string;
6
- /** quality in range of 0 - 1 */
7
- quality: number;
8
- maxSize: number;
9
- }
10
- export declare class NEEDLE_compression_texture extends Extension {
11
- static EXTENSION_NAME: string;
12
- extensionName: string;
13
- create(toktxInfo: NEEDLE_compression_texture_schema): NEEDLE_compression_texture_property;
14
- read(context: ReaderContext): this;
15
- write(context: WriterContext): this;
16
- }
17
- export declare class NEEDLE_compression_texture_property extends ExtensionProperty {
18
- static EXTENSION_NAME: string;
19
- extensionName: string;
20
- parentTypes: PropertyType[];
21
- propertyType: any;
22
- init(): void;
23
- model: NEEDLE_compression_texture_schema;
24
- }
@@ -1,54 +0,0 @@
1
- import { Extension, ExtensionProperty, PropertyType } from "@gltf-transform/core";
2
- import { getTextureDefinition } from "../utils.js";
3
- export const EXTENSION_NAME = "NEEDLE_compression_texture";
4
- const debugLog = false;
5
- export class NEEDLE_compression_texture extends Extension {
6
- static EXTENSION_NAME = EXTENSION_NAME;
7
- extensionName = EXTENSION_NAME;
8
- create(toktxInfo) {
9
- const ext = new NEEDLE_compression_texture_property(this.document.getGraph(), "");
10
- ext.model = toktxInfo;
11
- return ext;
12
- }
13
- read(context) {
14
- if (debugLog)
15
- console.log("READ " + EXTENSION_NAME);
16
- if (!context.jsonDoc.json.textures)
17
- return this;
18
- context.textures?.forEach((tex, _) => {
19
- const textureDefinition = getTextureDefinition(context, tex);
20
- if (textureDefinition?.extensions && textureDefinition.extensions[EXTENSION_NAME]) {
21
- const prop = new NEEDLE_compression_texture_property(this.document.getGraph(), EXTENSION_NAME);
22
- prop.model = textureDefinition.extensions[EXTENSION_NAME];
23
- tex.setExtension(EXTENSION_NAME, prop);
24
- }
25
- });
26
- return this;
27
- }
28
- write(context) {
29
- if (debugLog)
30
- console.log("WRITE " + EXTENSION_NAME);
31
- const root = this.document.getRoot();
32
- const textures = root.listTextures();
33
- for (const tex of textures) {
34
- const ext = tex.getExtension(EXTENSION_NAME);
35
- if (ext) {
36
- const def = getTextureDefinition(context, tex);
37
- if (def) {
38
- def.extensions = def.extensions || {};
39
- def.extensions[EXTENSION_NAME] = ext.model;
40
- }
41
- }
42
- }
43
- return this;
44
- }
45
- }
46
- export class NEEDLE_compression_texture_property extends ExtensionProperty {
47
- static EXTENSION_NAME = EXTENSION_NAME;
48
- init() {
49
- this.extensionName = EXTENSION_NAME;
50
- this.parentTypes = [PropertyType.TEXTURE];
51
- this.propertyType = EXTENSION_NAME;
52
- }
53
- model;
54
- }
@@ -1 +0,0 @@
1
- export * from "./NEEDLE_compression_texture.js";
@@ -1 +0,0 @@
1
- export * from "./NEEDLE_compression_texture.js";
@@ -1,39 +0,0 @@
1
- import { Extension, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core';
2
- /**
3
- * NEEDLE_lightmaps gltf-transform extension.
4
- *
5
- * Handles both embedded (`/textures/N` pointer) and external (`sunrise.exr` pointer) lightmaps.
6
- *
7
- * - **preread(TEXTURE)**: Injects external EXR files into the JSON document so the core reader
8
- * creates proper Texture objects from them.
9
- * - **read()**: Resolves `/textures/N` pointers to Texture objects. Sets references so that
10
- * gltf-transform doesn't prune/dedup referenced textures.
11
- * - **write()**: Updates pointer strings:
12
- * - Embedded textures: resolves to the new `/textures/N` index in the output.
13
- * - External textures: uses the Texture's current URI (e.g. updated by PMREM to `.pmrem.ktx2`).
14
- */
15
- export declare class NEEDLE_lightmaps_ext extends Extension {
16
- static readonly EXTENSION_NAME = "NEEDLE_lightmaps";
17
- readonly extensionName = "NEEDLE_lightmaps";
18
- readonly prereadTypes: PropertyType[];
19
- readonly prewriteTypes: PropertyType[];
20
- /** The raw extension JSON from the input (mutated in-place during write) */
21
- private extensionData;
22
- /** Entries with resolved Texture references */
23
- private resolved;
24
- /** Image indices injected during preread (for external EXR files) */
25
- private injectedImageIndices;
26
- /** The ExtensionProperty that holds references to prevent dedup/prune */
27
- private lightmapProp;
28
- preread(context: ReaderContext, _propertyType: PropertyType): this;
29
- read(context: ReaderContext): this;
30
- prewrite(context: WriterContext, _propertyType: PropertyType): this;
31
- write(context: WriterContext): this;
32
- private pointersResolved;
33
- private resolvePointers;
34
- /**
35
- * Find (or create) a texture def in the output JSON that references the given Texture.
36
- * This replicates the logic from the opaque system's TextureIndexResolver.
37
- */
38
- private findOrCreateTextureIndex;
39
- }