diff --git a/modules/io/src/gltf/glb-builder.js b/modules/io/src/gltf/glb-builder.js index 3dc11378f..cb57ddfa2 100644 --- a/modules/io/src/gltf/glb-builder.js +++ b/modules/io/src/gltf/glb-builder.js @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. /* eslint-disable camelcase, max-statements */ -import {padTo4Bytes, copyToArray} from '@loaders.gl/loader-utils'; +import {copyToArray} from '@loaders.gl/loader-utils'; import {isImage} from '@loaders.gl/images'; import {getAccessorTypeFromSize, getComponentTypeFromArray} from './gltf-utils/gltf-utils'; +import {padTo4Bytes} from './memory-copy-utils'; import encodeGLBSync from './encode-glb'; import {packBinaryJson} from '../writers/xviz-pack-binary'; diff --git a/modules/io/src/gltf/gltf-parser.js b/modules/io/src/gltf/gltf-parser.js index d3f5943a3..fdda17b43 100644 --- a/modules/io/src/gltf/gltf-parser.js +++ b/modules/io/src/gltf/gltf-parser.js @@ -105,6 +105,8 @@ export class GLTFParser { getApplicationData(key) { if (this.json) { return this.json[key]; + } else if (this.glbParser) { + return this.glbParser.getApplicationData(key); } return null; diff --git a/modules/io/src/gltf/parse-glb.js b/modules/io/src/gltf/parse-glb.js index 351f5d454..e4ecfab72 100644 --- a/modules/io/src/gltf/parse-glb.js +++ b/modules/io/src/gltf/parse-glb.js @@ -14,7 +14,8 @@ /* global TextDecoder */ /* eslint-disable camelcase, max-statements */ import '../common/text-encoding'; -import {padTo4Bytes, assert} from '@loaders.gl/loader-utils'; +import {assert} from '@loaders.gl/loader-utils'; +import {padTo4Bytes} from './memory-copy-utils'; const MAGIC_glTF = 0x676c5446; // glTF in Big-Endian ASCII