File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ export class StepAnimationsListing extends EventTarget {
28
28
private current_playing_index : number = 0
29
29
private skeleton_type : SkeletonType = SkeletonType . Human
30
30
31
+ // retrieved from load skeleton step
32
+ // we will use this to scale all position animation keyframes (uniform scale)
33
+ private skeleton_scale : number = 1.0
34
+
31
35
private _added_event_listeners : boolean = false
32
36
33
37
// Animation search functionality
@@ -82,7 +86,9 @@ export class StepAnimationsListing extends EventTarget {
82
86
this . theme_manager = theme_manager
83
87
}
84
88
85
- public begin ( skeleton_type : SkeletonType ) : void {
89
+ public begin ( skeleton_type : SkeletonType , skeleton_scale : number ) : void {
90
+ this . skeleton_scale = skeleton_scale
91
+
86
92
if ( this . ui . dom_current_step_index != null ) {
87
93
this . ui . dom_current_step_index . innerHTML = '4'
88
94
}
Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ export class StepLoadSkeleton extends EventTarget {
25
25
return this . skeleton_file_path ( ) // this is actually the type/filepath combo
26
26
}
27
27
28
+ // The edit skeleton step will use this to scale the skeleton when loading editable skeleton
29
+ // animations listing will use this to scale all position keyframes
30
+ public skeleton_scale ( ) : number {
31
+ return this . skeleton_scale_percentage
32
+ }
33
+
28
34
constructor ( main_scene : Scene ) {
29
35
super ( )
30
36
this . _main_scene = main_scene
@@ -178,6 +184,9 @@ export class StepLoadSkeleton extends EventTarget {
178
184
this . loaded_armature . position . set ( 0 , 0 , 0 )
179
185
this . loaded_armature . updateWorldMatrix ( true , true )
180
186
187
+ // scale the armature to what we picked using the scale slider/preview
188
+ this . loaded_armature . scale . set ( this . skeleton_scale ( ) , this . skeleton_scale ( ) , this . skeleton_scale ( ) )
189
+
181
190
this . dispatchEvent ( new CustomEvent ( 'skeletonLoaded' , { detail : this . loaded_armature } ) )
182
191
} )
183
192
} )
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export class Bootstrap {
292
292
break
293
293
case ProcessStep . AnimationsListing :
294
294
this . process_step = ProcessStep . AnimationsListing
295
- this . animations_listing_step . begin ( this . load_skeleton_step . skeleton_type ( ) )
295
+ this . animations_listing_step . begin ( this . load_skeleton_step . skeleton_type ( ) , this . load_skeleton_step . skeleton_scale ( ) )
296
296
297
297
this . skeleton_helper ?. setJointsVisible ( false )
298
298
You can’t perform that action at this time.
0 commit comments