diff --git a/package.json b/package.json index b8e8fad..37510dd 100644 --- a/package.json +++ b/package.json @@ -296,7 +296,7 @@ "babylonjs": "^3.2.0", "babylonjs-loaders": "^3.2.0", "draco3dgltf": "^1.3.4", - "gltf-import-export": "^1.0.12", + "gltf-import-export": "^1.0.13", "gltf-validator": "2.0.0-dev.2.5", "json-source-map": "^0.4.0", "sprintf-js": "^1.1.1", diff --git a/src/dataUriTextDocumentContentProvider.ts b/src/dataUriTextDocumentContentProvider.ts index 58acee1..cc4ab97 100644 --- a/src/dataUriTextDocumentContentProvider.ts +++ b/src/dataUriTextDocumentContentProvider.ts @@ -105,7 +105,7 @@ export class DataUriTextDocumentContentProvider implements vscode.TextDocumentCo } else if (jsonPointer.startsWith('/accessors/')) { if (data.bufferView !== undefined) { let bufferView = glTF.bufferViews[data.bufferView]; - let buffer = getBuffer(glTF, bufferView.buffer.toString(), fileName); + let buffer = getBuffer(glTF, bufferView.buffer, fileName); return formatAccessor(buffer, data, bufferView); } else { return 'Accessor does not contain a bufferView'; @@ -146,7 +146,7 @@ export class DataUriTextDocumentContentProvider implements vscode.TextDocumentCo } let bufferView = glTF.bufferViews[dracoExtension.bufferView]; - let glTFBuffer = getBuffer(glTF, bufferView.buffer.toString(), fileName); + let glTFBuffer = getBuffer(glTF, bufferView.buffer, fileName); const bufferOffset: number = bufferView.byteOffset || 0; const bufferLength: number = bufferView.byteLength; const bufferViewBuf: Buffer = glTFBuffer.slice(bufferOffset, bufferOffset + bufferLength); diff --git a/src/extension.ts b/src/extension.ts index cb1a479..a3d529a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -520,7 +520,7 @@ export function activate(context: vscode.ExtensionContext) { let accessorValues = []; if (accessor != undefined) { const bufferView = glTF.bufferViews[accessor.bufferView]; - const buffer = getBuffer(glTF, bufferView.buffer.toString(), activeTextEditor.document.fileName); + const buffer = getBuffer(glTF, bufferView.buffer, activeTextEditor.document.fileName); accessorValues = getAccessorData(accessor, bufferView, buffer); } animationPointer.json.extras[`vscode_gltf_${key}`] = Array.from(accessorValues); @@ -601,7 +601,7 @@ export function activate(context: vscode.ExtensionContext) { bufferIndex = bufferView.buffer; } const bufferJson = glTF.buffers[bufferIndex]; - const bufferData = getBuffer(glTF, bufferIndex.toString(), activeTextEditor.document.fileName); + const bufferData = getBuffer(glTF, bufferIndex, activeTextEditor.document.fileName); const alignedLength = (value: number) => { const alignValue = 4; if (value == 0) { diff --git a/src/validationProvider.ts b/src/validationProvider.ts index 877a0f4..0148708 100644 --- a/src/validationProvider.ts +++ b/src/validationProvider.ts @@ -54,8 +54,7 @@ export async function validate(sourceFilename: string) { } resolve(data); }); - } - ), + }), }); const useSaveAs = !vscode.workspace.getConfiguration('glTF').get('alwaysOverwriteDefaultFilename');