Skip to content

Commit

Permalink
Addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaStorm committed Jun 21, 2016
1 parent e288636 commit 75fa5d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/writeSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function writeSource(gltf, basePath, name, embed, embedImage, callback) {
var extension = object.extras._pipeline.extension;

// Write the source object as a data or file uri depending on the embed flag
if (embed && (embedImage || name !== 'images') || basePath === undefined) {
if (embed && (embedImage || name !== 'images') || !defined(basePath)) {
var sourceDataUri = new dataUri();
if (name === 'shaders') {
sourceDataUri.format('.txt', source);
Expand Down
16 changes: 8 additions & 8 deletions specs/lib/gltfPipelineSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('gltfPipeline', function() {
callback();
});
var options = {
createDirectory : false,
createDirectory : false
};
readGltf(gltfPath, options, function(gltf) {
var options = { basePath : path.dirname(gltfPath) };
Expand All @@ -118,10 +118,10 @@ describe('gltfPipeline', function() {
it('will write sources from JSON', function(done) {
var options = {};
readGltf(gltfPath, options, function (gltf) {
var initialSource = gltf['buffers'].CesiumTexturedBoxTest.extras._pipeline.source;
var initialUri = gltf['buffers'].CesiumTexturedBoxTest.uri;
processJSON(gltf, options, function () {
var finalSource = gltf['buffers'].CesiumTexturedBoxTest.extras._pipeline.source;
expect(initialSource).not.toEqual(finalSource);
var finalUri = gltf['buffers'].CesiumTexturedBoxTest.uri;
expect(initialUri).not.toEqual(finalUri);
done();
});
});
Expand All @@ -130,18 +130,18 @@ describe('gltfPipeline', function() {
it('will write sources from file', function(done) {
var options = {};
readGltf(gltfPath, options, function (gltf) {
var initialSource = gltf['buffers'].CesiumTexturedBoxTest.extras._pipeline.source;
var initialUri = gltf['buffers'].CesiumTexturedBoxTest.uri;
processFile(gltfPath, options, function (gltfFinal) {
var finalSource = gltfFinal['buffers'].CesiumTexturedBoxTest.extras._pipeline.source;
expect(initialSource).not.toEqual(finalSource);
var finalUri = gltfFinal['buffers'].CesiumTexturedBoxTest.uri;
expect(initialUri).not.toEqual(finalUri);
done();
});
});
});

it('will add image processing extras if this is a pipeline with image processing', function(done) {
var options = {
imageProcess : true,
imageProcess : true
};
readGltf(gltfEmbeddedPath, options, function(gltf) {
processJSON(gltf, options, function (gltf) {
Expand Down

0 comments on commit 75fa5d0

Please sign in to comment.