David Catuhe 7 лет назад
Родитель
Сommit
7e263ff370

Разница между файлами не показана из-за своего большого размера
+ 16737 - 16736
Playground/babylon.d.txt


Разница между файлами не показана из-за своего большого размера
+ 14864 - 14863
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/babylon.js


+ 17 - 6
dist/preview release/babylon.max.js

@@ -51933,12 +51933,23 @@ var BABYLON;
          */
         RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
             if (weight === void 0) { weight = 1.0; }
+            if (this._target instanceof Array) {
+                for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
+                    var target = _a[_i];
+                    this._setValue(target, currentValue, weight);
+                }
+            }
+            else {
+                this._setValue(this._target, currentValue, weight);
+            }
+        };
+        RuntimeAnimation.prototype._setValue = function (target, currentValue, weight) {
             // Set value
             var path;
             var destination;
             var targetPropertyPath = this._animation.targetPropertyPath;
             if (targetPropertyPath.length > 1) {
-                var property = this._target[targetPropertyPath[0]];
+                var property = target[targetPropertyPath[0]];
                 for (var index = 1; index < targetPropertyPath.length - 1; index++) {
                     property = property[targetPropertyPath[index]];
                 }
@@ -51947,7 +51958,7 @@ var BABYLON;
             }
             else {
                 path = targetPropertyPath[0];
-                destination = this._target;
+                destination = target;
             }
             this._targetPath = path;
             this._activeTarget = destination;
@@ -51968,7 +51979,7 @@ var BABYLON;
                 }
             }
             // Blending
-            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
             if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                     var originalValue = destination[path];
@@ -52012,7 +52023,7 @@ var BABYLON;
                         this._currentValue = currentValue;
                     }
                 }
-                var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+                var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
                 this._blendingFactor += blendingSpeed;
             }
             else {
@@ -52024,8 +52035,8 @@ var BABYLON;
             else {
                 destination[path] = this._currentValue;
             }
-            if (this._target.markAsDirty) {
-                this._target.markAsDirty(this._animation.targetProperty);
+            if (target.markAsDirty) {
+                target.markAsDirty(this._animation.targetProperty);
             }
         };
         /**

+ 17 - 6
dist/preview release/babylon.no-module.max.js

@@ -51900,12 +51900,23 @@ var BABYLON;
          */
         RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
             if (weight === void 0) { weight = 1.0; }
+            if (this._target instanceof Array) {
+                for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
+                    var target = _a[_i];
+                    this._setValue(target, currentValue, weight);
+                }
+            }
+            else {
+                this._setValue(this._target, currentValue, weight);
+            }
+        };
+        RuntimeAnimation.prototype._setValue = function (target, currentValue, weight) {
             // Set value
             var path;
             var destination;
             var targetPropertyPath = this._animation.targetPropertyPath;
             if (targetPropertyPath.length > 1) {
-                var property = this._target[targetPropertyPath[0]];
+                var property = target[targetPropertyPath[0]];
                 for (var index = 1; index < targetPropertyPath.length - 1; index++) {
                     property = property[targetPropertyPath[index]];
                 }
@@ -51914,7 +51925,7 @@ var BABYLON;
             }
             else {
                 path = targetPropertyPath[0];
-                destination = this._target;
+                destination = target;
             }
             this._targetPath = path;
             this._activeTarget = destination;
@@ -51935,7 +51946,7 @@ var BABYLON;
                 }
             }
             // Blending
-            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
             if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                     var originalValue = destination[path];
@@ -51979,7 +51990,7 @@ var BABYLON;
                         this._currentValue = currentValue;
                     }
                 }
