浏览代码

Meshes with non-animated skeletons had an animation group wrongly added
Fixed.

Raanan Weber 7 年之前
父节点
当前提交
0593ba2910
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 5 1
      Viewer/src/model/viewerModel.ts
  2. 1 0
      dist/preview release/what's new.md

+ 5 - 1
Viewer/src/model/viewerModel.ts

@@ -242,12 +242,16 @@ export class ViewerModel implements IDisposable {
         if (this.skeletons.length) {
         if (this.skeletons.length) {
             this.skeletons.forEach((skeleton, idx) => {
             this.skeletons.forEach((skeleton, idx) => {
                 let ag = new AnimationGroup("animation-" + idx);
                 let ag = new AnimationGroup("animation-" + idx);
+                let add = false;
                 skeleton.getAnimatables().forEach(a => {
                 skeleton.getAnimatables().forEach(a => {
                     if (a.animations[0]) {
                     if (a.animations[0]) {
                         ag.addTargetedAnimation(a.animations[0], a);
                         ag.addTargetedAnimation(a.animations[0], a);
+                        add = true;
                     }
                     }
                 });
                 });
-                this.addAnimationGroup(ag);
+                if (add) {
+                    this.addAnimationGroup(ag);
+                }
             });
             });
         }
         }
 
 

+ 1 - 0
dist/preview release/what's new.md

@@ -85,6 +85,7 @@
 - Animation blending was always set to true, ignoring configuration [#4412](https://github.com/BabylonJS/Babylon.js/issues/4412) ([RaananW](https://github.com/RaananW))
 - Animation blending was always set to true, ignoring configuration [#4412](https://github.com/BabylonJS/Babylon.js/issues/4412) ([RaananW](https://github.com/RaananW))
 - Animation navbar now updates correctly when a new model is loaded [#4441](https://github.com/BabylonJS/Babylon.js/issues/4441) ([RaananW](https://github.com/RaananW))
 - Animation navbar now updates correctly when a new model is loaded [#4441](https://github.com/BabylonJS/Babylon.js/issues/4441) ([RaananW](https://github.com/RaananW))
 - Non-normalized meshes didn't center and focus correctly ([RaananW](https://github.com/RaananW))
 - Non-normalized meshes didn't center and focus correctly ([RaananW](https://github.com/RaananW))
+- Meshes with skeletons could have incorrect animations ([RaananW](https://github.com/RaananW))
 
 
 ### Loaders
 ### Loaders