Jump to content

SceneLoader.Load Filename


MackeyK24
 Share

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

 

Link to comment
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

 

Link to comment
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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...