r117 introduced generics for Meshes. It was supposed to be a non-breaking change and not much focus has been put on it in the release notes. Unfortunately, it is a breaking change : I have at least one codebase that compiles on r116 that doesn't compile on r117 due to this.
The compiler complains about InstancedMesh not accepting anymore an array of materials in the constructor. I checked the three.js codebase and it looks to me that nothing changed internally, i.e. array of materials was supported in r116 and should still be supported in r117. So I think this is an oversight in the InstancedMesh.d.ts file which lacks the Material | Material[] type definition.
I can submit a pull request with the trivial fix as soon as somebody closer to the development of the library confirms my assumptions. Thank you !
Your guess sounds right to me — could you confirm that Mesh is compiling with Material[] correctly, and it's just InstancedMesh that has this issue in TS?
If so a PR would be welcome, thanks!
(Assuming InstancedMesh really does support multiple materials? I haven't tested that...)
Well, I have InstancedMeshes with an array of two materials and it renders the InstancedMesh correctly. So I guess it qualifies as being "really supported" by three.js, right ?
The following live example demonstrates that InstancedMesh does support multiple materials.
Most helpful comment
The following live example demonstrates that
InstancedMeshdoes support multiple materials.https://jsfiddle.net/8uhr16gc/2/