diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js index 9c0586953e5d..2a9860c27e1a 100644 --- a/Source/Scene/Batched3DModel3DTileContent.js +++ b/Source/Scene/Batched3DModel3DTileContent.js @@ -18,6 +18,7 @@ import Cesium3DTileFeatureTable from "./Cesium3DTileFeatureTable.js"; import ClassificationModel from "./ClassificationModel.js"; import Model from "./Model.js"; import ModelUtility from "./ModelUtility.js"; +import ModelAnimationLoop from "./ModelAnimationLoop.js"; /** * Represents the contents of a @@ -432,6 +433,11 @@ function initialize(content, arrayBuffer, byteOffset) { sphericalHarmonicCoefficients: tileset.sphericalHarmonicCoefficients, specularEnvironmentMaps: tileset.specularEnvironmentMaps, }); + content._model.readyPromise.then(function (model) { + model.activeAnimations.addAll({ + loop: ModelAnimationLoop.REPEAT, + }); + }); } else { // This transcodes glTF to an internal representation for geometry so we can take advantage of the re-batching of vector data. // For a list of limitations on the input glTF, see the documentation for classificationType of Cesium3DTileset. diff --git a/Source/Scene/ModelInstanceCollection.js b/Source/Scene/ModelInstanceCollection.js index 120f77cb4fed..2c5ab96ebc31 100644 --- a/Source/Scene/ModelInstanceCollection.js +++ b/Source/Scene/ModelInstanceCollection.js @@ -26,6 +26,7 @@ import ModelInstance from "./ModelInstance.js"; import ModelUtility from "./ModelUtility.js"; import SceneMode from "./SceneMode.js"; import ShadowMode from "./ShadowMode.js"; +import ModelAnimationLoop from "./ModelAnimationLoop.js"; var LoadState = { NEEDS_LOAD: 0, @@ -997,9 +998,15 @@ ModelInstanceCollection.prototype.update = function (frameState) { this._instancingSupported = context.instancedArrays; createModel(this, context); var that = this; - this._model.readyPromise.otherwise(function (error) { - that._state = LoadState.FAILED; - that._readyPromise.reject(error); + this._model.readyPromise.then(function (model) { + model.activeAnimations + .addAll({ + loop: ModelAnimationLoop.REPEAT, + }) + .otherwise(function (error) { + that._state = LoadState.FAILED; + that._readyPromise.reject(error); + }); }); }