Import a 3D Model and automatically assign and export animations
TypeScript
remove the retargeting rotation as that should be fixed now
Scott Petrovic0200d96fe4e3
diff --git a/src/retarget/index.html b/src/retarget/index.htmlindex 69af31e..d076db8 100644--- a/src/retarget/index.html+++ b/src/retarget/index.html@@ -114,8 +114,6 @@<button id="auto-map-button" class="secondary-button" style="display: none;">Auto-Map</button><button id="clear-mappings-button" class="secondary-button" style="display: none;">Clear Mappings</button>- <button id="root-rotation-correction-button" class="secondary-button"- data-tippy-content="Cycle the global X-axis correction for tilted rigs. Useful when the imported rig has no root bone above the pelvis.">Fix Tilt: 0°</button></div><span id="target-bones-list-container" >diff --git a/src/retarget/steps/StepBoneMapping.ts b/src/retarget/steps/StepBoneMapping.tsindex 8480f30..d952583 100644--- a/src/retarget/steps/StepBoneMapping.ts+++ b/src/retarget/steps/StepBoneMapping.ts@@ -24,7 +24,6 @@ export class StepBoneMapping extends EventTarget {private clear_mappings_button: HTMLButtonElement | null = nullprivate auto_map_button: HTMLButtonElement | null = nullprivate view_bone_tree_button: HTMLButtonElement | null = null- private root_rotation_correction_button: HTMLButtonElement | null = nullprivate readonly root_rotation_correction_degrees: number[] = [0, 90, -90, 180]private root_rotation_correction_index: number = 0private source_bone_count: HTMLSpanElement | null = null@@ -46,8 +45,7 @@ export class StepBoneMapping extends EventTarget {this.clear_mappings_button = document.getElementById('clear-mappings-button') as HTMLButtonElementthis.auto_map_button = document.getElementById('auto-map-button') as HTMLButtonElementthis.view_bone_tree_button = document.getElementById('view-bone-tree-button') as HTMLButtonElement- this.root_rotation_correction_button = document.getElementById('root-rotation-correction-button') as HTMLButtonElement-+// if we get a match, show what type of match we got on the UI for feedbackthis.auto_bone_map_match_display = document.getElementById('auto-bone-map-match') as HTMLSpanElement@@ -77,14 +75,6 @@ export class StepBoneMapping extends EventTarget {this.auto_map_bones()})- this.root_rotation_correction_button?.addEventListener('click', () => {- this.root_rotation_correction_index = (this.root_rotation_correction_index + 1) % this.root_rotation_correction_degrees.length- const degrees: number = this.root_rotation_correction_degrees[this.root_rotation_correction_index]- AnimationRetargetService.getInstance().set_root_correction_x_degrees(degrees)- this.update_root_rotation_correction_button()- this.dispatchEvent(new CustomEvent('bone-mappings-changed'))- })-// Filter source bones as user typesthis.source_bones_filter?.addEventListener('input', () => {this.update_source_bones_list()@@ -395,14 +385,6 @@ export class StepBoneMapping extends EventTarget {this.auto_map_button.style.display = this.has_both_skeletons() ? 'block' : 'none'}- private update_root_rotation_correction_button (): void {- if (this.root_rotation_correction_button === null) return-- const degrees: number = this.root_rotation_correction_degrees[this.root_rotation_correction_index]- this.root_rotation_correction_button.textContent = `Fix Tilt: ${degrees}°`- this.root_rotation_correction_button.setAttribute('aria-label', `Set root X rotation correction to ${degrees} degrees`)- }-private update_view_bone_tree_button_visibility (): void {if (this.view_bone_tree_button === null) returnthis.view_bone_tree_button.style.display = this.has_target_skeleton() ? 'inline-flex' : 'none'