How to reference imported texutes, materials etc in the Editor?

I added some textures using View > Texture Viewer > Add in the Desktop BabylonJS Editor
and see them in the texture viewer like “SkyBlue2_px.png” etc

But how do I reference them in scripts? I tried

skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("SkyBlue2", scene, ["_px.png", "_py.png", "_pz.png", "_nx.png", "_ny.png", "_nz.png"]);

and get the file not found error when running the scene with “Play and Debug”

is there some good tutorials on the editor which cover such topics? I couldn’t find any. Is there some tutorial on the typical workflow when using the Editor? I mean how to start the project, how to tie multiple scenes together, …, build and release everything to production? You can’t just create the project from scratch with ts/js/html and then open it in the editor can’t you?

Hello and welcome!
Please let me introduce you with @julien-moreau who is the Editor author

Hi @Bob ! Thanks for using the editor !
The scripts documentation may miss some informations like this one. Will share with you an example to retrieve assets.

Would you prefer to add the skybox using the editor or is it needed to create it using a script ?


Here is the available Editor documentation Babylon.js Documentation

Here you can find how to export a template for developers (last section) Loading and Saving Scenes - Babylon.js Documentation

And here some informations about scripts I am going to improve: Writing Custom Scripts - Babylon.js Documentation

@Bob, the editor exposes some tools that you can use in your scripts.
The variable “tools” is available in all scripts as a global variable. In your case, the tools object provides a method that allows to retrieve the files Urls (according to if the game is “in test” or “in production”) like this:

const sb = new CubeTexture(“Space”, this.scene, null, false, [

Hope this will help. I’m improving the documentation to include all these informations