When loading assets for a 3D Model at runtime with an animation track that includes Morph Animation, the Morph animations seem to be lost. This is an issue, since you may not want to load any assets of a 3D model until needed.
But when using Preload on the container and template of the 3D Model, the morph animations do load. When then all asstes are unloaded and then loaded again an error is thrown when launching with debug mode with versions prior to 1.62 (the error vanishes in 1.62 but the problem doesn't):
morph-instance.js:197 Uncaught TypeError: Cannot read properties of null (reading '_targets')
at MorphInstance.setWeight (morph-instance.js:197:55)
at Array.func (default-anim-binder.js:94:47)
at AnimTarget.callSetters [as _set] (default-anim-binder.js:104:39)
at AnimEvaluator.update (anim-evaluator.js:264:35)
at AnimController.update (anim-controller.js:582:29)
at AnimComponentLayer.update (component-layer.js:257:26)
at AnimComponent.update (component.js:732:28)
at AnimComponentSystem.onAnimationUpdate (system.js:84:31)
at ComponentSystemRegistry.fire (event-handler.js:201:26)
at Application.update (app-base.js:1171:22)
Steps to Reproduce
Morph anim Lost after asset unload & load with Container and Template preloaded
Description
When loading assets for a 3D Model at runtime with an animation track that includes Morph Animation, the Morph animations seem to be lost. This is an issue, since you may not want to load any assets of a 3D model until needed.
But when using Preload on the container and template of the 3D Model, the morph animations do load. When then all asstes are unloaded and then loaded again an error is thrown when launching with debug mode with versions prior to 1.62 (the error vanishes in 1.62 but the problem doesn't):
Steps to Reproduce
Morph anim Lost after asset unload & load with Container and Template preloaded
Morph anim never loaded when Container and Template are not preloaded
Project for reference: https://playcanvas.com/project/1055497/overview/morphtester