shikitos
shikitos

Reputation: 92

How to create or refer to animations from scripts in three.js/editor?

Have a nice day! I want to ask you - how can I create an animation for a model (or find an existing one created from a 3d editor: Maya, Blender, etc.)? Or how can I refer to it from scripts (that the most important feature for me)? Please, help!

Upvotes: 2

Views: 205

Answers (1)

Mugen87
Mugen87

Reputation: 31046

Full animation support in the editor was added with r123. Animation clips of a 3D object are now stored in Object3D.animations.

When importing an animated asset via glTF, FBX or Collada, its animations will be stored in the top-level node's animations property. E.g. gltf.scene.animations.

In the editor, you can access these animations by adding a script to the respective node and then use this.animations in the update() function.

Upvotes: 2

Related Questions