Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Start adding UI to filter bones with mapping

Scott Petrovic956d779eaf21
diff --git a/src/lib/UI.ts b/src/lib/UI.ts
index 6b64214..1b70455 100644
--- a/src/lib/UI.ts
+++ b/src/lib/UI.ts
@@ -90,6 +90,10 @@ export class UI {
dom_animation_count: HTMLElement | null = null
dom_animations_listing_count: HTMLElement | null = null
+ // retarget bone map filters
+ dom_source_bones_filter: HTMLInputElement | null = null
+ dom_target_bones_filter: HTMLInputElement | null = null
+
dom_build_version: HTMLElement | null = null
dom_attribution_link: HTMLAnchorElement | null = null
dom_learn_link: HTMLAnchorElement | null = null
@@ -209,6 +213,10 @@ export class UI {
this.dom_export_button_hidden_link = document.querySelector('#download-hidden-link')
this.dom_animation_count = document.querySelector('#animation-selection-count')
this.dom_animations_listing_count = document.querySelector('#animation-listing-count')
+
+ // retarget bone map filter controls
+ this.dom_source_bones_filter = document.querySelector('#source-bones-filter')
+ this.dom_target_bones_filter = document.querySelector('#target-bones-filter')
}
public hide_all_elements (): void {
diff --git a/src/retarget/index.html b/src/retarget/index.html
index 70b4774..c3d142a 100644
--- a/src/retarget/index.html
+++ b/src/retarget/index.html
@@ -91,6 +91,9 @@
</div>
<p>Source Bones <span id="source-bone-count">(0)</span></p>
+
+ <input type="text" id="source-bones-filter" placeholder="Filter source bones..." >
+
<div id="source-bones-list">
<p style="color: var(--text-secondary);">No source skeleton loaded</p>
</div>
@@ -124,6 +127,8 @@
<span id="view-bone-tree-button" style="display: none;">👓</span>
</p>
+ <input type="text" id="target-bones-filter" placeholder="Filter target bones..." >
+
<div id="target-bones-list">
<p style="color: var(--text-secondary);">No target skeleton loaded</p>
</div>
diff --git a/src/styles.css b/src/styles.css
index 877fe9e..dacd335 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -148,14 +148,6 @@ div, p {
row-gap: 1rem;
}
-#animation-filter {
- width: 95%;
- padding: 0.5rem;
- background-color: var(--bg-primary);
- border: none;
- border-radius: 4px;
- margin-bottom: 0.5rem;
-}
#animation-listing-count {
position: absolute;
right: 3rem;
@@ -212,10 +204,22 @@ input[type="number"] {
}
input[type="text"] {
+ width: 95%;
+ padding: 0.5rem;
+ background-color: var(--bg-primary);
+ border: none;
+ border-radius: 4px;
+ margin-bottom: 0.5rem;
background-color: var(--bg-primary);
border: 1px solid var(--text-primary);
color: var(--text-primary);
}
+input[type="text"]::placeholder {
+ color: var(--text-primary);
+ opacity: 1; /* Firefox needs this to ensure full opacity */
+ font-style: italic;;
+}
+
/* used for animation play options */
button.secondary-button {
@@ -567,12 +571,6 @@ input[type="file"] {
padding: 1rem;
}
-/* Style for animation filter placeholder text */
-#animation-filter::placeholder {
- color: var(--text-primary);
- opacity: 1; /* Firefox needs this to ensure full opacity */
- font-style: italic;;
-}
/* Theme toggle button styles */
#theme-toggle {