Materials Do Not Found When Importing .obj From Blender

The model I have used to work perfectly until I renamed some objects and their materials. For examples I renamed “logo_Back_Number” into “logo_Number_Back”, I rename everything nested to the object.

Then when I exported the file to .obj and being loaded into babylon scene, the “scene.materials” does not contains all of the materials, it only contains the materials that I did not rename.

And this is my “.mtl” file:

# Blender MTL File: 'jersey.blend'
# Material Count: 6

newmtl <name>_O_Neck_Primary
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd jersey-texture.png

newmtl <name>_O_Neck_Secondary
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.000000 0.000000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 1

newmtl logo_Name_Back
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1

newmtl logo_Name_Front
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1

newmtl logo_Number_Back
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1

newmtl logo_Number_Front
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1

Please help.

Do you have any network errors? (F12 console)

I just realize the problem was with the browser caching. Even though I use the manifest file, the texture does not get updated when the manifest file version is changed. The 3D model itself is updated when the manifest file gets updated, but the texture does not.

{
  "version": 102,
  "enableSceneOffline": true,
  "enableTexturesOffline": true
}

Do you have any idea what is happening?

I found a warning:

"A cookie associated with a cross-site resource at htt://babylonjs.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at Cookies default to SameSite=Lax - Chrome Platform Status and https://www.chromestatus.com/feature/5633521622188032."

Please advice

We do not use cookie:)
So it must come from a different source

I realize I have cookie from localhost & production site which has the same name

1 Like