Import a 3D Model and automatically assign and export animations
TypeScript
Reset state when going back to load skeleton step
Scott Petrovic5dfdfb66639b
diff --git a/src/index.html b/src/index.htmlindex 3a69cca..247bb61 100644--- a/src/index.html+++ b/src/index.html@@ -106,7 +106,7 @@<div style="display: flex; flex-direction: column; gap: 1rem;">- <span>Skeleton Type to use:</span>+ <span>Skeleton template:</span><select id="skeleton-selection"><option value="human">Human</option><option value="quadraped">4 Leg Creature</option>diff --git a/src/lib/EventListeners.ts b/src/lib/EventListeners.tsindex dd8a9e6..1cfdb72 100644--- a/src/lib/EventListeners.ts+++ b/src/lib/EventListeners.ts@@ -116,8 +116,7 @@ export class EventListeners {// going back to load skeleton step from edit skeleton stepthis.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')+ this.bootstrap.process_step = this.bootstrap.process_step_changed(ProcessStep.LoadSkeleton)})// change view event listeners when configuring skeletondiff --git a/src/script.ts b/src/script.tsindex fcef8f4..b2ec953 100644--- a/src/script.ts+++ b/src/script.ts@@ -187,6 +187,19 @@ export class Bootstrap {this.load_model_step.begin()breakcase ProcessStep.LoadSkeleton:++ // Resetting state for the load skeleton step++ // if skeleton helper existed because we are going back to this+ if (this.skeleton_helper !== undefined) {+ this.scene.remove(this.skeleton_helper)+ }++ // need to change the texture display to normal material in+ this.mesh_preview_display_type = ModelPreviewDisplay.Textured+ this.changed_model_preview_display(this.mesh_preview_display_type)++ // initializing all the load skeleton step stuffthis.scene.add(this.load_model_step.model_meshes())process_step = ProcessStep.LoadSkeletonthis.load_skeleton_step.begin()@@ -198,6 +211,8 @@ export class Bootstrap {this.edit_skeleton_step.setup_scene(this.scene)this.transform_controls.enabled = truethis.transform_controls.setMode(this.transform_controls_type) // 'translate', 'rotate'++ this.mesh_preview_display_type = ModelPreviewDisplay.WeightPaintedthis.changed_model_preview_display(this.mesh_preview_display_type) // show weight painted mesh by defaultbreakcase ProcessStep.BindPose: