Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

If our other left/right checks fail, try a more generic includes while categorizing bones

Scott Petrovicd0e2d0428449
diff --git a/src/retarget/BoneAutoMapper.ts b/src/retarget/BoneAutoMapper.ts
index 8ec44b2..ffe8ff3 100644
--- a/src/retarget/BoneAutoMapper.ts
+++ b/src/retarget/BoneAutoMapper.ts
@@ -209,6 +209,13 @@ export class BoneAutoMapper {
return BoneSide.Right
}
+ // let's look to see if "right" or "left" appears anywhere in the name
+ if (normalized.includes('left')) {
+ return BoneSide.Left
+ } else if (normalized.includes('right')) {
+ return BoneSide.Right
+ }
+
return BoneSide.Unknown // mark as unknown to help us develop this more later
}