Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Add button to go back to Step 2. not hooked up yet

Scott Petroviccc1132b16d72
diff --git a/src/index.html b/src/index.html
index 51213ba..3a69cca 100644
--- a/src/index.html
+++ b/src/index.html
@@ -246,20 +246,17 @@
</div>
</div> -->
+ <!-- back to load skeleton -->
+ <div class="display: flex; gap: 0.5rem;">
+ <button class="secondary-button" id="action_back_to_load_skeleton" >&#x2039; Back</button>
+ <button id="action_bind_pose" >Bind pose</button>
+ </div>
- <button id="action_bind_pose" >Bind pose</button>
</span>
- <span id="skinned-step-tools">
-
+ <!-- <span id="skinned-step-tools">
<p class="step-instructions">Select animations you want to export by checking them by animation</p>
-
- <button class="secondary-button" id="action_back_to_edit_skeleton" >&#x2039; Back to edit skeleton</button>
-
- </span>
-
- <hr />
-
+ </span> -->
<span id="skinned-step-animation-export-options">
@@ -304,13 +301,20 @@
<hr />
- <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 style="display: flex; gap: 0.5rem;">
+ <button class="secondary-button" id="action_back_to_edit_skeleton" >&#x2039; Back</button>
+
+ <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>
diff --git a/src/lib/EventListeners.ts b/src/lib/EventListeners.ts
index de68cb9..dd8a9e6 100644
--- a/src/lib/EventListeners.ts
+++ b/src/lib/EventListeners.ts
@@ -114,6 +114,12 @@ export class EventListeners {
this.bootstrap.edit_skeleton_step.clear_undo_history()
})
+ // going back to load skeleton step from edit skeleton step
+ this.bootstrap.ui.dom_back_to_load_skeleton_button?.addEventListener('click', () => {
+ // this.bootstrap.process_step = this.bootstrap.process_step_changed(ProcessStep.LoadSkeleton)
+ console.log('go back to the load skeleton step')
+ })
+
// change view event listeners when configuring skeleton
this.bootstrap.ui.dom_view_front_change?.addEventListener('click', () => { this.bootstrap.switchToView('front') })
this.bootstrap.ui.dom_view_side_change?.addEventListener('click', () => { this.bootstrap.switchToView('side') })
diff --git a/src/lib/UI.ts b/src/lib/UI.ts
index ad32bf5..93183ec 100644
--- a/src/lib/UI.ts
+++ b/src/lib/UI.ts
@@ -41,6 +41,7 @@ export class UI {
dom_skinned_mesh_animation_tools: HTMLElement | null = null
dom_show_skeleton_checkbox: HTMLElement | null = null
dom_back_to_edit_skeleton_button: HTMLButtonElement | null = null
+ dom_back_to_load_skeleton_button: HTMLButtonElement | null = null
dom_enable_skin_debugging: HTMLInputElement | null = null
dom_mesh_preview_group: HTMLElement | null = null
@@ -118,6 +119,7 @@ export class UI {
this.dom_skinned_mesh_animation_tools = document.querySelector('#skinned-step-animation-export-options')
this.dom_show_skeleton_checkbox = document.querySelector('#show-skeleton-checkbox')
this.dom_back_to_edit_skeleton_button = document.querySelector('#action_back_to_edit_skeleton')
+ this.dom_back_to_load_skeleton_button = document.querySelector('#action_back_to_load_skeleton')
this.dom_enable_skin_debugging = document.querySelector('#debug-skinning-checkbox')
// UI Controls for working with animation list/selection and export