chore: checkpoint web Blender migration source, tools and docs
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:
@@ -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 ?? [];
|
||||
|
||||
Reference in New Issue
Block a user