-                var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+                var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
                 this._blendingFactor += blendingSpeed;
             }
             else {
@@ -51991,8 +52002,8 @@ var BABYLON;
             else {
                 destination[path] = this._currentValue;
             }
-            if (this._target.markAsDirty) {
-                this._target.markAsDirty(this._animation.targetProperty);
+            if (target.markAsDirty) {
+                target.markAsDirty(this._animation.targetProperty);
             }
         };
         /**

Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/babylon.worker.js


+ 17 - 6
dist/preview release/es6.js

@@ -51900,12 +51900,23 @@ var BABYLON;
          */
         RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
             if (weight === void 0) { weight = 1.0; }
+            if (this._target instanceof Array) {
+                for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
+                    var target = _a[_i];
+                    this._setValue(target, currentValue, weight);
+                }
+            }
+            else {
+                this._setValue(this._target, currentValue, weight);
+            }
+        };
+        RuntimeAnimation.prototype._setValue = function (target, currentValue, weight) {
             // Set value
             var path;
             var destination;
             var targetPropertyPath = this._animation.targetPropertyPath;
             if (targetPropertyPath.length > 1) {
-                var property = this._target[targetPropertyPath[0]];
+                var property = target[targetPropertyPath[0]];
                 for (var index = 1; index < targetPropertyPath.length - 1; index++) {
                     property = property[targetPropertyPath[index]];
                 }
@@ -51914,7 +51925,7 @@ var BABYLON;
             }
             else {
                 path = targetPropertyPath[0];
-                destination = this._target;
+                destination = target;
             }
             this._targetPath = path;
             this._activeTarget = destination;
@@ -51935,7 +51946,7 @@ var BABYLON;
                 }
             }
             // Blending
-            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
             if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                     var originalValue = destination[path];
@@ -51979,7 +51990,7 @@ var BABYLON;
                         this._currentValue = currentValue;
                     }
                 }
-                var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+                var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
                 this._blendingFactor += blendingSpeed;
             }
             else {
@@ -51991,8 +52002,8 @@ var BABYLON;
             else {
                 destination[path] = this._currentValue;
             }
-            if (this._target.markAsDirty) {
-                this._target.markAsDirty(this._animation.targetProperty);
+            if (target.markAsDirty) {
+                target.markAsDirty(this._animation.targetProperty);
             }
         };
         /**

Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.d.ts

@@ -443,7 +443,7 @@ declare module BABYLON.GLTF2 {
         _parent: _ILoaderNode;
         _babylonMesh?: Mesh;
         _primitiveBabylonMeshes?: Mesh[];
-        _babylonAnimationTargets?: Node[];
+        _babylonBones?: Bone[];
         _numMorphTargets?: number;
     }
     /** @hidden */

+ 13 - 11
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1055,8 +1055,6 @@ var BABYLON;
                 var promises = new Array();
                 var babylonMesh = new BABYLON.Mesh(node.name || "node" + node._index, this._babylonScene, node._parent._babylonMesh);
                 node._babylonMesh = babylonMesh;
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonMesh);
                 GLTFLoader._LoadTransform(node, babylonMesh);
                 if (node.mesh != undefined) {
                     var mesh = GLTFLoader._GetProperty(context + "/mesh", this._gltf.meshes, node.mesh);
@@ -1320,8 +1318,8 @@ var BABYLON;
                 var boneIndex = skin.joints.indexOf(node._index);
                 babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, babylonParentBone, this._getNodeMatrix(node), null, null, boneIndex);
                 babylonBones[node._index] = babylonBone;
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonBone);
+                node._babylonBones = node._babylonBones || [];
+                node._babylonBones.push(babylonBone);
                 return babylonBone;
             };
             GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
@@ -1418,7 +1416,7 @@ var BABYLON;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
                 // Ignore animations that have no animation targets.
                 if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
-                    (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonAnimationTargets)) {
+                    (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonMesh)) {
                     return Promise.resolve();
                 }
                 // Ignore animations targeting TRS of skinned nodes.
@@ -1549,13 +1547,17 @@ var BABYLON;
                         var animationName = babylonAnimationGroup.name + "_channel" + babylonAnimationGroup.targetedAnimations.length;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
-                        if (targetNode._babylonAnimationTargets) {
-                            for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
-                                var babylonAnimationTarget = _a[_i];
-                                var babylonAnimationClone = babylonAnimation.clone();
-                                babylonAnimationTarget.animations.push(babylonAnimationClone);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimationClone, babylonAnimationTarget);
+                        if (targetNode._babylonBones) {
+                            var babylonAnimationTargets = [targetNode._babylonMesh].concat(targetNode._babylonBones);
+                            for (var _i = 0, babylonAnimationTargets_1 = babylonAnimationTargets; _i < babylonAnimationTargets_1.length; _i++) {
+                                var babylonAnimationTarget = babylonAnimationTargets_1[_i];
+                                babylonAnimationTarget.animations.push(babylonAnimation);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, babylonAnimationTargets);
+                        }
+                        else {
+                            targetNode._babylonMesh.animations.push(babylonAnimation);
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, targetNode._babylonMesh);
                         }
                     }
                 });

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -1019,7 +1019,7 @@ declare module BABYLON.GLTF2 {
         _parent: _ILoaderNode;
         _babylonMesh?: Mesh;
         _primitiveBabylonMeshes?: Mesh[];
-        _babylonAnimationTargets?: Node[];
+        _babylonBones?: Bone[];
         _numMorphTargets?: number;
     }
     /** @hidden */

