ChrisR Posted September 9, 2015 Share Posted September 9, 2015 Sorry for my noob ignorance to all things Github and how to do pull requests and keep updated babylon code and yadayada.. So i had to make a change to a babylonjs file. I'll add my code change here and if someone wants to add it themselves they can. I assume that the way materials were handled has been changed, but it wasn't updated in the sceneSerializer. // Materials serializationObject.materials = []; serializationObject.multiMaterials = []; for (index = 0; index < scene.materials.length; index++) { var material = scene.materials[index]; if (material instanceof StandardMaterial) { serializationObject.materials.push(serializeMaterial(<StandardMaterial>material)); } else if (material instanceof MultiMaterial) { serializationObject.multiMaterials.push(serializeMultiMaterial(<MultiMaterial>material)); } }The update deals with the fact that multimaterials are there own object in scene, rather than a type located under materials. // Materials serializationObject.materials = []; for (index = 0; index < scene.materials.length; index++) { var material = scene.materials[index]; serializationObject.materials.push(serializeMaterial(<StandardMaterial>material)); } // MultiMaterials serializationObject.multiMaterials = []; for(index = 0; index < scene.multiMaterials.length; index++){ var multiMaterial = scene.multiMaterials[index]; serializationObject.multiMaterials.push(serializeMultiMaterial(<MultiMaterial>multiMaterial)); }Cheers. Also, if anyone could point me in the right direction to have a git working so that i keep updated with the latest babylon files (typescript) rather than just downloading the zip each time and extracting it. Would be appriciated. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 9, 2015 Share Posted September 9, 2015 Cool! I update the code..Thanks for the fix 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.