Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Adding rig config and setup files for horse for testing

Scott Petrovicbce8db67b44c
diff --git a/src/lib/RigConfig.ts b/src/lib/RigConfig.ts
index 7ae660b..ad8b6ac 100644
--- a/src/lib/RigConfig.ts
+++ b/src/lib/RigConfig.ts
@@ -1,5 +1,6 @@
import { SkeletonType } from './enums/SkeletonType'
-import { humanVariations, foxVariations, birdVariations, kaijuVariations, fishVariations, ModelVariation } from './RigModelVariations'
+import { humanVariations, foxVariations, birdVariations, kaijuVariations,
+ fishVariations, ModelVariation } from './RigModelVariations'
export interface RigConfigEntry {
skeleton_type: SkeletonType // The SkeletonType enum member for this rig
@@ -107,6 +108,16 @@ export class RigConfig {
position_tracking_bone_name: 'pelvis',
skeleton_template_image_url: 'rigs/reference/shark.png',
model_variations: fishVariations
+ } satisfies RigConfigEntry,
+ {
+ skeleton_type: SkeletonType.Horse,
+ model_file: 'models/model-horse.glb',
+ rig_file: 'rigs/rig-horse.glb',
+ rig_display_name: 'Horse',
+ animation_files: ['../animations/horse-animations.glb'],
+ animation_preview_folder: 'horse',
+ position_tracking_bone_name: 'hips',
+ skeleton_template_image_url: 'rigs/reference/horse.png',
} satisfies RigConfigEntry
]
diff --git a/src/lib/enums/SkeletonType.ts b/src/lib/enums/SkeletonType.ts
index cc85a6b..e1eef99 100644
--- a/src/lib/enums/SkeletonType.ts
+++ b/src/lib/enums/SkeletonType.ts
@@ -8,6 +8,7 @@ export enum SkeletonType {
Spider = 'spider',
Snake = 'snake',
Fish = 'fish',
+ Horse = 'horse',
Error = 'error',
None = 'none'
}
diff --git a/static/animations/horse-animations.glb b/static/animations/horse-animations.glb
new file mode 100644
index 0000000..e65d465
Binary files /dev/null and b/static/animations/horse-animations.glb differ
diff --git a/static/models/model-horse.glb b/static/models/model-horse.glb
new file mode 100644
index 0000000..6f7e045
Binary files /dev/null and b/static/models/model-horse.glb differ
diff --git a/static/rigs/rig-horse.glb b/static/rigs/rig-horse.glb
new file mode 100644
index 0000000..775b74e
Binary files /dev/null and b/static/rigs/rig-horse.glb differ