chore: checkpoint web Blender migration source, tools and docs
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer,
web workflow engine and protocol, tooling, docs and task records.
Large generated evidence, user-testing archives, build snapshots and
imported test assets remain untracked.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-10 11:18:01 +08:00
parent 122142c26c
commit f3e21c6b98
6887 changed files with 257154 additions and 12294 deletions

View File

@@ -5,6 +5,16 @@ const GLB_MAGIC = 0x46546c67;
const JSON_CHUNK = 0x4e4f534a;
const BIN_CHUNK = 0x004e4942;
// Keep the importer bounded to the extension surface emitted by our exporter.
// Unknown or decoder-dependent extensions must still fail closed.
const SUPPORTED_EXTENSIONS = new Set([
"KHR_materials_ior",
"KHR_materials_transmission",
"KHR_materials_clearcoat",
"KHR_materials_specular",
"KHR_materials_emissive_strength",
]);
interface GLBAccessor {
bufferView?: number;
byteOffset?: number;
@@ -216,7 +226,10 @@ export function importGLBSemantics(glb: ArrayBuffer): ImportedGLBSemantics {
const view = new DataView(glb);
const jsonLength = view.getUint32(12, true);
const document = jsonChunk(bytes, glb.byteLength);
if ((document.extensionsUsed?.length ?? 0) > 0 || (document.extensionsRequired?.length ?? 0) > 0) throw new Error("GLB_EXTENSION_UNSUPPORTED: extensions are outside the bounded importer");
const extensions = [...(document.extensionsUsed ?? []), ...(document.extensionsRequired ?? [])];
if (extensions.some((extension) => !SUPPORTED_EXTENSIONS.has(extension))) {
throw new Error("GLB_EXTENSION_UNSUPPORTED: extensions are outside the bounded importer");
}
if ((document.buffers ?? []).some((buffer) => buffer.uri !== undefined) || (document.images ?? []).some((image) => image.uri !== undefined)) throw new Error("GLB_EXTERNAL_URI_BLOCKED: external URI resources are not accepted");
const bufferViews = document.bufferViews ?? [];
const accessors = document.accessors ?? [];