File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -639,5 +639,27 @@ function updateModelTo1_8_0(model: any) {
639639 }
640640 }
641641
642+ // Update commands keyframes to use new keyframe channel name
643+ if ( Array . isArray ( fixed . animations ) ) {
644+ debugger
645+ for ( const animation of fixed . animations ) {
646+ for ( const animator of Object . values < any > ( animation . animators ?? { } ) ) {
647+ if ( ! Array . isArray ( animator . keyframes ) ) continue
648+ for ( const keyframe of animator . keyframes ) {
649+ if ( keyframe . channel !== 'commands' ) continue
650+ keyframe . channel = 'function'
651+ if ( Array . isArray ( keyframe . data_points ) ) {
652+ for ( const dataPoint of keyframe . data_points ) {
653+ if ( dataPoint . commands ) {
654+ dataPoint . function = dataPoint . commands
655+ delete dataPoint . commands
656+ }
657+ }
658+ }
659+ }
660+ }
661+ }
662+ }
663+
642664 return fixed
643665}
You can’t perform that action at this time.
0 commit comments