devbot Posted September 2, 2015 Share Posted September 2, 2015 Hi all I have a computer model in 3ds max, with the screen having a material id of 1. After 30 frames this swaps to material id 2, then 3 and so on.Creates a slideshow effect on the computer screen. All well and good, but I see this is not exported to babylonjs and thus I'd say not supported. My assumption for replicating this, is to swap out the texture map on the submesh in babylonjs?? How would I achieve this. I have the 3 screens as jpg's and also can see the submeseh in the babylon mesh object.I can also see all 4 of the sub materials are exported. My feeble attempt was something along the lines ofmesh.subMeshes[0].diffuseTexture = mesh.material.subMaterials[3];I had a look at multisub objects and this, but I couldn't make light of it for my needs. Quote Link to comment Share on other sites More sharing options...
devbot Posted September 2, 2015 Author Share Posted September 2, 2015 I worked it out, Typically just after posting. I was close. mesh.material = mesh.material.subMaterials[3]; Quote Link to comment Share on other sites More sharing options...
devbot Posted September 2, 2015 Author Share Posted September 2, 2015 Even better is mesh.subMeshes[1].materialIndex = 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 2, 2015 Share Posted September 2, 2015 Good job Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.