Baked texture animation issues + PG

Hi,

I experience some issues in the workflow of VAT.

First, the PG dealing with the file preparation
https://playground.babylonjs.com/#CP2RN9#124

Second the PG dealing with file loading
https://playground.babylonjs.com/#CP2RN9#125

for some reasons, I can’t generate a file on the PG (it blocks at step “TWO”, but locally, it works, so let’s move on).
The second PG has the resulting vertexJSON and has issues loading it because “is not valid JSON”

Is it the base64 encoding messing here ?

The animation will give a false sense of success because it will bypass the vertex texture and run fine.

Any help?

For your first PG, you should not do await baker.bakeVertexData(animationRanges) but baker.bakeVertexData(animationRanges).then(...) because you will suspend the engine render loop with the former. The problem is that we need the scene to be rendered to make the animations run (the baker relies on AnimationGroup.onEndObservable) - see how it is done in the doc.

In your second PG, you should await response.json(); as response.json(); returns a promise. Also, loadBakedVertexDataFromJSON expects a string. As you already have the right json object, you can use loadBakedVertexDataFromObject instead:

1 Like

Thanks,

all the errors have been corrected, but now, my model still isn’t animated, just like in your PG.
Is it an issue with the model in itself?

If you comment the VAT section, it is animated just fine.

looks ok now, will dig to confirm.
https://playground.babylonjs.com/#CP2RN9#135
thanks!!

1 Like

Confirmed, it works, Thanks Evgeni, thanks a lot for your help!