Add panorama previews and repair beta export rendering
This commit is contained in:
@@ -38,6 +38,14 @@ export const datasetSchema = z
|
||||
)
|
||||
.min(5)
|
||||
.max(100),
|
||||
// Retain the capture's locations while viewpoints holds the saved selection.
|
||||
availableViewpoints: z
|
||||
.array(
|
||||
pointSchema.extend({ id: z.string().regex(/^[a-zA-Z0-9_-]{1,64}$/) }),
|
||||
)
|
||||
.min(5)
|
||||
.max(100)
|
||||
.optional(),
|
||||
assets: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -62,7 +70,7 @@ export const datasetSchema = z
|
||||
? ["terrain.json.gz"]
|
||||
: [
|
||||
"map.png",
|
||||
...d.viewpoints.flatMap((point) =>
|
||||
...(d.availableViewpoints ?? d.viewpoints).flatMap((point) =>
|
||||
faces.map((face) => `${point.id}/${face}.png`),
|
||||
),
|
||||
];
|
||||
@@ -75,9 +83,20 @@ export const datasetSchema = z
|
||||
}
|
||||
if (new Set(d.viewpoints.map((p) => p.id)).size !== d.viewpoints.length)
|
||||
ctx.addIssue({ code: "custom", message: "Viewpoint IDs must be unique" });
|
||||
if (d.availableViewpoints) {
|
||||
const ids = new Set(d.availableViewpoints.map((p) => p.id));
|
||||
if (
|
||||
ids.size !== d.availableViewpoints.length ||
|
||||
d.viewpoints.some((p) => !ids.has(p.id))
|
||||
)
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
message: "Selection must use unique captured locations",
|
||||
});
|
||||
}
|
||||
if (new Set(d.assets.map((a) => a.path)).size !== d.assets.length)
|
||||
ctx.addIssue({ code: "custom", message: "Asset paths must be unique" });
|
||||
for (const p of d.viewpoints)
|
||||
for (const p of [...d.viewpoints, ...(d.availableViewpoints ?? [])])
|
||||
if (
|
||||
p.x < d.bounds.minX ||
|
||||
p.x > d.bounds.maxX ||
|
||||
|
||||
Reference in New Issue
Block a user