PhotoDome and variable does not work for the relative path?

Just to understand your situation better, you want to create the PhotoDome when you click on another mesh?

Correct. I do the … = new PhotoDome(){}… set it up. But use a variable between ‘./assets/’ + variablehere + ‘.jpg’ and for example, I just tested and it shows (this time) “GET http://localhost:8080/assets/.jpg 404 (Not Found)” See how it did not fill in the variable? Well, the console.log() shows the proper image file name (I named the blender object the same, case and call to make it easier in code).


Check if the file name and your ‘mesh name’ are really the 100% same, they are case sensitive.

"./assets/" + clickedMesh + ".jpg",  // does not work
// "./assets/LocationCollisionCubeA.jpg",  // works

Current test code I’m using. Copy and pasted here.

Thanks @labris, I’ve checked repeatedly. I’ve checked the images file name in assets. All look exactly the same. That’s what’s got me scratching my head.

What is the value of this variable in the console?

And if I dump the manually typed string along with the concatenated string, they look identical in the console.log() area. Weirdest thing I’ve seen in a long time.

I’ve even done repeated CTRL+F and pasted in the variable to make sure it’s being used (typed properly) across the entire .ts file.

Sorry about the repeated posts. But making sure I give all the information I can around the issue.

clickedMesh = pickResult?.pickedMesh?.name.toString();

That is how the variable starts out. On the onPointerUp for one of several similar meshes. The idea is that the mesh name is taken, and as you can see I add the strings before and after to complete the relative path to the image file in assets. I do check with typeof that the variable is a string. Console.log() that it’s the proper and case-correct string value.

I even went back into the blend file, removed the material and put a simple (make it, apply it) material, keeping the same name. Just in case there is some unsupported aspect of the material from within typescript or Babylon JS, etc.

Most of the time the weirdest things have very simple explanations :slight_smile:

1 Like

That’s what I find as well.

Here - - if you click on box, the new PhotoDome will be loaded based on the box name.

That test in the PG worked. I’ll look it over to see if there is anything else that could help my offline test. Thanks @labris.