Pierre Bonjour Posted January 20, 2017 Share Posted January 20, 2017 Hello, I have a small experience in WebGL but I am totally new to Babylon.js, I hope I am not loosing your time with a basic question that has already been answered... Many functions of the framework ask for a name as first parameter : like for example "sphere1" in BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene); Sometimes, like in the babylon playground in example 17 (called Actions), all omni lights have the same name "omni" : var light1 = new BABYLON.PointLight("omni", new BABYLON.Vector3(0, 50, 0), scene); var light2 = new BABYLON.PointLight("omni", new BABYLON.Vector3(0, 50, 0), scene); var light3 = new BABYLON.PointLight("omni", new BABYLON.Vector3(0, 50, 0), scene); It looks like these names are not used afterwards in our code, are they used internally ? When I use the same name for all my objects it looks like it doesn't change anything, but I haven't made extensive testing, do you know what it is really used for internally ? For example in the particule module, all particules have a different name ? Thank you very much for your answer, and once more I hope I am not asking a question that has already been answered many times... Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 20, 2017 Share Posted January 20, 2017 Hello Pierre, There is no usage internally but scene.getMeshByName (same for getXXXByName). Pierre Bonjour 1 Quote Link to comment Share on other sites More sharing options...
Pierre Bonjour Posted January 20, 2017 Author Share Posted January 20, 2017 Hello Temechon, Thank you so much for your answer ! If I understand correctly it means that the name is not important if I don't plan on using it later ! Ok perfect thats convenient because I was afraid that the names were used to cache what has been drawn in order not to rebuilt it from scratch when the same name is detected or things like that, that would require a new name for each new object ! Have a great week-end ! Quote Link to comment Share on other sites More sharing options...
Temechon Posted January 20, 2017 Share Posted January 20, 2017 It can be useful to debug though, as you can see mesh names in the debugger. Great weekend to you too buddy 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.