Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Move retargeting steps to their own folder

Scott Petrovicd71b35ba7eb6
diff --git a/src/retarget/BoneAutoMapper.ts b/src/retarget/BoneAutoMapper.ts
index fe34661..abcbbda 100644
--- a/src/retarget/BoneAutoMapper.ts
+++ b/src/retarget/BoneAutoMapper.ts
@@ -1,7 +1,7 @@
import { Bone, Group, Object3D, Scene, SkinnedMesh } from 'three'
import { BoneCategoryMapper } from './BoneCategoryMapper'
import { MixamoMapper } from './MixamoMapper'
-import { TargetBoneMappingType } from './StepBoneMapping'
+import { TargetBoneMappingType } from './steps/StepBoneMapping'
/**
* Bone categories for grouping bones by anatomical area
diff --git a/src/retarget/RetargetAnimationPreview.ts b/src/retarget/RetargetAnimationPreview.ts
index 7987014..37120dc 100644
--- a/src/retarget/RetargetAnimationPreview.ts
+++ b/src/retarget/RetargetAnimationPreview.ts
@@ -1,8 +1,8 @@
import { AnimationClip, AnimationMixer, Object3D, type Scene, type SkinnedMesh, VectorKeyframeTrack, QuaternionKeyframeTrack, type AnimationAction, Quaternion, Euler, Vector3 } from 'three'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
import { AnimationUtility } from '../lib/processes/animations-listing/AnimationUtility.ts'
-import type { StepBoneMapping } from './StepBoneMapping.ts'
-import { TargetBoneMappingType } from './StepBoneMapping.ts'
+import type { StepBoneMapping } from './steps/StepBoneMapping.ts'
+import { TargetBoneMappingType } from './steps/StepBoneMapping.ts'
import { RetargetUtils } from './RetargetUtils.ts'
/**
diff --git a/src/retarget/retarget.ts b/src/retarget/retarget.ts
index 75a3e6a..6dc958f 100644
--- a/src/retarget/retarget.ts
+++ b/src/retarget/retarget.ts
@@ -1,8 +1,8 @@
import { Mesh2MotionEngine } from '../Mesh2MotionEngine.ts'
import { type Group, type Object3DEventMap, Vector3 } from 'three'
-import { StepLoadSourceSkeleton } from './StepLoadSourceSkeleton.ts'
-import { StepLoadTargetModel } from './StepLoadTargetModel.ts'
-import { StepBoneMapping } from './StepBoneMapping.ts'
+import { StepLoadSourceSkeleton } from './steps/StepLoadSourceSkeleton.ts'
+import { StepLoadTargetModel } from './steps/StepLoadTargetModel.ts'
+import { StepBoneMapping } from './steps/StepBoneMapping.ts'
import { RetargetAnimationPreview } from './RetargetAnimationPreview.ts'
class RetargetModule {
diff --git a/src/retarget/StepBoneMapping.ts b/src/retarget/steps/StepBoneMapping.ts
similarity index 98%
rename from src/retarget/StepBoneMapping.ts
rename to src/retarget/steps/StepBoneMapping.ts
index 0c8454c..4bd5025 100644
--- a/src/retarget/StepBoneMapping.ts
+++ b/src/retarget/steps/StepBoneMapping.ts
@@ -1,7 +1,7 @@
import { Group, type Object3D, type Object3DEventMap, type Scene, type SkinnedMesh } from 'three'
-import { SkeletonType } from '../lib/enums/SkeletonType.ts'
-import { BoneAutoMapper } from './BoneAutoMapper.ts'
-import { MixamoMapper } from './MixamoMapper.ts'
+import { SkeletonType } from '../../lib/enums/SkeletonType.ts'
+import { BoneAutoMapper } from '../BoneAutoMapper.ts'
+import { MixamoMapper } from '../MixamoMapper.ts'
// when we are auto-mapping, keep track of what rig type we matched target against
export enum TargetBoneMappingType {
diff --git a/src/retarget/StepLoadSourceSkeleton.ts b/src/retarget/steps/StepLoadSourceSkeleton.ts
similarity index 96%
rename from src/retarget/StepLoadSourceSkeleton.ts
rename to src/retarget/steps/StepLoadSourceSkeleton.ts
index 24d2350..87fbac3 100644
--- a/src/retarget/StepLoadSourceSkeleton.ts
+++ b/src/retarget/steps/StepLoadSourceSkeleton.ts
@@ -1,8 +1,8 @@
import { Group, Object3D, Scene, SkeletonHelper } from 'three'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
-import { SkeletonType } from '../lib/enums/SkeletonType.ts'
-import type GLTFResult from '../lib/processes/load-skeleton/interfaces/GLTFResult.ts'
-import { ModalDialog } from '../lib/ModalDialog.ts'
+import { SkeletonType } from '../../lib/enums/SkeletonType.ts'
+import type GLTFResult from '../../lib/processes/load-skeleton/interfaces/GLTFResult.ts'
+import { ModalDialog } from '../../lib/ModalDialog.ts'
export class StepLoadSourceSkeleton extends EventTarget {
private readonly loader: GLTFLoader = new GLTFLoader() // all skeletons are in GLB format
diff --git a/src/retarget/StepLoadTargetModel.ts b/src/retarget/steps/StepLoadTargetModel.ts
similarity index 98%
rename from src/retarget/StepLoadTargetModel.ts
rename to src/retarget/steps/StepLoadTargetModel.ts
index a7bec8c..9a35a92 100644
--- a/src/retarget/StepLoadTargetModel.ts
+++ b/src/retarget/steps/StepLoadTargetModel.ts
@@ -1,7 +1,7 @@
import { type Bone, Box3, type Group, type Object3DEventMap, type Scene, type SkinnedMesh, Vector3 } from 'three'
import { type Mesh2MotionEngine } from '../Mesh2MotionEngine.ts'
-import { ModalDialog } from '../lib/ModalDialog.ts'
-import { RetargetUtils } from './RetargetUtils.ts'
+import { ModalDialog } from '../../lib/ModalDialog.ts'
+import { RetargetUtils } from '../RetargetUtils.ts'
/**
* Handles loading the target model (user-uploaded model) for retargeting