I need some help to set up the AnimationExtension using custom options to play automatically the animation as soon the model is loaded on the viewer.
So far I loaded the Autodesk.Fusion360.Animation extension and set the viewable to the Fusion animation one (through its id, found in the manifest). If I try to play the extension from the console I can get the Autodesk.Fusion360.Animation extension and in the callback using play() or activate(); but if I try to do that from the code it's not working. Here is my code:
viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, (x) => {
viewer.loadExtension('Autodesk.Fusion360.Animation').then((y)=> {
y.options.startOnInitialize=true;
y.activate();
y.play();
})
});
From the options I see there is the startOnInitialize property, but maybe I can't set the options to the builtin extension: I found this post about the options in the extensions and the tools...but I don't understand how to apply it in the code, in relation to a basic viewer.
Can you please give me info or a snippet to autoplay a Fusion animation in the viewer and set additional options to the extension?
Thanks
Autodesk.Fusion360.Animation
extension
enabled from the beginning.Autodesk.Viewing.ANIMATION_READY_EVENT
to the viewer.