auto-git:

[change] src/document/scene-document-validation.ts
This commit is contained in:
2026-05-02 03:46:33 +02:00
parent 92107465aa
commit e559174bd9

View File

@@ -6976,6 +6976,26 @@ function validateProjectResources(
validateProjectAsset(asset, path, diagnostics); validateProjectAsset(asset, path, diagnostics);
} }
for (const [prototypeKey, prototype] of Object.entries(
document.foliagePrototypes
)) {
const path = `foliagePrototypes.${prototypeKey}`;
if (prototype.id !== prototypeKey) {
diagnostics.push(
createDiagnostic(
"error",
"foliage-prototype-id-mismatch",
"Foliage prototype ids must match their registry key.",
`${path}.id`
)
);
}
registerAuthoredId(prototype.id, path, seenIds, diagnostics);
validateFoliagePrototype(prototype, path, document, diagnostics);
}
for (const [sequenceKey, sequence] of Object.entries( for (const [sequenceKey, sequence] of Object.entries(
document.sequences.sequences document.sequences.sequences
)) { )) {
@@ -7737,6 +7757,24 @@ export function validateSceneDocument(
validateTerrain(terrain, path, document, diagnostics, options); validateTerrain(terrain, path, document, diagnostics, options);
} }
for (const [layerKey, layer] of Object.entries(document.foliageLayers)) {
const path = `foliageLayers.${layerKey}`;
if (layer.id !== layerKey) {
diagnostics.push(
createDiagnostic(
"error",
"foliage-layer-id-mismatch",
"Foliage layer ids must match their registry key.",
`${path}.id`
)
);
}
registerAuthoredId(layer.id, path, seenIds, diagnostics);
validateFoliageLayer(layer, path, document, diagnostics);
}
for (const [modelInstanceKey, modelInstance] of Object.entries( for (const [modelInstanceKey, modelInstance] of Object.entries(
document.modelInstances document.modelInstances
)) { )) {