Error in _processLateAnimationBindings

Hi, we’re currently experiencing an error that appears very randomly when animating models… Unfortunately I’m unable to reproduce it in the playground… How would I go about finding the cause? The error is:

TypeError: Cannot read properties of null (reading 'm')
    at core_scene.a._processLateAnimationBindings (animatable.js:730:48)
    at core_scene.a._animate (animatable.js:429:1)
    at Scene.animate (scene.js:3661:1)
    at Scene.render (scene.js:3737:1)

As far as I can see (looking at Babylon’s code) the issue is at this line:

var matrixDecomposeMode = Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix

… and originalValue is a null in this case… But I have no idea what this function actually does or how to go about fixing it…

would you be able to reproduce this on the playground? or show us the code where it fails?

Unfortunately I’m unable to reproduce it in the playground… However adding this line before that one seems to fix the issue (though I don’t know if this is an acceptable way to fix it…):

if (originalValue === undefined || originalValue === null) continue

We do create and dispose avatar models very quickly in our app in certain circumstances, so that may be the reason for it…

Sure, this is a more-than-acceptable solution. Want to submit a PR? or should I quickly do that?

1 Like

Sure, I can create a PR…

1 Like

Ok, here it is: Fix null error in late animation bindings by jjv360 · Pull Request #12909 · BabylonJS/Babylon.js · GitHub

1 Like