auto-git:

[change] src/document/scene-document-validation.ts
This commit is contained in:
2026-04-22 18:06:23 +02:00
parent f611cd2ca5
commit ba1ba6eb87

View File

@@ -1515,26 +1515,50 @@ function validateCameraRigEntity(
) { ) {
validateAuthoredEntityState(entity, path, diagnostics); validateAuthoredEntityState(entity, path, diagnostics);
if (!isFiniteVec3(entity.position)) { if (entity.rigType === "fixed") {
diagnostics.push( if (!isFiniteVec3(entity.position)) {
createDiagnostic( diagnostics.push(
"error", createDiagnostic(
"invalid-camera-rig-position", "error",
"Camera Rig position must remain finite on every axis.", "invalid-camera-rig-position",
`${path}.position` "Camera Rig position must remain finite on every axis.",
) `${path}.position`
); )
} );
}
} else {
if (entity.pathId.trim().length === 0) {
diagnostics.push(
createDiagnostic(
"error",
"invalid-camera-rig-path-id",
"Rail Camera Rig path ids must be non-empty.",
`${path}.pathId`
)
);
} else {
const authoredPath = document.paths[entity.pathId] ?? null;
if (entity.rigType !== "fixed") { if (authoredPath === null) {
diagnostics.push( diagnostics.push(
createDiagnostic( createDiagnostic(
"error", "error",
"invalid-camera-rig-type", "missing-camera-rig-path",
"Camera Rig rigType must be fixed in this slice.", `Rail Camera Rig path ${entity.pathId} does not exist in the scene.`,
`${path}.rigType` `${path}.pathId`
) )
); );
} else if (!authoredPath.enabled) {
diagnostics.push(
createDiagnostic(
"error",
"disabled-camera-rig-path",
"Rail Camera Rigs require an enabled authored path.",
`${path}.pathId`
)
);
}
}
} }
if (!isNonNegativeFiniteNumber(entity.priority)) { if (!isNonNegativeFiniteNumber(entity.priority)) {