Import a 3D Model and automatically assign and export animations
TypeScript
Move all UI elements to the right side of the screen to look cleaner
Scott Petrovicbfadc6666c0f
diff --git a/src/index.html b/src/index.htmlindex e5f9ff3..5f6cdac 100644--- a/src/index.html+++ b/src/index.html@@ -178,91 +178,93 @@</span>- </div>-- </div> <!-- end tool-panel-->--- <span id="skinned-step-animation-export-options">-- <div id="animations-listing">- <div id="animations-listing-header">- <span>Animations</span>- <div style="margin-right: 1rem;">Export</div>- </div>-- <!-- javascript will populate this item with animations- that we get from the animations file(s) -->- <div id="animations-items"> </div>--- <!-- slider to control arm extension (hide this feature until the base functionality is more stable) -->- <!-- <div style="display: flex; flex-direction: row; justify-content: space-evenly; align-items: center;">- <input type="number" id="extend-arm-input" name="arm-extend-input" value="3" min="-25" max="25" step="1">- <span class="suffix-unit">%</span>- <button id="extend-arm-button" class="secondary-button" >Open Arms</button>- </div> -->- <hr />+ <span id="skinned-step-animation-export-options">-- <!-- Imports new animations. Hide this for now until base functionality is more stable- can import a different types of animations depending on skeleton it is associated with -->- <!--- <div class="animation-import-section">-- <button id="import-animations-button" class="button dropbtn">- <span class="button-icon-group" style="pointer-events: none">- <span>Import</span>- <span class="material-symbols-outlined">arrow_drop_down</span>- </span>- </button>-- <div id="animation-import-options" class="dropdown-content">- <a href="#" data-value="mixamo-skeleton">Mixamo Animation</a>- <a href="#" data-value="carnegie-skeleton">Carnegie Mellon Animation</a>- </div>- </div>-->-- <!-- <input id="import-animations-upload" type="file" name="animation-upload" accept=".glb, .gltf, .fbx, .bvh" /> -->--- <!-- <div class="dropdown button">- <span class="button-icon-group">- <span>Import</span>- <span class="material-symbols-outlined">arrow_drop_down</span>- </span>- <div class="animation-import-dropdown-content">- <div id="mixamo-animation-import-option">Mixamo Animation</div>- <div id="carnegie-mellon-animation-import-option">Carnegie Mellon Animation</div>+ <div id="animations-listing">+ <div id="animations-listing-header">+ <span>Animations</span>+ <div style="margin-right: 1rem;">Export</div>+ </div>++ <!-- javascript will populate this item with animations+ that we get from the animations file(s) -->+ <div id="animations-items"> </div>+++ <!-- slider to control arm extension (hide this feature until the base functionality is more stable) -->+ <!-- <div style="display: flex; flex-direction: row; justify-content: space-evenly; align-items: center;">+ <input type="number" id="extend-arm-input" name="arm-extend-input" value="3" min="-25" max="25" step="1">+ <span class="suffix-unit">%</span>+ <button id="extend-arm-button" class="secondary-button" >Open Arms</button>+ </div> -->++ <hr />+++ <!-- Imports new animations. Hide this for now until base functionality is more stable+ can import a different types of animations depending on skeleton it is associated with -->+ <!--+ <div class="animation-import-section">++ <button id="import-animations-button" class="button dropbtn">+ <span class="button-icon-group" style="pointer-events: none">+ <span>Import</span>+ <span class="material-symbols-outlined">arrow_drop_down</span>+ </span>+ </button>++ <div id="animation-import-options" class="dropdown-content">+ <a href="#" data-value="mixamo-skeleton">Mixamo Animation</a>+ <a href="#" data-value="carnegie-skeleton">Carnegie Mellon Animation</a>+ </div>+ </div>-->++ <!-- <input id="import-animations-upload" type="file" name="animation-upload" accept=".glb, .gltf, .fbx, .bvh" /> -->+++ <!-- <div class="dropdown button">+ <span class="button-icon-group">+ <span>Import</span>+ <span class="material-symbols-outlined">arrow_drop_down</span>+ </span>+ <div class="animation-import-dropdown-content">+ <div id="mixamo-animation-import-option">Mixamo Animation</div>+ <div id="carnegie-mellon-animation-import-option">Carnegie Mellon Animation</div>+ </div>+ </div> -->+++ <!-- <label for="import-animations-button" class="button" >+ <span class="button-icon-group">+ <span class="material-symbols-outlined">add</span>+ <span>Import</span>+ </span>+ </label>+ <input id="import-animations-button" type="file" name="animation-upload" accept=".glb, .gltf, .fbx, .bvh" /> -->++ <button id="export-button" title="Export animations. Make sure to select the animations you want to export first.">+ <span class="button-icon-group">+ <span class="material-symbols-outlined">save_alt</span>+ <span>Download GLB</span>+ </span>+ </button>+ <a id="download-hidden-link" href="#" style="display:none"></a>+++++</div>- </div> -->--- <!-- <label for="import-animations-button" class="button" >- <span class="button-icon-group">- <span class="material-symbols-outlined">add</span>- <span>Import</span>- </span>- </label>- <input id="import-animations-button" type="file" name="animation-upload" accept=".glb, .gltf, .fbx, .bvh" /> -->-- <button id="export-button" title="Export animations. Make sure to select the animations you want to export first.">- <span class="button-icon-group">- <span class="material-symbols-outlined">save_alt</span>- <span>Download GLB</span>- </span>- </button>- <a id="download-hidden-link" href="#" style="display:none"></a>---+++ </span></div>-- </span>+ </div> <!-- end tool-panel-->+<!-- info panel for messages and information--><div id="info-panel">diff --git a/src/lib/UI.ts b/src/lib/UI.tsindex 9e099a5..c36b0a8 100644--- a/src/lib/UI.ts+++ b/src/lib/UI.ts@@ -147,10 +147,12 @@ export class UI {this.dom_animation_clip_list.innerHTML +=`<div class="anim-item">- <div>- <button class="secondary-button play" data-index="${index}">►</button>- <span style="align-self: center">${animation_clip.name}</span>- </div>++ <button class="secondary-button play" data-index="${index}">+ ►+ ${animation_clip.name}+ </button>+<div class="styled-checkbox"><input type="checkbox" name="${animation_clip.name}" value="${index}"></div>diff --git a/src/styles.css b/src/styles.cssindex e1d8299..1fed019 100644--- a/src/styles.css+++ b/src/styles.css@@ -9,14 +9,10 @@#skinned-step-animation-export-options {- position: fixed;top: 70px;right: 20px;background: #0b1822;- padding: 1rem;- width: 20rem;- box-shadow: 1px 1px 8px 0px #000000bf;- border: 1px dotted #5b8792;+ width: 18rem;}#skinned-step-tools@@ -80,7 +76,12 @@ button.secondary-button:hover {button.secondary-button.play{- padding: 0.2rem 0.5rem; /* play has much smaller padding */+ padding: 0.2rem 0.5rem;+ display: inline-flex;+ flex-grow: 1;+ align-items: center;+ border: none;+ border-radius: 0;}button, .button {@@ -209,11 +210,12 @@ option {height: fit-content;background: #0b1822;box-shadow: 1px 1px 8px 0px #000000bf;- top: 70px;- left: 20px;- bottom: 0;+ top: 0;+ right: 0;+ /* bottom: 0; */border: 1px dotted #5b8792;padding: 1rem;+ height: 100%;}#animations-listing {@@ -279,6 +281,7 @@ option {justify-content: space-between;}+input[type="file"] {display: none;}@@ -341,17 +344,8 @@ input[type="file"] {.show {display:block;}#mouse-controls {- position: fixed;- top: 10px;- left: 0;- right: 0;display: flex;- justify-content: center;- align-items: center;gap: 24px;- padding: 0 8px;- height: 50px;- z-index: 100;}/* Tooltip container */