Turiim Posted September 27, 2017 Share Posted September 27, 2017 Hello Babylon Fans, I was hoping you all would be able to help. I am not sure what I am doing wrong, but I am trying to merge a custom mesh and an instance of that custom mesh. Then I uncommented the merging function my whole website crashed. Here is an example:https://playground.babylonjs.com/#JVQXIM#1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2017 Share Posted September 28, 2017 Hello, "scene.getMeshesByTags("merge")" ==> this returns no meshes Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 28, 2017 Share Posted September 28, 2017 Obviously the point @Deltakosh made is one important issue why it does not work. Swapping for clone rather than instance and putting in the two meshes as an array into mergeMeshes works https://playground.babylonjs.com/#JVQXIM#2 However in the above playground that works and swap back clone to createInstance then the PG does indeed crash. I am guessing but probably something recursive is happening because of the way the geometry of instances is stored. Not just custom meshes either, this PG with clones is OK https://playground.babylonjs.com/#JVQXIM#3 but change from clone to instance and my laptop locked up until I could remove the PG and then had to wait. This appears to have been solved in the past but looks like some changes somewhere have reinstated it. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2017 Share Posted September 28, 2017 Yep I forgot to mention it: instances cannot be merge as they are reference to a root mesh. So it kind of like trying to merge yourself with yourself Quote Link to comment Share on other sites More sharing options...
Turiim Posted September 29, 2017 Author Share Posted September 29, 2017 Hello, sorry, I forgot to change "scene.getMeshesByTags("merge")" to [mesh1, mesh1_instance].... Ahh ok, I will just use the cloning function then. Thanks for the responses 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.