|
@@ -15384,7 +15384,6 @@ var BABYLON;
|
|
|
var bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
|
|
|
this._bindTextureDirectly(bindTarget, texture, true);
|
|
|
this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
|
|
|
- this._bindTextureDirectly(bindTarget, null, true);
|
|
|
};
|
|
|
/** @hidden */
|
|
|
Engine.prototype._uploadImageToTexture = function (texture, image, faceIndex, lod) {
|
|
@@ -51077,7 +51076,7 @@ var BABYLON;
|
|
|
* @param loop defines if the current animation must loop
|
|
|
* @param speedRatio defines the current speed ratio
|
|
|
* @param weight defines the weight of the animation (default is -1 so no weight)
|
|
|
- * @returns a boolean indicating if the animation has ended
|
|
|
+ * @returns a boolean indicating if the animation is running
|
|
|
*/
|
|
|
RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, weight) {
|
|
|
if (weight === void 0) { weight = -1.0; }
|
|
@@ -51086,18 +51085,18 @@ var BABYLON;
|
|
|
this._stopped = true;
|
|
|
return false;
|
|
|
}
|
|
|
- var keys = this._animation.getKeys();
|
|
|
- // Return immediately if there is only one key frame.
|
|
|
- if (keys.length === 1) {
|
|
|
- this.setValue(keys[0].value, weight);
|
|
|
- return !loop;
|
|
|
- }
|
|
|
var returnValue = true;
|
|
|
+ var keys = this._animation.getKeys();
|
|
|
// Adding a start key at frame 0 if missing
|
|
|
if (keys[0].frame !== 0) {
|
|
|
var newKey = { frame: 0, value: keys[0].value };
|
|
|
keys.splice(0, 0, newKey);
|
|
|
}
|
|
|
+ // Adding a duplicate key when there is only one key at frame zero
|
|
|
+ else if (keys.length === 1) {
|
|
|
+ var newKey = { frame: 0.001, value: keys[0].value };
|
|
|
+ keys.push(newKey);
|
|
|
+ }
|
|
|
// Check limits
|
|
|
if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
|
|
|
from = keys[0].frame;
|