Removed Export to Blender -> use GLB instead

This commit is contained in:
Bruno Fargnoli 2026-07-15 21:03:57 +02:00
parent 6a1fd7cb5b
commit 9510618348
2 changed files with 14 additions and 11 deletions

View file

@ -69,15 +69,17 @@ export default function ExportMeshDialog({ getObject3D, meshUrl, defaultName = '
let files
let convertNote = ''
if (selectedFormat.kind !== 'preset') {
if (selectedFormat.value === 'glb') {
// Byte-passthrough when the source is a .glb (rig/animations/textures
// untouched); three.js re-export otherwise.
setProgress({ frac: 0.2, message: 'Preparing GLB…' })
files = [{ filename: `${base}.glb`, blob: await getSourceGlbBlob(base) }]
} else if (selectedFormat.kind !== 'preset') {
const object = getObject3D ? await getObject3D() : await loadObject3DFromUrl(meshUrl)
if (!object) {
throw new Error('No mesh is available to export.')
}
files = await exportObject3D(object, { format: selectedFormat.value, baseName: base })
} else if (selectedFormat.value === 'blender') {
setProgress({ frac: 0.2, message: 'Preparing GLB…' })
files = [{ filename: `${base}.glb`, blob: await getSourceGlbBlob(base) }]
} else {
setProgress({ frac: 0.05, message: 'Preparing source GLB…' })
const glbBlob = await getSourceGlbBlob(base)

View file

@ -10,18 +10,19 @@ import { PLYExporter } from 'three/examples/jsm/exporters/PLYExporter.js'
import { STLExporter } from 'three/examples/jsm/exporters/STLExporter.js'
import { API_BASE } from '../config'
// kind 'local' — serialized in the browser with three.js exporters.
// kind 'preset' — engine-targeted exports (Blender/Unity/Unreal). FBX has no
// three.js exporter, so those go through the mesh-tools service, which runs
// kind 'local' — serialized in the browser with three.js exporters. GLB is
// special-cased by the export dialog: a .glb source asset is copied
// byte-for-byte (rig, animations and textures untouched) instead of being
// round-tripped through three.js; it imports natively into Blender.
// kind 'preset' — engine-targeted FBX exports (Unity/Unreal/generic). FBX has
// no three.js exporter, so those go through the mesh-tools service, which runs
// headless Blender to convert a GLB into an engine-tuned FBX (skeleton + one
// animation take per clip). Presets are only offered when exporting from a
// mesh URL (asset library preview) — the mesh editor exports raw geometry.
export const EXPORT_FORMATS = [
{ value: 'glb', label: 'GLB — single file, textures embedded', extension: 'glb', multiFile: false, kind: 'local' },
{
value: 'blender', label: 'Blender — GLB (rig + animations)', extension: 'glb', multiFile: false,
kind: 'preset', preset: 'blender', requiresService: false,
hint: 'Blender imports GLB natively (File > Import > glTF 2.0) with the skeleton and every animation clip. GLB source assets are copied byte-for-byte for perfect fidelity. Note: Blender’s importer may add an "Icosphere" bone-widget object — it is viewport dressing created at import time, not part of the file (set Bone Dir to "Temperance" to avoid it).'
value: 'glb', label: 'GLB — single file, textures embedded', extension: 'glb', multiFile: false, kind: 'local',
hint: 'Includes the rig and every animation clip; GLB source assets are copied byte-for-byte for perfect fidelity. Imports natively into Blender (File > Import > glTF 2.0). Note: Blender’s importer may add an "Icosphere" bone-widget object — viewport dressing created at import time, not part of the file (set Bone Dir to "Temperance" to avoid it).'
},
{
value: 'unity', label: 'Unity — FBX (rig + animation takes)', extension: 'fbx', multiFile: false,