Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Start adding Kaiju model and rig

Scott Petrovic24d03e200354
diff --git a/src/index.html b/src/index.html
index abaf551..4f11f4b 100644
--- a/src/index.html
+++ b/src/index.html
@@ -62,6 +62,7 @@
<button id="load-fox-model-button">Fox</button>
<button id="load-bird-model-button">Bird</button>
<button id="load-dragon-model-button">Dragon</button>
+ <button id="load-kaiju-button">Kaiju</button>
</div>
diff --git a/src/lib/enums/SkeletonType.ts b/src/lib/enums/SkeletonType.ts
index 6fb5737..93ddfd8 100644
--- a/src/lib/enums/SkeletonType.ts
+++ b/src/lib/enums/SkeletonType.ts
@@ -5,6 +5,7 @@ export enum SkeletonType {
Human = 'rigs/rig-human.glb',
Bird = 'rigs/rig-bird.glb',
Dragon = 'rigs/rig-dragon.glb',
+ Kaiju = 'rigs/rig-kaiju.glb',
Error = 'ERROR',
None = 'NONE'
}
diff --git a/src/lib/processes/animations-listing/AnimationLoader.ts b/src/lib/processes/animations-listing/AnimationLoader.ts
index fa465a4..705a79e 100644
--- a/src/lib/processes/animations-listing/AnimationLoader.ts
+++ b/src/lib/processes/animations-listing/AnimationLoader.ts
@@ -142,6 +142,8 @@ export class AnimationLoader extends EventTarget {
return [`${base_path}bird-animations.glb`]
case SkeletonType.Dragon:
return [`${base_path}dragon-animations.glb`]
+ case SkeletonType.Kaiju:
+ return [`${base_path}kaiju-animations.glb`]
default:
console.error('Unknown skeleton type for loading animations:', skeleton_type)
return []
diff --git a/src/marketing/MarketingBootstrap.ts b/src/marketing/MarketingBootstrap.ts
index 1d6463a..b342906 100644
--- a/src/marketing/MarketingBootstrap.ts
+++ b/src/marketing/MarketingBootstrap.ts
@@ -33,6 +33,7 @@ export class MarketingBootstrap {
const fox_button: HTMLElement | null = document.getElementById('load-fox-model-button')
const bird_button: HTMLElement | null = document.getElementById('load-bird-model-button')
const dragon_button: HTMLElement | null = document.getElementById('load-dragon-model-button')
+ const kaiju_button: HTMLElement | null = document.getElementById('load-kaiju-button')
human_button?.addEventListener('click', () => {
this.mesh2motion_engine.load_model_step.clear_loaded_model_data()
@@ -62,6 +63,13 @@ export class MarketingBootstrap {
this.change_active_skeleton(dragon_button)
})
+ kaiju_button?.addEventListener('click', () => {
+ this.mesh2motion_engine.load_model_step.clear_loaded_model_data()
+ this.mesh2motion_engine.load_model_step.load_model_file('../models/model-kaiju.glb', 'glb')
+ this.skeleton_type = SkeletonType.Kaiju
+ this.change_active_skeleton(kaiju_button)
+ })
+
human_button?.click() // load human by default to start us out
}
diff --git a/static/animations/kaiju-animations.glb b/static/animations/kaiju-animations.glb
new file mode 100644
index 0000000..f562558
Binary files /dev/null and b/static/animations/kaiju-animations.glb differ
diff --git a/static/models/model-dinosaur.glb b/static/models/model-dinosaur.glb
deleted file mode 100644
index 6bdae86..0000000
Binary files a/static/models/model-dinosaur.glb and /dev/null differ
diff --git a/static/models/model-kaiju.glb b/static/models/model-kaiju.glb
new file mode 100644
index 0000000..aa21b64
Binary files /dev/null and b/static/models/model-kaiju.glb differ
diff --git a/static/rigs/rig-kaiju.glb b/static/rigs/rig-kaiju.glb
new file mode 100644
index 0000000..eca3d67
Binary files /dev/null and b/static/rigs/rig-kaiju.glb differ