3D Tiles: Cannot read property 'subarray' of undefined

Hey everyone,

For the past few days i’ve been trying to add a batch table to a .b3dm file, and create a batch file with a batch table inside of it. However upon doing so i’m met with the error:

An error occurred while rendering. Rendering has stopped.

TypeError: Cannot read property ‘subarray’ of undefined
TypeError: Cannot read property ‘subarray’ of undefined
at we (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:489:20629)
at me.getBuffer (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:490:22761)
at Ge (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:489:26934)
at Mi.execute (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:490:26703)
at a.execute (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:508:25577)
at We (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:489:27473)
at zt (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:490:12670)
at ye.update (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:491:363)
at C.update (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:498:21412)
at R.process (https://generator-abhub.c9users.io/cesium/Cesium/Cesium.js:502:2770)

I’m not sure as to why this has occurred, as I’ve had added a batchId to both attributes, techniques, and parameters of my glTF file, such that my glTF file looks like this (http://pastebin.com/3HtLYLJf). I’ve also included the attribute ‘a_batchId’ into the vertex shader. There is only one batch id in the tile, i.e. a single feature, so the batch table looks like this:

{

“id” : [“demoTile”],
“displayName” : [“River Hall”],
“yearBuilt” : [1850],

}

Which seems valid to me. Therefore I was wondering weather or not this error has occurred, because i haven’t put the batch ids into the binary data correctly? If so could you clarify how to add batch ids into the binary data. Also sorry that I can’t post the converted model, as its not my property. However I can provide all other types of information.

All the best, and thanks for any help you can give me on this issue.

The bufferView_batchId references a buffer called binary_glTF that doesn’t exist. Changing it to KHR_binary_glTF should work.

Just a note on the naming for the binary buffer - some of our tools used to incorrectly name it KHR_binary_glTF instead of binary_glTF. Functionally it will work the same in Cesium with either name but this is partly responsible for the confusion.