perf(falukant): simplify house runtime geometry
All checks were successful
Deploy to production / deploy (push) Successful in 1m54s
All checks were successful
Deploy to production / deploy (push) Successful in 1m54s
This commit is contained in:
@@ -16,13 +16,20 @@ const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
||||
const frontendDir = path.resolve(scriptDir, '..');
|
||||
const args = process.argv.slice(2);
|
||||
const optionIndex = args.indexOf('--assets-dir');
|
||||
const categoryIndex = args.indexOf('--category');
|
||||
const assetsDir = path.resolve(optionIndex >= 0 && args[optionIndex + 1]
|
||||
? args[optionIndex + 1]
|
||||
: path.join(frontendDir, '..', '..', 'YourPart3Assets'));
|
||||
const sourceRoot = path.join(assetsDir, 'models-src', '3d', 'falukant');
|
||||
const outputRoot = path.join(assetsDir, 'public', 'models', '3d', 'falukant');
|
||||
|
||||
for (const category of ['characters', 'houses']) {
|
||||
const selectedCategory = categoryIndex >= 0 ? args[categoryIndex + 1] : null;
|
||||
const categories = selectedCategory ? [selectedCategory] : ['characters', 'houses'];
|
||||
if (categories.some((category) => !['characters', 'houses'].includes(category))) {
|
||||
throw new Error('Use --category characters or --category houses.');
|
||||
}
|
||||
|
||||
for (const category of categories) {
|
||||
const sourceDir = path.join(sourceRoot, category);
|
||||
const outputDir = path.join(outputRoot, category);
|
||||
if (!fs.existsSync(sourceDir)) {
|
||||
|
||||
Reference in New Issue
Block a user