MackeyK24 Posted March 13, 2018 Share Posted March 13, 2018 What the best way to get the filename of the scene that was loaded... Not the scene.database.currentSceneUrl but the actual "sceneFilename" that get passed to the SceneLoader.Load(). It get used ALOT internally in babylon.SceneLoader but the engine actually STORES the sceneFilename. yo @Deltakosh do you think we can store the sceneFilename from the SceneLoader.Load() on the scene and expose some kind of scene.filename property ... Not the ImportMeshes, but just the main SCENE LOAD FILENAME Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 13, 2018 Share Posted March 13, 2018 You can use the metadata for this. scene.metadata = {fileName: '***'}; And get name : scene.metadata.fileName; Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted March 13, 2018 Author Share Posted March 13, 2018 2 hours ago, Dad72 said: You can use the metadata for this. scene.metadata = {fileName: '***'}; And get name : scene.metadata.fileName; Yeah i know i can do that... but then i will only be able to get the scene Filename from a Scene that i actually serialize with the scene filename. But that might be how i have to go about it, and just use"unknown.babylon" for scene files that i do not create Would be sweet if the scene had a scene.filename or something that contained the filename of the first scene loaded via SceneLoader.Load and NOT SceneLoader.ImportMeshes Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 14, 2018 Share Posted March 14, 2018 or you could always suggest a PR to your problem and we will consider it I don't see any reason to expose the scene file name (mainly since it is a variable provided by you, that can be tracked by you as well), but if you provide a proper use case for that, why not? 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.