Closed Vinc3r closed 4 years ago
weird, in local server both objects have their materials with new texture assigned, but on codesandbox it seems random
I've update console.log to better see what happens. It seems on "material" level, we have the mesh name, but in case of submaterials we can't. I have also to try parsing "subMeshes", then "materials" in them, to see if it's work.
I've update my github repo, so codesandbox is up to date too: on subMaterials level, when targetting a property (here albedoTexture), we still not getting our material but the subMaterials array
Note that codesandbox do not load the texture on the material case (subMesh
asset in the scene), but in local webserver it's working:
"*:mesh": {
material: {
"albedoTexture": function (var1, var2, var3) {
return _r.load.texture("assets/checker.jpg");
see: https://codesandbox.io/s/github/Vinc3r/codesandbox-project/tree/master/BabylonJS/_runtime/cycle-through-patches/bjs?fontsize=14&hidenavigation=1&module=%2Fcycling-through-meshes.patch&theme=dark
(embeded link for sharing issue)
repo on Github: https://github.com/Vinc3r/codesandbox-project/tree/master/BabylonJS/_runtime/cycle-through-patches/bjs
Take a look on cycling-through-meshes.patch >> be able to get current mesh in the albedoTexture function could be useful to automate texture assignation process (especially for lightmaps, with mesh name detection).