Upgrading from alpha.37 to alpha.61 - multiple issues :(

It broke my thin instances. They started to appear at wrong places. Also the scaling and the rotation is totally off.

v37 screenshot, all in place:

v61 screenshot:
I’ve marked a few pieces with the arrows. You can see floating tables and chairs all around.

Any idea why is this not working with v61?

The second thing broken is the navigation plugin:
EDIT: No longer applies. I’ve fixed this one, I needed to change the injected Recast object.

The third one is:
This is back again: SceneLoader.ImportMeshAsync is blocking all tabs in the browser

I’m using this hack suggested by @jeremy-coleman. :vulcan_salute:
This has stopped to work or there is something else in v61.

    SceneLoader.OnPluginActivatedObservable.addOnce((loader: any) => {
      loader.useSRGBBuffers && (loader.useSRGBBuffers = false)

Any suggestions are welcome!

Thank you!



Hmm. My first thoughts:

  1. Try changing the observable.addOnce to .add. Change back to addOnce if it doesnt do anything, just seems like low hanging fruit to rule out first.

  2. Try installing the v.37 loaders with v.61 core and visa versa to confirm results, then report back if broken for each. That way we can know which module the affecting change is in and where to start looking.

  3. Start at v.37 and incrementally bump the version until it breaks and report back, we can look for changes between those versions only and find the cause much quicker. You can use codesandbox for this btw, incase your net is prohibitively slow.



  1. it is working with add :smiley: This was a real PRO tip, thank you! Seems that the observable is called more than once in v.61. Was it an intention or is it a bug? Do someone know? Should we bother or not? :slight_smile:

Thanks again!

@roland, would be great to see a repro for this.

Adding @Evgeni_Popov for thin instances as it is his baby :slight_smile:

1 Like

Yes a repro would be great for the thin instances problem.

As for #3 I think it is expected, the observable can be called more than once.

1 Like

Here is another case of scene loading ok in alpha37 or 4.2.0 but not in latest

1 Like

I will try to find out the reason myself and will let you know.

Edit: I thought someone will come up with an idea quickly after looking at the screenshots.

The big meshes in the front on the screenshot are the meshes used as prefabs and they used to hide after adding thin instances to them. Still investigating…

This does not load for me in 4.2 in the Playground (nor in 4.1): the loading logo of Babylon.js never goes away.

just press the run again

Yes, there is a quite huge difference :stuck_out_tongue:

I have a solution finally. The problem is not with the thin instances. I had to add mesh.computeWorldMatrix(true) before I read the original rotation/position/scaling of the mesh which is going to be replaced by a thin instance. Without this line I got not initialized crazy values. But this was working in v.37 without forcing the computation so somewhere between v.37 and v.61 the matrix computation was removed. Not a big deal :slight_smile:

Thank you to all for participating! :vulcan_salute:

1 Like

I am not doing thin instances.
Looks like some other issue goin on in 61.

1 Like

Yes, I can see. Maybe you should open a new topic with your issue to get more attention. I am curious what is happening too.

If I revert these changes from babylonFileLoader.ts from this commit it does work:

Fix #11382 on 2021/11/04 by @Deltakosh

@Deltakosh Do you know what could have happened? Is it possible there are some incompatibilities with those changes and .babylon files created before this commit?

On my phone right now but that commit is supposed to be transparent as if it is used with files created before it they will not have the uniqueId info and thus we should call the same code

Even though the changes in babylonFileloader.ts could have manifest the issue, the root cause could be related to something else, possibly at or above SceneLoader in the dependency tree. We know that the SceneLoader is being called multiple times, as evidence by the requirement to use .add instead of .addOnce when instantiating the GLTF loader. The substantial changes in babylonFileloader.ts seem to be the addition of the findParent callback, which now takes a scene argument for traversing meshes, transform nodes, lights and cameras. This is only my intuition , but I feel like this could be a symptom of a change elsewhere causing multiple calls to something that should be memoized.

This PR will fix the problem:


You rock!

1 Like

I checked alpha.62. Works now :slight_smile:

1 Like