Import a 3D Model and automatically assign and export animations
TypeScript
Add way to remove a manual bone mapping
Scott Petrovicc8207a292e07
diff --git a/src/retarget/StepBoneMapping.ts b/src/retarget/StepBoneMapping.tsindex b403e6d..c6fcc1a 100644--- a/src/retarget/StepBoneMapping.ts+++ b/src/retarget/StepBoneMapping.ts@@ -226,6 +226,17 @@ export class StepBoneMapping extends EventTarget {bone_item.appendChild(source_name_span)bone_item.appendChild(target_name_span)++ // Add remove button for the mapping+ const remove_button = document.createElement('button')+ remove_button.textContent = '✕'+ remove_button.className = 'remove-mapping-button secondary-button'+ remove_button.title = 'Remove this mapping'+ remove_button.addEventListener('click', (event) => {+ event.stopPropagation()+ this.clear_bone_mapping(name)+ })+ bone_item.appendChild(remove_button)} else {bone_item.textContent = name}diff --git a/src/retarget/index.html b/src/retarget/index.htmlindex ce0b4e4..348e464 100644--- a/src/retarget/index.html+++ b/src/retarget/index.html@@ -77,7 +77,7 @@<input type="file" id="upload-file" accept=".glb, .fbx, .zip" style="display: none;" /><label for="upload-file" class="button" id="load-model-button">Upload GLB</label>- <p>Bones List (Drop here) <span id="target-bone-count">(0)</span></p>+ <p>Bones List <span id="target-bone-count">(0)</span></p><div id="target-bones-list"><p style="color: var(--text-secondary);">No target skeleton loaded</p></div>diff --git a/src/retarget/retarget.css b/src/retarget/retarget.cssindex 466c019..231c9e0 100644--- a/src/retarget/retarget.css+++ b/src/retarget/retarget.css@@ -98,6 +98,7 @@ h1 {display: flex;align-items: center;gap: 0.5rem;+ justify-content: space-between;}.bone-item-target.drag-over {