Skip to content

Commit

Permalink
Upgrade gltf-import-export module
Browse files Browse the repository at this point in the history
  • Loading branch information
bghgary committed Nov 5, 2018
1 parent e9ddd03 commit f234d64
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/dataUriTextDocumentContentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions src/validationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export async function validate(sourceFilename: string) {
}
resolve(data);
});
}
),
}),
});

const useSaveAs = !vscode.workspace.getConfiguration('glTF').get('alwaysOverwriteDefaultFilename');
Expand Down

0 comments on commit f234d64

Please sign in to comment.