Files
Igor AherneandClaude Opus 5.5 56d85f6eeb Spellcast3D 0.1.0
A free, open-source Windows app that takes an artist from an idea to game-ready 3D props on their own PC: pictures with Qwen-Image 2.1, 3D models with Pixal3D, an optional repaint of their textures, retopology with TriFlow, LATO.2 or Instant Meshes, and a baker for the final textures. See README.md, and DEVELOPERS.md for building from source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 02:38:33 +01:00

56 lines
2.1 KiB
JavaScript

// Spellcast3D web UI entry point: the header and the shell are drawn at once, then the project opened
// last (or a fresh untitled one) is opened, so the artist can start working without any question.
import { api } from './js/api.js';
import { h } from './js/dom.js';
import { icon } from './js/icons.js';
import { RUNNING, emit, imageTool, on, store } from './js/store.js';
import { loadModels, openLastProject, pollStatusSoon } from './js/actions.js';
import { mountHeader } from './js/shell/header.js';
import { mountCalibrationNotice } from './js/shell/calibration.js';
import { mountShell } from './js/shell/shell.js';
// A file dropped outside a drop zone would make the browser navigate away from the app.
for (const evt of ['dragover', 'drop']) window.addEventListener(evt, (e) => e.preventDefault());
// Forge's model list follows Forge's state, while Forge Neo is the image generator (spellcast3d-config.ini).
on('status', (before) => {
if (imageTool() !== 'forge') return;
const was = before?.tools?.forge?.state;
const now = store.status?.tools?.forge?.state;
if (was === now) return;
if (now === 'ready' || now === 'busy') {
if (store.models.state !== 'ready') loadModels();
} else if (!RUNNING.has(now)) {
store.models = { state: 'offline', data: null, message: '' };
emit('models');
}
});
async function boot() {
const app = document.getElementById('app');
mountHeader(document.getElementById('topbar'));
mountCalibrationNotice(document.getElementById('notices'));
const shell = mountShell(app);
pollStatusSoon(0);
api('GET', '/api/settings').then((s) => { store.settings = s; }).catch(() => {});
try {
await shell;
await openLastProject();
} catch (e) {
console.error(e);
showBootError(app, e);
}
}
function showBootError(app, err) {
app.replaceChildren(h('div', { class: 'boot-error' },
h('div', { class: 'centre-note' },
icon('alert', 'big'),
h('h3', null, 'Spellcast3D could not open your work'),
h('p', null, err.message),
h('button', { class: 'btn primary big', onclick: () => location.reload() }, icon('refresh'), 'Try again'))));
}
boot();