GrosSacASacs Posted April 24, 2016 Share Posted April 24, 2016 In BabylonJs there are many constructors that require a name like var box1 = BABYLON.Mesh.CreateBox("Box1", 10.0, scene); Where "Box1" is the name. Why is this useful ? How can we use "Box1" later ? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 24, 2016 Share Posted April 24, 2016 Hi GSAS! Yes, take a look here... http://doc.babylonjs.com/classes/2.3/Scene Now use your browser's "search this page" feature... for 'byName'. You'll see that there are many "byName" methods. If your project doesn't need any getMeshByName calling, then mesh names are not important for any other reason. You can have many mesh with the same name... in a scene. Under nearly ALL circumstances, it doesn't matter. When using a loop to produce an array of meshes, many people add the loop's indexer to each mesh name... like this: http://playground.babylonjs.com/#2JKYWK#1 Perhaps others will have different opinions, though. I may have forgotten some issues, but I don't think so. You can also add tags to scene items, and use our powerful get-by-tags system. It is MUCH more versatile than getByName or getById methods. Quote Link to comment Share on other sites More sharing options...
fenomas Posted April 24, 2016 Share Posted April 24, 2016 My short answer: names are necessary if you import a scene - e.g. because it was made in Blender, or because you've loaded a scene that was previously serialized. If you're just creating a scene and managing your own references then you don't need to worry about them. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
joshcamas Posted April 24, 2016 Share Posted April 24, 2016 Consider them as a tag, or an identification. Use them only if you wanna. GameMonetize 1 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.