MCPcopy Create free account
hub / github.com/Crain99/cc-reverse / writeMeta

Function writeMeta

src/core/cocos3x/engine3x.js:633–650  ·  view source on GitHub ↗
(outBase, uuid, className, wasCcon, packRef)

Source from the content-addressed store, hash-verified

631 if (r) return r;
632 }
633 return null;
634 }
635 for (const k of Object.keys(obj)) {
636 const r = visit(obj[k], depth + 1);
637 if (r) return r;
638 }
639 return null;
640 };
641 return visit(doc, 0);
642}
643
644async function decodeCconToDoc(buf, outBase) {
645 const decoded = decodeCcon(buf);
646 // Both v1 (JSON) and v2 (notepack) yield a `document` when decodable.
647 if (decoded.document) {
648 // Persist chunks alongside the JSON so mesh/animation payloads are not lost.
649 for (let i = 0; i < decoded.chunks.length; i += 1) {
650 await writeFile(`${outBase}.chunk${i}.bin`, decoded.chunks[i]);
651 }
652 return decoded.document;
653 }

Callers 1

unpackAssetFunction · 0.85

Calls 3

inferMetaExtFunction · 0.85
classToImporterFunction · 0.85
writeFileFunction · 0.50

Tested by

no test coverage detected