fix(v1.0.3): fix startup window display, single instance lock, relative assets and obj packaging

This commit is contained in:
Michael committed 2026-05-21 19:17:07 +02:00
1 parent 47fb80602f
commit af479df65a
7 files changed
+58 -4

No files matched your search

+11 -3
View File
@@ -13,7 +13,7 @@ interface AvatarModelLoaderProps {
type AvatarManifest = Partial<Record<Exclude<EveAvatar, 'eve'>, string | null>>;
const AVATAR_MANIFEST_PATH = '/avatars/avatar-manifest.json';
const AVATAR_MANIFEST_PATH = './avatars/avatar-manifest.json';
const LoadedGlbAvatar: React.FC<{
path: string;
@@ -81,8 +81,16 @@ export const AvatarModelLoader: React.FC<AvatarModelLoaderProps> = ({ avatarId,
})
.then((manifest) => {
if (cancelled || !manifest) return;
const nextAssetPath = manifest[avatarId];
setAssetPath(typeof nextAssetPath === 'string' && nextAssetPath.trim() ? nextAssetPath : null);
let nextAssetPath = manifest[avatarId];
if (typeof nextAssetPath === 'string' && nextAssetPath.trim()) {
// Si le chemin commence par un slash, on le rend relatif pour fonctionner sous le protocole file:// en production
if (nextAssetPath.startsWith('/')) {
nextAssetPath = '.' + nextAssetPath;
}
setAssetPath(nextAssetPath);
} else {
setAssetPath(null);
}
})
.catch(() => {
if (!cancelled) setAssetPath(null);
+1 -1
View File
@@ -269,7 +269,7 @@ export const EveModel: React.FC<EveModelProps> = ({ emotion, isSpeaking, avatarI
// Charger les matériaux et le modèle OBJ depuis le répertoire public
const materials = useLoader(MTLLoader, './Eve/EVE.mtl');
const obj = useLoader(OBJLoader, './Eve/EVE.obj', (loader) => {
const obj = useLoader(OBJLoader, './Eve/EVE.obj.bin', (loader) => {
materials.preload();
loader.setMaterials(materials);
});