|
@@ -759,6 +759,9 @@ var BABYLON;
|
|
|
continue;
|
|
|
}
|
|
|
var children = joint.children;
|
|
|
+ if (!children) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
foundBone = false;
|
|
|
for (var k = 0; k < children.length; k++) {
|
|
|
if (children[k] === id) {
|
|
@@ -2498,7 +2501,7 @@ var BABYLON;
|
|
|
this._rootUrl = rootUrl;
|
|
|
this._onLoaded = function () {
|
|
|
_this._showMeshes();
|
|
|
- _this._startFirstAnimation();
|
|
|
+ _this._startAnimations();
|
|
|
if (_this._errors.length === 0) {
|
|
|
onSuccess();
|
|
|
}
|
|
@@ -2541,14 +2544,16 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- GLTFLoader.prototype._startFirstAnimation = function () {
|
|
|
+ GLTFLoader.prototype._startAnimations = function () {
|
|
|
var animations = this._gltf.animations;
|
|
|
if (!animations) {
|
|
|
return;
|
|
|
}
|
|
|
- var animation = animations[0];
|
|
|
- for (var i = 0; i < animation.targets.length; i++) {
|
|
|
- this._babylonScene.beginAnimation(animation.targets[i], 0, Number.MAX_VALUE, true);
|
|
|
+ for (var i = 0; i < animations.length; i++) {
|
|
|
+ var animation = animations[i];
|
|
|
+ for (var j = 0; j < animation.targets.length; j++) {
|
|
|
+ this._babylonScene.beginAnimation(animation.targets[j], 0, Number.MAX_VALUE, true);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
GLTFLoader.prototype._clear = function () {
|