feat: add Cesium semantic inspection mode
This commit is contained in:
@@ -324,6 +324,7 @@ function exportCesium(area) {
|
||||
"--metadata",
|
||||
area.outputs.metadata,
|
||||
], "cesium");
|
||||
const semanticAssets = semanticAssetRecords(area);
|
||||
writeCesiumPreview(area);
|
||||
const finished = Date.now();
|
||||
const digest = glbDigest(area.outputs.glb);
|
||||
@@ -340,6 +341,7 @@ function exportCesium(area) {
|
||||
outputs: {
|
||||
glb: fileRecord(area.outputs.glb),
|
||||
metadata: fileRecord(area.outputs.metadata),
|
||||
semanticAssets,
|
||||
},
|
||||
summary: {
|
||||
glb: glbSummary(digest),
|
||||
@@ -349,6 +351,19 @@ function exportCesium(area) {
|
||||
});
|
||||
}
|
||||
|
||||
function semanticAssetRecords(area) {
|
||||
const metadata = JSON.parse(fs.readFileSync(area.outputs.metadata, "utf8"));
|
||||
const assets = Array.isArray(metadata.assets) ? metadata.assets : [];
|
||||
const records = {};
|
||||
for (const asset of assets) {
|
||||
if (asset.category !== "semantic") continue;
|
||||
const file = path.join(area.outputs.areaDir, asset.url);
|
||||
ensureFile(file, `Cesium semantic asset '${asset.id}'`);
|
||||
records[asset.id] = fileRecord(file);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
function compressCesiumGlb(area) {
|
||||
ensureFile(area.outputs.glb, "Cesium GLB");
|
||||
ensureFile(area.outputs.metadata, "Cesium metadata");
|
||||
|
||||
Reference in New Issue
Block a user