+ 13 - 11
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -3270,8 +3270,6 @@ var BABYLON;
                 var promises = new Array();
                 var babylonMesh = new BABYLON.Mesh(node.name || "node" + node._index, this._babylonScene, node._parent._babylonMesh);
                 node._babylonMesh = babylonMesh;
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonMesh);
                 GLTFLoader._LoadTransform(node, babylonMesh);
                 if (node.mesh != undefined) {
                     var mesh = GLTFLoader._GetProperty(context + "/mesh", this._gltf.meshes, node.mesh);
@@ -3535,8 +3533,8 @@ var BABYLON;
                 var boneIndex = skin.joints.indexOf(node._index);
                 babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, babylonParentBone, this._getNodeMatrix(node), null, null, boneIndex);
                 babylonBones[node._index] = babylonBone;
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonBone);
+                node._babylonBones = node._babylonBones || [];
+                node._babylonBones.push(babylonBone);
                 return babylonBone;
             };
             GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
@@ -3633,7 +3631,7 @@ var BABYLON;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
                 // Ignore animations that have no animation targets.
                 if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
-                    (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonAnimationTargets)) {
+                    (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonMesh)) {
                     return Promise.resolve();
                 }
                 // Ignore animations targeting TRS of skinned nodes.
@@ -3764,13 +3762,17 @@ var BABYLON;
                         var animationName = babylonAnimationGroup.name + "_channel" + babylonAnimationGroup.targetedAnimations.length;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
-                        if (targetNode._babylonAnimationTargets) {
-                            for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
-                                var babylonAnimationTarget = _a[_i];
-                                var babylonAnimationClone = babylonAnimation.clone();
-                                babylonAnimationTarget.animations.push(babylonAnimationClone);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimationClone, babylonAnimationTarget);
+                        if (targetNode._babylonBones) {
+                            var babylonAnimationTargets = [targetNode._babylonMesh].concat(targetNode._babylonBones);
+                            for (var _i = 0, babylonAnimationTargets_1 = babylonAnimationTargets; _i < babylonAnimationTargets_1.length; _i++) {
+                                var babylonAnimationTarget = babylonAnimationTargets_1[_i];
+                                babylonAnimationTarget.animations.push(babylonAnimation);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, babylonAnimationTargets);
+                        }
+                        else {
+                            targetNode._babylonMesh.animations.push(babylonAnimation);
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, targetNode._babylonMesh);
                         }
                     }
                 });

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1115,7 +1115,7 @@ declare module BABYLON.GLTF2 {
         _parent: _ILoaderNode;
         _babylonMesh?: Mesh;
         _primitiveBabylonMeshes?: Mesh[];
-        _babylonAnimationTargets?: Node[];
+        _babylonBones?: Bone[];
         _numMorphTargets?: number;
     }
     /** @hidden */

+ 13 - 11
dist/preview release/loaders/babylonjs.loaders.js

