Bug when loading a scene with objects which have the same name for a material

Hi,

I have a bug when loading a scene with 2 objects which have the same name for a material (its name is “material0”). The textures are not ktx2 textures.

Step 1:

I load the truck (green) and the car (red)

Step 2 : -Control with the inspector

  • “material0” for the truck

  • “material0” for the car

Step 3 : - Saving the scene in the .babylon format

Step 4: - Loading the scene again and… Tadaa… :wink:

If i load the car before the truck, the result after the four steps is :

image

So I assume that the texture is saved using the name of the material and not its unique ID because only the first declared material is saved.

If anybody could help…

Thanks in advance,

Boris

including the 2 objects in zip files
Camion.zip (6.4 MB)
Voiture_5.zip (5.4 MB)

Adding @bghgary , one of the experts… :pray:

Please create a repro in the playground for it so we can have a look quicker :slight_smile:

I am pretty sure the texture name is the same in both files which might somehow breaks export ??? @carolhmj worked on it recently so she might be able to take a look once you have a repro setup.

Here it is :

When you upload the saved file test.babylon in the sandbox, here’s the result :

Thanks for your help.

1 Like

Yep that’s exactly what happens, the same was asked here: Incorrect textures on uploaded models - Questions - Babylon.js (babylonjs.com)

Is there an issue on Github or do you want me to write one ?

Nope there isn’t one currently :thinking: Do you want to open one?

No need :wink: Fix base64 texture parsing with similar names by sebavan · Pull Request #12922 · BabylonJS/Babylon.js · GitHub

2 Likes

Awesome !!!

Thanks very much.

I assume it will be available within one or two days ?

1 Like