DynamicTexture getScene() return null with assetsManager.onFinish since update from 4.1.13 to 4.1.21

Hello,

I just updated the library and I get an error in the DynamicTexture function where it can’t get the scene.
I can see that it work in the playground but I don’t know what I do wrong here.

I made a pg here : https://www.babylonjs-playground.com/#ZJYNY#165

Do I do something wrong ?

Hey,
it is BABYLON.GUI.AdvancedDynamicTexture :wink:
https://www.babylonjs-playground.com/#ZJYNY#166
doc: Use the Babylon GUI - Babylon.js Documentation

1 Like

Thanks, that solved the PG but not my issue :smile:
God damnit !

I use the es6 import so it might be related.
I’m not sure :confused:

Here is the error stack

TypeError: Cannot read property 'getEngine' of null
    at AdvancedDynamicTexture.DynamicTexture [as constructor] (dynamicTexture.js?2c62:27)
    at new AdvancedDynamicTexture (advancedDynamicTexture.js?6425:36)
    at Function.AdvancedDynamicTexture.CreateFullscreenUI (advancedDynamicTexture.js?6425:874)
    at new LabelsManager (LabelsManager.js?bf2e:22)
    at AssetsManager.CreateJIAScene.assetsManager.onFinish (JIA.js?d4c7:63)
    at AssetsManager._decreaseWaitingTasksCount (assetsManager.js?7476:803)
    at done (assetsManager.js?7476:836)
    at TextureAssetTask.AbstractAssetTask.onDoneCallback (assetsManager.js?7476:140)
    at eval (assetsManager.js?7476:101)
    at onload (assetsManager.js?7476:409)

I also see there was a commit with
Engine reduction part 1

Maybe it’s related ?
pinging @Deltakosh

Here is working!


I wasn’t able to reproduce :frowning:

1 Like

Thanks for this PG. I will try to dig further to see where it comes from.

1 Like

Alright, this was fixed with alpha 22 which just came out.

I was never able to see where it came from because I didn’t reproduce it.
I almost remade the app template I’m using here.

Thanks :stuck_out_tongue:

2 Likes

Eventually everything is solved, one way or the other :slight_smile: