Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

improve where skeleton is re-generated so the transform looks.

Scott Petrovicdf514497c1fc
diff --git a/src/lib/EventListeners.ts b/src/lib/EventListeners.ts
index e503946..d2460b1 100644
--- a/src/lib/EventListeners.ts
+++ b/src/lib/EventListeners.ts
@@ -41,7 +41,6 @@ export class EventListeners {
this.bootstrap.load_skeleton_step.addEventListener('skeletonLoaded', () => {
this.bootstrap.edit_skeleton_step.load_original_armature_from_model(this.bootstrap.load_skeleton_step.armature())
- this.bootstrap.regenerate_skeleton_helper(this.bootstrap.edit_skeleton_step.skeleton())
this.bootstrap.process_step = this.bootstrap.process_step_changed(ProcessStep.EditSkeleton)
})
@@ -89,7 +88,6 @@ export class EventListeners {
this.bootstrap.remove_skinned_meshes_from_scene() // clear any existing skinned meshes
this.bootstrap.debugging_visual_object = Utility.regenerate_debugging_scene(this.bootstrap.scene)
this.bootstrap.process_step = this.bootstrap.process_step_changed(ProcessStep.EditSkeleton)
- this.bootstrap.regenerate_skeleton_helper(this.bootstrap.edit_skeleton_step.skeleton())
this.bootstrap.load_model_step.model_meshes().visible = true
// reset current bone selection for edit skeleton step
diff --git a/src/script.ts b/src/script.ts
index d36abf2..335df74 100644
--- a/src/script.ts
+++ b/src/script.ts
@@ -173,6 +173,7 @@ export class Bootstrap {
this.load_skeleton_step.begin()
break
case ProcessStep.EditSkeleton:
+ this.regenerate_skeleton_helper(this.edit_skeleton_step.skeleton())
process_step = ProcessStep.EditSkeleton
this.edit_skeleton_step.begin()
this.edit_skeleton_step.setup_scene(this.scene)
@@ -184,7 +185,9 @@ export class Bootstrap {
this.weight_skin_step.begin()
this.transform_controls.enabled = false // shouldn't be editing bones
this.calculate_skin_weighting_for_models()
+ this.regenerate_skeleton_helper(this.weight_skin_step.skeleton())
this.scene.add(...this.weight_skin_step.final_skinned_meshes()) // add final skinned mesh to scene
+ this.weight_skin_step.weight_painted_mesh_group().visible = false // hide weight painted mesh
this.process_step_changed(ProcessStep.AnimationsListing)
break
case ProcessStep.AnimationsListing:
@@ -342,9 +345,6 @@ export class Bootstrap {
return
}
- // not sure why typescript linter cannot figure out that the skeleton is defined here as I did a check above
- this.regenerate_skeleton_helper(this.weight_skin_step.skeleton())
-
// we might want to test out the binding algorithm to see various hitboxes
// if we are doing debugging, go to that view, if no debugging, go straight to thd animation listing step
if (this.edit_skeleton_step.show_debugging()) {