Why do animated GLBs auto-start their animations (loading via SceneLoader.LoadAssetContainer), and how can I prevent this? I see the Animations in the container, but no Animatables that I can use to stop the animations started by the loader.
You can configure the GLTF loader to NOT start animation:
BABYLON.SceneLoader.OnPluginActivatedObservable.add(function (loader) {
if (loader.name === "gltf") {
loader.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.NONE;
}
});
3 Likes
Got it, thank you!
And for those like myself working in Typescript:
( loader as GLTFFileLoader ).animationStartMode = GLTFLoaderAnimationStartMode.NONE;
4 Likes
In TypeScript, we get animationStartMode does not exist on type ISceneLoaderPlugin | ISceneLoaderPluginAsync
. I hacked around it with: (<any>loader).animationStartMode = ...
.
Can you provide a repro in the typescript playground, also those options can now be passed in the load call instead.