How to get the animation when loading the model using objectLoader?

How to get the animation when loading the model using ObjectLoader?

The animations of a 3D object are stored in Object3D.animations.

Notice that ObjectLoader can only load animations if the animation clips were placed in Object3D.animations before calling toJSON().

I imported FBX with animations, and then I used the editor to convert it to JSON, but object3D. animations display length is 0 after loading, but after I re-imported the editor, it shows animations. What is the problem?
微信截图_20220712155350
微信截图_20220712155432

Do you mind sharing the FBX asset in this topic?

1 Like

Cabinet_Precision.json (5.8 MB)

Sorry, I can’t reproduce. When importing the JSON, the animation clip is where it is supposed to be:

image

Are you using the latest three.js version in your project?

I used 141

I guess you have to reproduce the issue with a live example/demo.

After my experiment, I found that the animation disappeared after cloning, what is the reason?
“let newModel = this.PoolItemDic.get(modelName).clone();”