2023-10-31 08:33:53 +08:00
|
|
|
const fs = require('fs');
|
|
|
|
|
const fg = require('fast-glob');
|
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
|
|
const ROOT = path.join(__dirname, './../public');
|
|
|
|
|
|
2023-11-02 04:31:20 +08:00
|
|
|
const bgImages = fg.globSync(ROOT+"/bg/**/bg-*.jpg", {dot: true}).map((p) => p.split(ROOT)[1]);
|
|
|
|
|
const vrmList = fg.globSync(ROOT+"/vrm/**/*.vrm", {dot: true}).map((p) => p.split(ROOT)[1]);
|
|
|
|
|
const speechT5SpeakerEmbeddingsList = fg.globSync(ROOT+"/speecht5_speaker_embeddings/**/*.bin", {dot: true}).map((p) => p.split(ROOT)[1]);
|
2023-11-30 18:30:11 +02:00
|
|
|
const animationList = [].concat(
|
|
|
|
|
fg.globSync(ROOT+"/animations/**/*.vrma", {dot: true}).map((p) => p.split(ROOT)[1]),
|
|
|
|
|
fg.globSync(ROOT+"/animations/**/*.fbx", {dot: true}).map((p) => p.split(ROOT)[1])
|
|
|
|
|
);
|
2023-10-31 08:33:53 +08:00
|
|
|
|
|
|
|
|
let str = "";
|
2023-11-02 04:31:20 +08:00
|
|
|
str += `export const bgImages = ${JSON.stringify(bgImages)};\n`;
|
|
|
|
|
str += `export const vrmList = ${JSON.stringify(vrmList)};\n`;
|
|
|
|
|
str += `export const speechT5SpeakerEmbeddingsList = ${JSON.stringify(speechT5SpeakerEmbeddingsList)};\n`;
|
|
|
|
|
str += `export const animationList = ${JSON.stringify(animationList)};\n`;
|
2023-10-31 08:33:53 +08:00
|
|
|
|
|
|
|
|
fs.writeFileSync(path.join(__dirname, './../src/paths.ts'), str);
|