Skip to content

Commit d182f38

Browse files
committed
Remove some dead comments with hip bone
1 parent d88a77a commit d182f38

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

src/lib/processes/animations-listing/StepAnimationsListing.ts

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -37,46 +37,11 @@ export class StepAnimationsListing extends EventTarget {
3737
// Animation search functionality
3838
public animation_search: AnimationSearch | null = null
3939

40-
// -z will bring hip bone down
41-
// private hip_bone_offset: Vector3 = new Vector3(0, 0, 0) // -z will bring hip bone down. Helps set new base hip position
42-
// private hip_bone_scale_factor_z: number = 1.0 // this is used to scale the hip bone position for animations
43-
4440
/**
4541
* The amount to raise the arms.
4642
*/
4743
private warp_arm_amount: number = 0.0
4844

49-
// the human model has a hip bone that needs position changes applied
50-
// This will be for animations like falling. We need to capture the offset between
51-
// the original position and the new position from our edited armature
52-
// public calculate_hip_bone_offset (original_armature: Object3D, edited_armature: Object3D): void {
53-
// const original_hip_bone: Bone = this.find_bone_from_armature(original_armature, 'DEF-hips')
54-
// const edited_hip_bone: Bone = this.find_bone_from_armature(edited_armature, 'DEF-hips')
55-
// this.hip_bone_offset = this.calculate_position_offset(original_hip_bone.position, edited_hip_bone.position)
56-
57-
// // calculate the scale factor for the animation clips
58-
// // this should take the distance between the original and edited armature
59-
// // and divide it by the original armature hip bone position
60-
// this.hip_bone_scale_factor_z = edited_hip_bone.position.z / original_hip_bone.position.z
61-
62-
// // small T-pose offset that somehow is getting lost
63-
// this.hip_bone_offset = this.hip_bone_offset.sub(new Vector3(0, 0, -0.04))
64-
// }
65-
66-
// private find_bone_from_armature (armature: Object3D, bone_name: string): Bone | null {
67-
// let found_bone: Bone | null = null
68-
// armature.traverse((object: Object3D) => {
69-
// if (found_bone === null && object.name === bone_name && object instanceof Bone) {
70-
// found_bone = object
71-
// }
72-
// })
73-
// return found_bone
74-
// }
75-
76-
// private calculate_position_offset (position_1: Vector3, position_2: Vector3): Vector3 {
77-
// return new Vector3(position_1.x - position_2.x, position_1.y - position_2.y, position_1.z - position_2.z)
78-
// }
79-
8045
private has_added_event_listeners: boolean = false
8146

8247
constructor (theme_manager: ThemeManager) {
@@ -125,8 +90,6 @@ export class StepAnimationsListing extends EventTarget {
12590
this.skinned_meshes_to_animate = []
12691
this.animation_mixer = new AnimationMixer()
12792
this.current_playing_index = 0
128-
// this.hip_bone_offset = new Vector3(0, 0, 0)
129-
// this.hip_bone_scale_factor_z = 1.0
13093
this.animation_player.clear_animation()
13194
}
13295

@@ -238,6 +201,9 @@ export class StepAnimationsListing extends EventTarget {
238201
this.ui.dom_animations_listing_count.innerHTML = animation_length_string + ' animations'
239202
}
240203

204+
// when we scaled the skeleton itself near the beginning, we kept track of that
205+
// this scaling will affect position keyframes since they expect the original skeleton scale
206+
// this will fix any issues with position keyframes not matching the current skeleton scale
241207
private apply_skeleton_scale_to_position_keyframes (animation_clips: AnimationClip[]): void {
242208
animation_clips.forEach((animation_clip: AnimationClip) => {
243209
animation_clip.tracks.forEach((track: KeyframeTrack) => {
@@ -248,7 +214,6 @@ export class StepAnimationsListing extends EventTarget {
248214
values[i + 1] *= this.skeleton_scale
249215
values[i + 2] *= this.skeleton_scale
250216
}
251-
console.log(track.name, this.skeleton_scale, track.values)
252217
}
253218
})
254219
})

0 commit comments

Comments
 (0)