Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Change remaining quadreped reference to fox

Scott Petrovic1c456801b28e
diff --git a/src/lib/RigConfig.ts b/src/lib/RigConfig.ts
index 3eb042d..5dc4570 100644
--- a/src/lib/RigConfig.ts
+++ b/src/lib/RigConfig.ts
@@ -1,7 +1,7 @@
import { SkeletonType } from './enums/SkeletonType'
export interface RigConfigEntry {
- // String key used as the HTML select option value, e.g. 'human', 'quadraped'
+ // 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
@@ -41,8 +41,8 @@ export class RigConfig {
has_a_pose_correction: true
},
{
- key: 'quadraped',
- skeleton_type: SkeletonType.Quadraped,
+ key: 'fox',
+ skeleton_type: SkeletonType.Fox,
model_file: 'models/model-fox.glb',
rig_display_name: 'Fox',
animation_files: ['fox-animations.glb'],
@@ -131,17 +131,22 @@ export class RigConfig {
}
}
- /**
+ /** Video Preview HTML generation for Rig selection
* Populate a <select> with one <option> per animation file across all rigs.
* base_path is prepended to each filename, e.g. '../animations/'.
* A placeholder option is always inserted first.
*/
static populate_animation_file_select (select: HTMLSelectElement, base_path: string): void {
+ // configure the select
select.innerHTML = ''
const placeholder = document.createElement('option')
placeholder.value = ''
+
+ // create first default option as placeholder/instructions
placeholder.textContent = 'Pick a 3d animation to generate previews'
select.appendChild(placeholder)
+
+ // create all available animation options from GLB files in rig config
for (const rig of this.all) {
for (const file of rig.animation_files) {
const option = document.createElement('option')
diff --git a/src/lib/enums/SkeletonType.ts b/src/lib/enums/SkeletonType.ts
index 93ddfd8..ddbf314 100644
--- a/src/lib/enums/SkeletonType.ts
+++ b/src/lib/enums/SkeletonType.ts
@@ -1,7 +1,7 @@
// Supported skeleton types
// the file names for the skeleton types are associated with the const
export enum SkeletonType {
- Quadraped = 'rigs/rig-fox.glb',
+ Fox = 'rigs/rig-fox.glb',
Human = 'rigs/rig-human.glb',
Bird = 'rigs/rig-bird.glb',
Dragon = 'rigs/rig-dragon.glb',
diff --git a/src/marketing/MarketingBootstrap.ts b/src/marketing/MarketingBootstrap.ts
index b342906..d9d6eea 100644
--- a/src/marketing/MarketingBootstrap.ts
+++ b/src/marketing/MarketingBootstrap.ts
@@ -45,7 +45,7 @@ export class MarketingBootstrap {
fox_button?.addEventListener('click', () => {
this.mesh2motion_engine.load_model_step.clear_loaded_model_data()
this.mesh2motion_engine.load_model_step.load_model_file('../models/model-fox.glb', 'glb')
- this.skeleton_type = SkeletonType.Quadraped
+ this.skeleton_type = SkeletonType.Fox
this.change_active_skeleton(fox_button)
})