@@ -4252,8 +4252,6 @@ var BABYLON;
                 var promises = new Array();
                 var babylonMesh = new BABYLON.Mesh(node.name || "node" + node._index, this._babylonScene, node._parent._babylonMesh);
                 node._babylonMesh = babylonMesh;
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonMesh);
                 GLTFLoader._LoadTransform(node, babylonMesh);
                 if (node.mesh != undefined) {
                     var mesh = GLTFLoader._GetProperty(context + "/mesh", this._gltf.meshes, node.mesh);
@@ -4517,8 +4515,8 @@ var BABYLON;
                 var boneIndex = skin.joints.indexOf(node._index);
                 babylonBone = new BABYLON.Bone(node.name || "joint" + node._index, skin._babylonSkeleton, babylonParentBone, this._getNodeMatrix(node), null, null, boneIndex);
                 babylonBones[node._index] = babylonBone;
-                node._babylonAnimationTargets = node._babylonAnimationTargets || [];
-                node._babylonAnimationTargets.push(babylonBone);
+                node._babylonBones = node._babylonBones || [];
+                node._babylonBones.push(babylonBone);
                 return babylonBone;
             };
             GLTFLoader.prototype._loadSkinInverseBindMatricesDataAsync = function (context, skin) {
@@ -4615,7 +4613,7 @@ var BABYLON;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
                 // Ignore animations that have no animation targets.
                 if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
-                    (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonAnimationTargets)) {
+                    (channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonMesh)) {
                     return Promise.resolve();
                 }
                 // Ignore animations targeting TRS of skinned nodes.
@@ -4746,13 +4744,17 @@ var BABYLON;
                         var animationName = babylonAnimationGroup.name + "_channel" + babylonAnimationGroup.targetedAnimations.length;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
-                        if (targetNode._babylonAnimationTargets) {
-                            for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
-                                var babylonAnimationTarget = _a[_i];
-                                var babylonAnimationClone = babylonAnimation.clone();
-                                babylonAnimationTarget.animations.push(babylonAnimationClone);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimationClone, babylonAnimationTarget);
+                        if (targetNode._babylonBones) {
+                            var babylonAnimationTargets = [targetNode._babylonMesh].concat(targetNode._babylonBones);
+                            for (var _i = 0, babylonAnimationTargets_1 = babylonAnimationTargets; _i < babylonAnimationTargets_1.length; _i++) {
+                                var babylonAnimationTarget = babylonAnimationTargets_1[_i];
+                                babylonAnimationTarget.animations.push(babylonAnimation);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, babylonAnimationTargets);
+                        }
+                        else {
+                            targetNode._babylonMesh.animations.push(babylonAnimation);
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, targetNode._babylonMesh);
                         }
                     }
                 });

Разница между файлами не показана из-за своего большого размера
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -1122,7 +1122,7 @@ declare module BABYLON.GLTF2 {
         _parent: _ILoaderNode;
         _babylonMesh?: Mesh;
         _primitiveBabylonMeshes?: Mesh[];
-        _babylonAnimationTargets?: Node[];
+        _babylonBones?: Bone[];
         _numMorphTargets?: number;
     }
     /** @hidden */

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


+ 17 - 6
dist/preview release/viewer/babylon.viewer.max.js

@@ -52021,12 +52021,23 @@ var BABYLON;
          */
         RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
             if (weight === void 0) { weight = 1.0; }
+            if (this._target instanceof Array) {
+                for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
+                    var target = _a[_i];
+                    this._setValue(target, currentValue, weight);
+                }
+            }
+            else {
+                this._setValue(this._target, currentValue, weight);
+            }
+        };
+        RuntimeAnimation.prototype._setValue = function (target, currentValue, weight) {
             // Set value
             var path;
             var destination;
             var targetPropertyPath = this._animation.targetPropertyPath;
             if (targetPropertyPath.length > 1) {
-                var property = this._target[targetPropertyPath[0]];
+                var property = target[targetPropertyPath[0]];
                 for (var index = 1; index < targetPropertyPath.length - 1; index++) {
                     property = property[targetPropertyPath[index]];
                 }
@@ -52035,7 +52046,7 @@ var BABYLON;
             }
             else {
                 path = targetPropertyPath[0];
-                destination = this._target;
+                destination = target;
             }
             this._targetPath = path;
             this._activeTarget = destination;
@@ -52056,7 +52067,7 @@ var BABYLON;
                 }
             }
             // Blending
-            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
             if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                     var originalValue = destination[path];
@@ -52100,7 +52111,7 @@ var BABYLON;
                         this._currentValue = currentValue;
                     }
                 }
-                var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+                var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
                 this._blendingFactor += blendingSpeed;
             }
             else {
@@ -52112,8 +52123,8 @@ var BABYLON;
             else {
                 destination[path] = this._currentValue;
             }
-            if (this._target.markAsDirty) {
-                this._target.markAsDirty(this._animation.targetProperty);
+            if (target.markAsDirty) {
+                target.markAsDirty(this._animation.targetProperty);
             }
         };
         /**