GLTF: Dynamic animation speed

Hello,

I’m trying to show N instances of a gltf model with an animation inside. This animation should change its speed based on a variable that floats from 0 to 3+ every 20ms.

What I’m trying to do is something like this:

model.activeAnimations.addAll({
speedup : new Cesium.CallbackProperty(function () {

return windStrength;

            }, false),

loop : Cesium.ModelAnimationLoop.REPEAT
});

``

or

model.activeAnimations.add({

name: “animation_0”,
speedup : new Cesium.CallbackProperty(function () {

return windStrength;

            }, false),

loop : Cesium.ModelAnimationLoop.REPEAT
});

But it doesn’t work. I’ve tried by removing and adding the animation with the updated speed but it also doesn’t work.

How can I achieve this?

Hello,

I don’t believe model animations support using a CallbackProperty. Properties like the CallbackProperty can only be used at the entity level.

Instead, I think you have to remove the old animation and add a new one every time you want to change the value.

Best,

Hannah