SpaceToast Posted January 30, 2018 Share Posted January 30, 2018 What is the best way to get the results--the appended bits--from BABYLON.SceneLoader.Append() ? The function for a single model, BABYLON.SceneLoader.ImportMesh(), and the function to load a new scene BABYLON.SceneLoader.Load(), both return their result, but Append() seems to only return the existing scene. I believe I understand the concept in this thread--mark everything that's already loaded before calling BABYLON.SceneLoader.Append(), at which point everything that's not marked can be assumed to come from the file load. The trouble is, if multiple files are being loaded, there's no guarantee that all of the new meshes, lights and cameras in the scene come from the same file when onSuccess fires. (This is assuming file loading happens async.) I suppose it would be possible to use BABYLON.SceneLoader.Load() to instead put the results into a new (hidden) scene, loot that scene for parts to the main scene, then delete it. That feels like a lot of overhead though. Any better ideas? [Peeling this out into its own topic, as Q&A threads don't "bump" anyway!] Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 30, 2018 Share Posted January 30, 2018 I think the hidden scene has potential, especially if all the entities are disabled then they do not add to draw calls which is the main overhead you need to monitor. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 30, 2018 Share Posted January 30, 2018 We have what you need now Please let me introduce you to the AssetContainer: http://doc.babylonjs.com/how_to/how_to_use_assetcontainer Pryme8 1 Quote Link to comment Share on other sites More sharing options...
SpaceToast Posted January 31, 2018 Author Share Posted January 31, 2018 I'll migrate over to the 3.2 preview and experiment with it! Looks like a great tool. 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.