Skip to content

Setting material on render component #6895

Answered by mvaligursky
LeXXik asked this question in Q&A
Discussion options

You must be logged in to vote

This is the way it was done on the model component a long time ago, and render component uses it the same way.

This is only used for built-in shapes, I assume to simplify access to meshInstances[0].material. Asset can have multiple mesh instances, so a single material does not make sense. Especially a getter would not work in that case.

I agree it's not a great API, and one day we should probably just remove it / replace by setMaterial(index, material) and getMaterial(index)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LeXXik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants