Bhupi Posted January 27, 2017 Share Posted January 27, 2017 Hi. I imported a few 3D objects via .babylon files. Eg: BABYLON.SceneLoader.ImportMesh("", "assets/", "myobject.babylon", scene, function(newMeshes) { // play around with position, apply textures and clone at different positions var object_mesh = newMeshes[0]; var object_mesh_cloned = object_mesh.clone("cloned_object"); }); I cloned the object and placed it in different positions. I used the C# executable (had to do a slight code change to make it work as the default code was failing when reading args passed to it) and created incremental files. I imported the incremental babylon: Eg: BABYLON.SceneLoader.ImportMesh("", "assets/", "myobject.incremental.babylon", scene, function(newMeshes) { // play around with position and apply textures var object_mesh = newMeshes[0]; var object_mesh_cloned = object_mesh.clone("cloned_object"); }); The issue is that the cloned objects do not appear when I tried cloning via the incremental route. Is it because the meshes are not loaded? Can there be a callback when the actual meshes have been loaded so that those can be cloned? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 27, 2017 Share Posted January 27, 2017 Hello you are correct, you have to wait for the mesh to be loaded first (mesh.isReady()) Quote Link to comment Share on other sites More sharing options...
Bhupi Posted January 28, 2017 Author Share Posted January 28, 2017 Thanks. I used registerAfterRender to create clones (with a global variable to store the clone status so that same clones are not made recursively). 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.