SceneLoader.Load Filename

Recommended Posts

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


Share this post

Link to post
Share on other sites
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


Share this post

Link to post
Share on other sites

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?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.