Manuel Graf
Manuel Graf

Reputation: 528

Access Object3D Mesh Material in THREE.js r115

I am used to alter Objects3Ds Materials in the THREE.js scene graph.

Now i switched to typescript and have some troubles accessing Mesh Materials (after creation)! The docs and types state that there is no Object3D.material

I also dont see the .material anywhere on the Object3D during runtime!

To make it work with Typescript - can I just to cast it to Mesh? Or how do I access the Mesh from Object3D?

Upvotes: 0

Views: 2627

Answers (1)

2pha
2pha

Reputation: 10165

The material is on the Mesh object, which is inherits Object3D.

Check the docs of Mesh here

Upvotes: 1

Related Questions