MultiMaterial hasTexture always false

I was looking through the Babylon.js code and saw that MultiMaterial doesn’t override the method hasTexture which I take to mean that it will always return false when called as that is what Material returns and MultiMaterial extends Material. MultiMaterial does override the getActiveTextures method which will call down to each Material to get each of its Textures.

Is this by design or should hasTexture be overridden in MultiMaterial to make a call to getActiveTextures and loop over each until it finds the Texture/returns true or doesn’t find it and returns false? Or… is there something I am missing?

I would say we should provide an override that works as you describe, but I will let @sebavan tell.

I wouldn’t mind trying my hand at a PR for this relatively minor issue when I return home from work today. Will read up on the contributing guidelines and such. Assuming @sebavan approves of the override, of course.

Looks missing to me as well, a PR would be awesome @Vampiro

Fixed in this PR and merged into master.

2 Likes