fix: support gltf uploads with local preview

This commit is contained in:
Tom Boullay
2026-04-27 11:07:16 +02:00
parent 078e687e86
commit 4c3a687ff8
19 changed files with 136 additions and 98 deletions
+11 -4
View File
@@ -60,6 +60,12 @@ export default function UploadZone() {
})
const handleFolderSelected = (entry: FolderEntry) => {
entries.forEach((current) => {
const urls = new Set<string>()
if (current.modelUrl) urls.add(current.modelUrl)
Object.values(current.assetUrls || {}).forEach((url) => urls.add(url))
urls.forEach((url) => URL.revokeObjectURL(url))
})
setGlobalError(null)
setEntries([entry])
}
@@ -78,12 +84,13 @@ export default function UploadZone() {
{entries.length === 0 && (
<p className="rounded-2xl border border-white/20 bg-black-800 px-4 py-3 text-xs text-gray-400 leading-relaxed text-center mb-3">
Deposez un dossier complet contenant votre modele 3D nomme
{' '}<span className="font-mono text-gray-200">model.glb</span>
{' '}ainsi que toutes les textures necessaires.
{' '}Les textures peuvent etre en
{' '}<span className="font-mono text-gray-200">model.gltf</span>
{' '}ainsi que toutes les textures et fichiers binaires necessaires.
{' '}Les fichiers associes peuvent etre en
{' '}<span className="font-mono text-gray-200">.png</span>,
{' '}<span className="font-mono text-gray-200">.jpg</span>
{' '}ou <span className="font-mono text-gray-200">.webp</span>.
{' '}<span className="font-mono text-gray-200">.webp</span>
{' '}ou <span className="font-mono text-gray-200">.bin</span>.
{' '}Utilisez un nom simple si la texture s&apos;applique au modele entier, et un nom detaille si elle correspond a une partie precise du modele,
{' '}par exemple <span className="font-mono text-gray-200">color_porte.jpg</span>,
{' '}<span className="font-mono text-gray-200">roughness_tuyaux.png</span>,