Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

4.1 KB
Raw Blame
---
import GalleryTags from "../../../components/GalleryTags.astro";
import { readFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import BaseLayout from '../../../layouts/BaseLayout.astro';
import PageHeader from '../../../components/PageHeader.astro';
import AssetViewer from '../../../components/AssetViewer.astro';
import AssetDownloads from '../../../components/AssetDownloads.astro';
import CodeBlock from '../../../components/CodeBlock.astro';
import StatRow from '../../../components/StatRow.astro';
import EngineNote from '../../../components/EngineNote.astro';
import { bounds, number } from '../../../lib/catalog';
import { PACKS_ENABLED } from '../../../lib/config';
import { cabinWoodsAssets, cabinWoodsHref, type CabinWoodsAsset } from '../../../lib/cabin-woods';

export function getStaticPaths() {
  return PACKS_ENABLED ? cabinWoodsAssets.map(asset => ({ params: { slug: asset.slug }, props: { asset } })) : [];
}
interface Props { asset: CabinWoodsAsset; }
const { asset } = Astro.props;
const source = await readFile(resolve('../packs/cabin-woods-psx-horror/sources', asset.collection, asset.assetId, asset.revisionId, 'source.kiln.js'), 'utf8');
---
<BaseLayout title={`${asset.name} · Kiln`} description={`${asset.name}: GLB, editable Kiln source and material resources from the Cabin in the Woods: PSX Horror pack.`} breadcrumbs={[{label:'Gallery',href:'/gallery/'},{label:asset.name,href:cabinWoodsHref(asset)}]} card="packs">
  <div class="container py-8">
    <PageHeader>{asset.name}</PageHeader>
    <GalleryTags />
    <p class="lead mt-4">{asset.description}</p>
    <a class="text-link mt-4" href="/packs/cabin-woods-psx-horror/">Cabin in the Woods: PSX Horror pack</a>
    <div class="drawing-sheet mt-8"><AssetViewer name={asset.name} modelUrl={asset.modelPath} poster={asset.poster.src} posterAlt={asset.poster.alt} posterWidth={asset.poster.width} posterHeight={asset.poster.height} /></div>
    <EngineNote extensions={asset.metrics.extensions} />
    <StatRow values={[{label:'Triangles',value:number(asset.metrics.triangles)},{label:'Meshes',value:asset.metrics.meshes},{label:'Materials',value:asset.metrics.materials},{label:'Dimensions (m)',value:bounds(asset.metrics.bounds)}]} />
    <AssetDownloads runtime={asset.runtimeDownload} editable={asset.editableDownload} editableLabel="Full Kiln assets (remixable)" />
    <p class="mt-3 text-sm text-dim">Runtime includes the GLB and metadata sidecar. The editable ZIP contains this selected revision and its complete material closure. Parent revision identifiers are retained; earlier authoring history is deliberately not distributed in this initial pack.</p>
    <p class="mt-3">Import this ZIP into Kiln’s Library, or run <code>node kiln.mjs import asset.zip</code> in an authoring workspace. The full model, exact source, editing metadata, preview and material resources are included so you can reopen and remix it.</p>
    <p class="mt-3 text-sm text-dim">Use an importing Kiln build that supports the included material schemas. Use Kiln 1.2.3 or later.</p>
    <div class="mt-5 flex flex-wrap gap-5"><a class="text-link" href={asset.runtimeModelDownload.url}>Runtime GLB</a><a class="text-link" href={asset.metadataDownload.url}>Runtime metadata</a><a class="text-link" href={asset.canonicalDownload.url}>Full metadata GLB</a><a class="text-link" href={asset.manifestDownload.url}>Saved manifest</a><a class="text-link" href={asset.sourcePath}>Exact source file</a><a class="text-link" href="/scenes/cabin-woods-psx-horror/">Open scene preview</a></div>
    <dl class="mt-8 grid gap-4 text-sm"><div><dt>Collection / asset / revision</dt><dd class="break-all font-mono">{asset.collection} / {asset.assetId} / {asset.revisionId}</dd></div><div><dt>Source SHA-256</dt><dd class="break-all font-mono">{asset.sourceSha256}</dd></div></dl>
    {asset.metrics.clips.length > 0 && <p class="mt-4">Native clips: {asset.metrics.clips.join(', ')}.</p>}
    <div class="mt-8"><CodeBlock code={source} label={`${asset.name}: exact saved source`} /></div>
    <p class="mt-5 text-sm text-dim">Asset content follows the supplied CC0-1.0 licence record. Kiln and scene software retain their own licences.</p>
  </div>
</BaseLayout>