Import a 3D Model and automatically assign and export animations
TypeScript
Remove unneeded key since we fixed the skeleton type
Scott Petrovic87503c5d5d3c
diff --git a/src/lib/RigConfig.ts b/src/lib/RigConfig.tsindex 037b149..9bd9f37 100644--- a/src/lib/RigConfig.ts+++ b/src/lib/RigConfig.ts@@ -1,26 +1,15 @@import { SkeletonType } from './enums/SkeletonType'export interface RigConfigEntry {- // String key used as the HTML select option value, e.g. 'human', 'fox'- key: string- // The SkeletonType enum member for this rig- skeleton_type: SkeletonType- // Model file path relative to the static root, e.g. 'models/model-human.glb'- model_file: string- // Rig/skeleton GLB file path relative to the static root, e.g. 'rigs/rig-human.glb'- rig_file: string- // Display name shown in both the model and skeleton dropdowns- rig_display_name: string- // Animation filenames (no base path) loaded for this rig type- animation_files: string[]- // Sub-folder name used when referencing animation preview thumbnails- animation_preview_folder: string- // Only Human has per-finger hand skeleton options- has_hand_options: boolean- // Only Human shows the head weight correction panel- has_head_weight_correction: boolean- // Only Human shows the A-pose arm-extension correction slider- has_a_pose_correction: boolean+ skeleton_type: SkeletonType // The SkeletonType enum member for this rig+ model_file: string // Model file path relative to the static root, e.g. 'models/model-human.glb'+ rig_file: string // Rig/skeleton GLB file path relative to the static root, e.g. 'rigs/rig-human.glb'+ rig_display_name: string // Display name shown in both the model and skeleton dropdowns+ animation_files: string[] // Animation filenames (no base path) loaded for this rig type+ animation_preview_folder: string // Sub-folder name used when referencing animation preview thumbnails+ has_hand_options: boolean // Only Human has per-finger hand skeleton options+ has_head_weight_correction: boolean // Only Human shows the head weight correction panel+ has_a_pose_correction: boolean // Only Human shows the A-pose arm-extension correction slider}/**@@ -32,7 +21,6 @@ export interface RigConfigEntry {export class RigConfig {static readonly all: RigConfigEntry[] = [{- key: 'human',skeleton_type: SkeletonType.Human,model_file: 'models/model-human.glb',rig_file: 'rigs/rig-human.glb',@@ -42,9 +30,8 @@ export class RigConfig {has_hand_options: true,has_head_weight_correction: true,has_a_pose_correction: true- },+ } satisfies RigConfigEntry,{- key: 'fox',skeleton_type: SkeletonType.Fox,model_file: 'models/model-fox.glb',rig_file: 'rigs/rig-fox.glb',@@ -54,9 +41,8 @@ export class RigConfig {has_hand_options: false,has_head_weight_correction: false,has_a_pose_correction: false- },+ } satisfies RigConfigEntry,{- key: 'bird',skeleton_type: SkeletonType.Bird,model_file: 'models/model-bird.glb',rig_file: 'rigs/rig-bird.glb',@@ -66,9 +52,8 @@ export class RigConfig {has_hand_options: false,has_head_weight_correction: false,has_a_pose_correction: false- },+ } satisfies RigConfigEntry,{- key: 'dragon',skeleton_type: SkeletonType.Dragon,model_file: 'models/model-dragon.glb',rig_file: 'rigs/rig-dragon.glb',@@ -78,9 +63,8 @@ export class RigConfig {has_hand_options: false,has_head_weight_correction: false,has_a_pose_correction: false- },+ } satisfies RigConfigEntry,{- key: 'kaiju',skeleton_type: SkeletonType.Kaiju,model_file: 'models/model-kaiju.glb',rig_file: 'rigs/rig-kaiju.glb',@@ -90,12 +74,12 @@ export class RigConfig {has_hand_options: false,has_head_weight_correction: false,has_a_pose_correction: false- }+ } satisfies RigConfigEntry]- /** Look up a rig by its HTML select option value. */- static by_key (key: string): RigConfigEntry | undefined {- return this.all.find(r => r.key === key)+ /** Look up a rig by its SkeletonType enum value (which is also used as the key). */+ static by_key (rig_key: string): RigConfigEntry | undefined {+ return this.all.find(r => r.skeleton_type === rig_key as SkeletonType)}/** Look up a rig by its SkeletonType enum value. */@@ -151,7 +135,7 @@ export class RigConfig {}for (const rig of this.all) {const option = document.createElement('option')- option.value = rig.key+ option.value = rig.skeleton_typeoption.textContent = rig.rig_display_nameselect.appendChild(option)}