|
@@ -46304,6 +46304,33 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Class used to override all child animations of a given target
|
|
|
+ */
|
|
|
+ var AnimationPropertiesOverride = /** @class */ (function () {
|
|
|
+ function AnimationPropertiesOverride() {
|
|
|
+ /**
|
|
|
+ * Gets or sets a value indicating if animation blending must be used
|
|
|
+ */
|
|
|
+ this.enableBlending = false;
|
|
|
+ /**
|
|
|
+ * Gets or sets the blending speed to use when enableBlending is true
|
|
|
+ */
|
|
|
+ this.blendingSpeed = 0.01;
|
|
|
+ /**
|
|
|
+ * Gets or sets the default loop mode to use
|
|
|
+ */
|
|
|
+ this.loopMode = BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE;
|
|
|
+ }
|
|
|
+ return AnimationPropertiesOverride;
|
|
|
+ }());
|
|
|
+ BABYLON.AnimationPropertiesOverride = AnimationPropertiesOverride;
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
+//# sourceMappingURL=babylon.animationPropertiesOverride.js.map
|
|
|
+
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
var AnimationRange = /** @class */ (function () {
|
|
|
function AnimationRange(name, from, to) {
|
|
|
this.name = name;
|
|
@@ -47337,7 +47364,9 @@ var BABYLON;
|
|
|
destination = this._target;
|
|
|
}
|
|
|
// Blending
|
|
|
- if (this._animation.enableBlending && this._blendingFactor <= 1.0) {
|
|
|
+ var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
|
|
|
+ var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
|
|
|
+ if (enableBlending && this._blendingFactor <= 1.0) {
|
|
|
if (!this._originalBlendValue) {
|
|
|
if (destination[path].clone) {
|
|
|
this._originalBlendValue = destination[path].clone();
|
|
@@ -47360,7 +47389,7 @@ var BABYLON;
|
|
|
else {
|
|
|
destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
|
|
|
}
|
|
|
- this._blendingFactor += this._animation.blendingSpeed;
|
|
|
+ this._blendingFactor += blendingSpeed;
|
|
|
}
|
|
|
else {
|
|
|
destination[path] = currentValue;
|
|
@@ -47369,6 +47398,12 @@ var BABYLON;
|
|
|
this._target.markAsDirty(this._animation.targetProperty);
|
|
|
}
|
|
|
};
|
|
|
+ RuntimeAnimation.prototype._getCorrectLoopMode = function () {
|
|
|
+ if (this._target && this._target.animationPropertiesOverride) {
|
|
|
+ return this._target.loopMode;
|
|
|
+ }
|
|
|
+ return this._animation.loopMode;
|
|
|
+ };
|
|
|
RuntimeAnimation.prototype.goToFrame = function (frame) {
|
|
|
var keys = this._animation.getKeys();
|
|
|
if (frame < keys[0].frame) {
|
|
@@ -47377,7 +47412,7 @@ var BABYLON;
|
|
|
else if (frame > keys[keys.length - 1].frame) {
|
|
|
frame = keys[keys.length - 1].frame;
|
|
|
}
|
|
|
- var currentValue = this._interpolate(frame, 0, this._animation.loopMode);
|
|
|
+ var currentValue = this._interpolate(frame, 0, this._getCorrectLoopMode());
|
|
|
this.setValue(currentValue);
|
|
|
};
|
|
|
RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
|
|
@@ -47428,7 +47463,7 @@ var BABYLON;
|
|
|
}
|
|
|
else {
|
|
|
// Get max value if required
|
|
|
- if (this._animation.loopMode !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
|
|
|
+ if (this._getCorrectLoopMode() !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
|
|
|
var keyOffset = to.toString() + from.toString();
|
|
|
if (!this._offsetsCache[keyOffset]) {
|
|
|
var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
|
|
@@ -47493,7 +47528,7 @@ var BABYLON;
|
|
|
// Compute value
|
|
|
var repeatCount = (ratio / range) >> 0;
|
|
|
var currentFrame = returnValue ? from + ratio % range : to;
|
|
|
- var currentValue = this._interpolate(currentFrame, repeatCount, this._animation.loopMode, offsetValue, highLimitValue);
|
|
|
+ var currentValue = this._interpolate(currentFrame, repeatCount, this._getCorrectLoopMode(), offsetValue, highLimitValue);
|
|
|
// Set value
|
|
|
this.setValue(currentValue);
|
|
|
// Check events
|