Compression is important for our products, however. I would like to try MeshOpt but when I select that I get the following error when running the app: “index.a4cb4246.js:3962 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘extensions’)
at Q9.loadMaterial (index.a4cb4246.js:3962:68618)
at index.a4cb4246.js:3962:62387
at Q9._invokeOne (index.a4cb4246.js:3962:61724)
at Q9.getDependency (index.a4cb4246.js:3962:62339)
at Yk (index.a4cb4246.js:3229:1721)
at WM (index.a4cb4246.js:3229:965)
at $x.createComponents (index.a4cb4246.js:3962:92413)
at $x.afterRoot (index.a4cb4246.js:3962:92144)
at async Promise.all (:8000/index 3)”
by user 420944948767227905
That happens with the scene you already sent I guess?
I have changed it a bit. I’ll send you the new one.
by user 420944948767227905
So first finding: these two seem to be causing the issue (one of the objects inside). A workaround is to turn them into nested gltf objects by adding another GltfObject component with mesh compression set to None. Will try to figure out which object exactly is causing the problem but perhaps you can continue testing with that info for now
Btw just a side note that I noticed: there are a lot of assets in the scene with a ton of materials. When you look into optimization your app would probably benefit a lot from merging them into one mesh+material since each sub-material will result into additional draw calls
OK I set the offending desk to use Draco compression instead and it worked! Thanks!
by user 420944948767227905
Since one compression method works with some objects and one works with other objects could your error message return the name of the bad object so that we can easily find which one is breaking the builds?
by user 420944948767227905
(And yes, in our released builds we always bake scenes as you describe: This scene is experimental)
by user 420944948767227905
It’s an error produced by the compression library that we used. I already opened a PR on their side to get at least the material name that the problematic mesh is using (the mesh name wasnt available anymore at this point)
Then you might not have the issue with the optimized scene. I reproduced it with just one object (Book5) and opened some issues about that as well in the library so we can figure out why this happens (the compression removes some materials which is unexpected)
Great! Thanks! We can move forward now.
by user 420944948767227905
The latest update catches the error with the mesh-opt compression so it should at least not break completely anmore and instead log some additional info where the error happened. It’s not a fix obviously (since the root cause is elsewhere) but more actionable
I have updated to the latest version but am still experiencing problems with mesh-opt. I just sent a bug report with a scene with 2 male characters wearing a white shirt. If exported as production and run on a local server, I see the errors in this image:
by user 420944948767227905
I also submitted a second report for the following problem. Same error message, different cause (character animated by timeline)
by user 420944948767227905
Weirdly, if I drill down on the error message, it seems to be complaining about the last object with a mesh in the scene tree, Art (1) - if I delete this, it then complains about whatever the new last object is! Off-by-1 error maybe?
by user 420944948767227905
by user 420944948767227905
The additional debug information is very useful @Marcel_Wiessler1
!
by user 420944948767227905