Import a 3D Model and automatically assign and export animations
TypeScript
Make floor more opaque to see areas that go underneath. Hide open artms and import anim UI for now
Scott Petrovice0edd99a8b72
diff --git a/src/index.html b/src/index.htmlindex 2a4a7f0..e537e33 100644--- a/src/index.html+++ b/src/index.html@@ -194,66 +194,67 @@<div id="animations-items"> </div>- <!-- slider to control arm extension -->- <div style="display: flex; flex-direction: row; justify-content: space-evenly; align-items: center;">+ <!-- 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>+ </div> --><hr />- <div style="display: flex; column-gap: 10px; justify-content: center;">--- <!-- 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">+ <!-- 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>- <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> -->+ </button>-- <!-- <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" /> -->+ <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>-->- <button id="export-button">- <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>+ <!-- <input id="import-animations-upload" type="file" name="animation-upload" accept=".glb, .gltf, .fbx, .bvh" /> -->- </div>+ <!-- <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">+ <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>diff --git a/src/lib/Generators.ts b/src/lib/Generators.tsindex 48f07b1..4c4d68b 100644--- a/src/lib/Generators.ts+++ b/src/lib/Generators.ts@@ -22,7 +22,7 @@ export class Generators {static create_grid_helper (color = 0x111155): any[] {// create floor mesh and add to scene to help with shadowsconst floor_geometry = new PlaneGeometry(100, 100, 10, 10)- const floor_material = new MeshPhongMaterial({ color: 0x4e4e7a, wireframe: false, opacity: 0.2, transparent: true })+ const floor_material = new MeshPhongMaterial({ color: 0x4e4e7a, wireframe: false, opacity: 0.8, transparent: true })floor_material.side = DoubleSide // helps us see that we are below the characterconst floor_mesh = new Mesh(floor_geometry, floor_material)@@ -41,10 +41,10 @@ export class Generators {const divisions: number = 10const grid_helper: GridHelper = new GridHelper(size, divisions, color, color)-return [grid_helper, floor_mesh, axes_helper]}+static create_bone_hierarchy (): Bone {// offset root bone down to move entire bone structureconst bone0 = new Bone()