From ed5b5b3e492dc979c6cbe976480f8ee8443fe99e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2019 18:46:45 +0000 Subject: [PATCH 01/20] chore(package): update open to version 7.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52aaf4b1..74063a58 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "jasmine-spec-reporter": "^4.2.1", "jsdoc": "^3.6.2", "nyc": "^14.1.1", - "open": "^6.3.0", + "open": "^7.0.0", "requirejs": "^2.3.6" }, "scripts": { From bd81384263ead9b8a8e97b7bd93c049506a97e56 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2019 17:21:39 +0000 Subject: [PATCH 02/20] chore(package): update eslint-config-cesium to version 8.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52aaf4b1..8dda956f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "coveralls": "^3.0.4", "dependency-tree": "^7.0.2", "eslint": "^6.0.0", - "eslint-config-cesium": "^7.0.0", + "eslint-config-cesium": "^8.0.0", "gulp": "^4.0.2", "jasmine": "^3.4.0", "jasmine-spec-reporter": "^4.2.1", From e149d3d7b1ff43a491c5c4726767e15529b94618 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2019 22:58:38 +0000 Subject: [PATCH 03/20] fix(package): update yargs to version 15.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52aaf4b1..cbef0a44 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "mime": "^2.4.4", "object-hash": "^2.0.0", "uuid": "^3.3.2", - "yargs": "^14.0.0" + "yargs": "^15.0.1" }, "devDependencies": { "cloc": "^2.5.0", From 17e916755cd21f61b777111b2d364af38a76a514 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2019 01:21:19 +0000 Subject: [PATCH 04/20] chore(package): update nyc to version 15.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52aaf4b1..b57639d0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "jasmine": "^3.4.0", "jasmine-spec-reporter": "^4.2.1", "jsdoc": "^3.6.2", - "nyc": "^14.1.1", + "nyc": "^15.0.0", "open": "^6.3.0", "requirejs": "^2.3.6" }, From 06b4983323d5412afb7021fde0aaaf5ce31a5fef Mon Sep 17 00:00:00 2001 From: Daniel Haehn Date: Sat, 28 Dec 2019 10:49:28 -0500 Subject: [PATCH 05/20] Stop ignoring the keepUnusedElements flag. --- bin/gltf-pipeline.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/gltf-pipeline.js b/bin/gltf-pipeline.js index 58efe493..242e75c7 100644 --- a/bin/gltf-pipeline.js +++ b/bin/gltf-pipeline.js @@ -168,6 +168,7 @@ const options = { separate: argv.separate, separateTextures: argv.separateTextures, stats: argv.stats, + keepUnusedElements: argv.keepUnusedElements, name: outputName, dracoOptions: dracoOptions }; From e8f2cfc017bfc2bfb0e3fc51d516637dbf442e54 Mon Sep 17 00:00:00 2001 From: Sanjeet Suhag Date: Thu, 30 Jan 2020 15:05:45 -0500 Subject: [PATCH 06/20] Adds removal for unused textures, images, samplers in removeUnusedElements --- lib/forEachTextureInMaterial.js | 135 ++++++++++++++++++++++++++++++++ lib/removeUnusedElements.js | 91 ++++++++++++++++++++- 2 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 lib/forEachTextureInMaterial.js diff --git a/lib/forEachTextureInMaterial.js b/lib/forEachTextureInMaterial.js new file mode 100644 index 00000000..6270c836 --- /dev/null +++ b/lib/forEachTextureInMaterial.js @@ -0,0 +1,135 @@ +'use strict'; + +const { Check, defined } = require('cesium'); +const ForEach = require('./ForEach'); + +module.exports = forEachTextureInMaterial; + +/** + * Calls the provider handler function on each texture used by the material. + * Mimics the behavior of functions in gltf-pipeline ForEach. + * @param {Object} material The glTF material. + * @param {forEachTextureInMaterial~handler} handler Function that is called for each texture in the material. + */ +function forEachTextureInMaterial(material, handler) { + Check.typeOf.object('material', material); + Check.defined('handler', handler); + + // Metallic roughness + const pbrMetallicRoughness = material.pbrMetallicRoughness; + if (defined(pbrMetallicRoughness)) { + if (defined(pbrMetallicRoughness.baseColorTexture)) { + const textureInfo = pbrMetallicRoughness.baseColorTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } + if (defined(pbrMetallicRoughness.metallicRoughnessTexture)) { + const textureInfo = pbrMetallicRoughness.metallicRoughnessTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } + } + + if (defined(material.extensions)) { + // Spec gloss extension + const pbrSpecularGlossiness = material.extensions.KHR_materials_pbrSpecularGlossiness; + if (defined(pbrSpecularGlossiness)) { + if (defined(pbrSpecularGlossiness.diffuseTexture)) { + const textureInfo = pbrSpecularGlossiness.diffuseTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } + if (defined(pbrSpecularGlossiness.specularGlossinessTexture)) { + const textureInfo = pbrSpecularGlossiness.specularGlossinessTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } + } + + // Materials common extension (may be present in models converted from glTF 1.0) + const materialsCommon = material.extensions.KHR_materials_common; + if (defined(materialsCommon)) { + const diffuse = materialsCommon.values.diffuse; + const ambient = materialsCommon.values.ambient; + const emission = materialsCommon.values.emission; + const specular = materialsCommon.values.specular; + if (defined(diffuse) && defined(diffuse.index)) { + const value = handler(diffuse.index, diffuse); + if (defined(value)) { + return value; + } + } + if (defined(ambient) && defined(ambient.index)) { + const value = handler(ambient.index, ambient); + if (defined(value)) { + return value; + } + } + if (defined(emission) && defined(emission.index)) { + const value = handler(emission.index, emission); + if (defined(value)) { + return value; + } + } + if (defined(specular) && defined(specular.index)) { + const value = handler(specular.index, specular); + if (defined(value)) { + return value; + } + } + } + } + + // KHR_techniques_webgl extension + const value = ForEach.materialValue(material, function (materialValue) { + if (defined(materialValue.index)) { + const value = handler(materialValue.index, materialValue); + if (defined(value)) { + return value; + } + } + }); + if (defined(value)) { + return value; + } + + // Top level textures + if (defined(material.emissiveTexture)) { + const textureInfo = material.emissiveTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } + + if (defined(material.normalTexture)) { + const textureInfo = material.normalTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } + + if (defined(material.occlusionTexture)) { + const textureInfo = material.occlusionTexture; + const value = handler(textureInfo.index, textureInfo); + if (defined(value)) { + return value; + } + } +} + +/** + * Function that is called for each texture in the material. If this function returns a value the for each stops and returns that value. + * @callback forEachTextureInMaterial~handler + * @param {Number} The texture index. + * @param {Object} The texture info object. + */ diff --git a/lib/removeUnusedElements.js b/lib/removeUnusedElements.js index b3c991ce..2a31a94c 100644 --- a/lib/removeUnusedElements.js +++ b/lib/removeUnusedElements.js @@ -1,6 +1,7 @@ 'use strict'; const Cesium = require('cesium'); const ForEach = require('./ForEach'); +const forEachTextureInMaterial = require('./forEachTextureInMaterial'); const hasExtension = require('./hasExtension'); const defaultValue = Cesium.defaultValue; @@ -8,7 +9,7 @@ const defined = Cesium.defined; module.exports = removeUnusedElements; -const allElementTypes = ['mesh', 'node', 'material', 'accessor', 'bufferView', 'buffer']; +const allElementTypes = ['mesh', 'node', 'material', 'accessor', 'bufferView', 'buffer', 'texture', 'sampler', 'image']; /** * Removes unused elements from gltf. @@ -32,9 +33,12 @@ const TypeToGltfElementName = { accessor: 'accessors', buffer: 'buffers', bufferView: 'bufferViews', + image: 'images', node: 'nodes', material: 'materials', - mesh: 'meshes' + mesh: 'meshes', + sampler: 'samplers', + texture: 'textures' }; function removeUnusedElementsByType(gltf, type) { @@ -167,6 +171,23 @@ Remove.bufferView = function(gltf, bufferViewId) { } }; +Remove.image = function(gltf, imageId) { + const images = gltf.images; + images.splice(imageId, 1); + + ForEach.texture(gltf, function (texture) { + if (defined(texture.source)) { + if (texture.source > imageId) { + --texture.source; + } + } + const ext = texture.extensions; + if (defined(ext) && defined(ext.EXT_texture_webp) && ext.EXT_texture_webp.source > imageId) { + --texture.extensions.EXT_texture_webp.source; + } + }); +}; + Remove.mesh = function(gltf, meshId) { const meshes = gltf.meshes; meshes.splice(meshId, 1); @@ -249,6 +270,32 @@ Remove.material = function(gltf, materialId) { }); }; +Remove.sampler = function(gltf, samplerId) { + const samplers = gltf.samplers; + samplers.splice(samplerId, 1); + + ForEach.texture(gltf, function (texture) { + if (defined(texture.sampler)) { + if (texture.sampler > samplerId) { + --texture.sampler; + } + } + }); +}; + +Remove.texture = function(gltf, textureId) { + const textures = gltf.textures; + textures.splice(textureId, 1); + + ForEach.material(gltf, function (material) { + forEachTextureInMaterial(material, function (textureIndex, textureInfo) { + if (textureInfo.index > textureId) { + --textureInfo.index; + } + }); + }); +}; + /** * Contains functions for getting a list of element ids in use by the glTF asset. * @constructor @@ -352,6 +399,22 @@ getListOfElementsIdsInUse.bufferView = function(gltf) { return usedBufferViewIds; }; +getListOfElementsIdsInUse.image = function(gltf) { + const usedImageIds = {}; + + ForEach.texture(gltf, function (texture) { + if (defined(texture.source)) { + usedImageIds[texture.source] = true; + } + + if (defined(texture.extensions) && defined(texture.extensions.EXT_texture_webp)) { + usedImageIds[texture.extensions.EXT_texture_webp.source] = true; + } + + }); + return usedImageIds; +}; + getListOfElementsIdsInUse.mesh = function(gltf) { const usedMeshIds = {}; ForEach.node(gltf, function(node) { @@ -429,3 +492,27 @@ getListOfElementsIdsInUse.material = function(gltf) { return usedMaterialIds; }; + +getListOfElementsIdsInUse.texture = function(gltf) { + const usedTextureIds = {}; + + ForEach.material(gltf, function(material) { + forEachTextureInMaterial(material, function(textureId) { + usedTextureIds[textureId] = true; + }); + }); + + return usedTextureIds; +}; + +getListOfElementsIdsInUse.sampler = function(gltf) { + const usedSamplerIds = {}; + + ForEach.texture(gltf, function (texture) { + if (defined(texture.sampler)) { + usedSamplerIds[texture.sampler] = true; + } + }); + + return usedSamplerIds; +}; From a97b15e3537b668199e02b53dcf92fc7f53392ff Mon Sep 17 00:00:00 2001 From: Sanjeet Suhag Date: Mon, 3 Feb 2020 09:20:06 -0500 Subject: [PATCH 07/20] Adds tests for unused image, sampler and texture removal --- specs/lib/removeUnusedElementsSpec.js | 39 ++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/specs/lib/removeUnusedElementsSpec.js b/specs/lib/removeUnusedElementsSpec.js index 4111e4eb..089fa0aa 100644 --- a/specs/lib/removeUnusedElementsSpec.js +++ b/specs/lib/removeUnusedElementsSpec.js @@ -296,6 +296,12 @@ const gltf = { ] } ], + textures: [ + { + 'sampler': 0, + 'source': 1 + } + ], images: [ { bufferView: 9, @@ -320,12 +326,31 @@ const gltf = { ] } }, + samplers: [ + { + magFilter: 9729, + minFilter: 9987, + wrapS: 33648, + wrapt: 33648 + }, + { + magFilter: 9729, + minFilter: 9987, + wrapS: 33648, + wrapt: 33648 + } + ], materials: [ { name: 'unused' }, { - name: 'used' + name: 'used', + pbrMetallicRoughness: { + baseColorTexture: { + index: 0 + } + } } ], scenes: [ @@ -391,6 +416,18 @@ describe('removeUnusedElements', () => { }); }); + it('correctly removes/keeps textures', () => { + expect(gltf.textures.length).toBe(1); + }); + + it('correctly removes/keeps samplers', () => { + expect(gltf.samplers.length).toBe(1); + }); + + it('correctly removes/keeps images', () => { + expect(gltf.samplers.length).toBe(1); + }); + it('correctly removes/keeps lights', () => { expect(Object.keys(gltf)).toContain('extensions'); expect(Object.keys(gltf.extensions)).toContain('KHR_lights_punctual'); From 957480bef830c8adcc3d10a4eab624cce0cc2f5d Mon Sep 17 00:00:00 2001 From: Sanjeet Suhag Date: Mon, 3 Feb 2020 13:28:15 -0500 Subject: [PATCH 08/20] Improves tests in removesUnusedElementsSpec --- specs/lib/removeUnusedElementsSpec.js | 33 ++++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/specs/lib/removeUnusedElementsSpec.js b/specs/lib/removeUnusedElementsSpec.js index 089fa0aa..96e648c0 100644 --- a/specs/lib/removeUnusedElementsSpec.js +++ b/specs/lib/removeUnusedElementsSpec.js @@ -298,8 +298,12 @@ const gltf = { ], textures: [ { - 'sampler': 0, - 'source': 1 + name: 'texture', + sampler: 0, + source: 1 + }, + { + name: 'unusedTexture' } ], images: [ @@ -314,6 +318,11 @@ const gltf = { { bufferView: 11, mimeType: 'image/png' + }, + { + name: 'image', + bufferView: 12, + mimeType: 'image/png' } ], extensions: { @@ -328,6 +337,7 @@ const gltf = { }, samplers: [ { + name: 'sampler', magFilter: 9729, minFilter: 9987, wrapS: 33648, @@ -378,7 +388,10 @@ describe('removeUnusedElements', () => { meshes: ['mesh0'], buffers: ['mesh', 'image01'], lights: ['sun'], - materials: ['used'] + materials: ['used'], + textures: ['texture'], + images: ['image'], + samplers: ['sampler'] }; it('correctly removes/keeps accessors', () => { @@ -399,7 +412,7 @@ describe('removeUnusedElements', () => { }); }); - ['materials', 'nodes', 'cameras', 'meshes', 'buffers'].forEach(k => { + ['materials', 'nodes', 'cameras', 'meshes', 'buffers', 'textures', 'images', 'samplers'].forEach(k => { it('correctly removes/keeps ' + k, () => { expect(Object.keys(gltf)).toContain(k); expect(gltf[k].length).toBe(remaining[k].length); @@ -416,18 +429,6 @@ describe('removeUnusedElements', () => { }); }); - it('correctly removes/keeps textures', () => { - expect(gltf.textures.length).toBe(1); - }); - - it('correctly removes/keeps samplers', () => { - expect(gltf.samplers.length).toBe(1); - }); - - it('correctly removes/keeps images', () => { - expect(gltf.samplers.length).toBe(1); - }); - it('correctly removes/keeps lights', () => { expect(Object.keys(gltf)).toContain('extensions'); expect(Object.keys(gltf.extensions)).toContain('KHR_lights_punctual'); From afd5c5ab94433c2506e9cc4d126e72d47bf004c9 Mon Sep 17 00:00:00 2001 From: Sanjeet Suhag Date: Mon, 3 Feb 2020 13:35:14 -0500 Subject: [PATCH 09/20] Adds additional tests for removeUnusedElements --- specs/lib/removeUnusedElementsSpec.js | 329 ++++++++++++++++++++++++++ 1 file changed, 329 insertions(+) diff --git a/specs/lib/removeUnusedElementsSpec.js b/specs/lib/removeUnusedElementsSpec.js index 96e648c0..75d463c9 100644 --- a/specs/lib/removeUnusedElementsSpec.js +++ b/specs/lib/removeUnusedElementsSpec.js @@ -442,3 +442,332 @@ describe('removeUnusedElements', () => { }); }); }); + +describe('removes unused materials, textures, images, samplers', () => { + it('removes unused materials', () => { + const gltf = { + materials: [ + { + name: '0' + }, + { + name: '1' + }, + { + name: '2' + }, + { + name: '3' + }, + { + name: '4' + }, + { + name: '5' + } + ], + meshes: [ + { + primitives: [ + { + material: 0 + } + ] + }, + { + primitives: [ + { + material: 2 + }, + { + material: 3 + } + ] + } + ] + }; + + removeUnusedElements(gltf, ['material', 'texture', 'sampler', 'image']); + + expect(gltf.materials.length).toEqual(3); + expect(gltf.materials[0].name).toEqual('0'); + expect(gltf.materials[1].name).toEqual('2'); + expect(gltf.materials[2].name).toEqual('3'); + expect(gltf.meshes[0].primitives[0].material).toEqual(0); + expect(gltf.meshes[1].primitives[0].material).toEqual(1); + expect(gltf.meshes[1].primitives[1].material).toEqual(2); + }); + + it('removes unused textures', () => { + const gltf = { + textures: [ + { + name: '0' + }, + { + name: '1' + }, + { + name: '2' + }, + { + name: '3' + }, + { + name: '4' + } + ], + materials: [ + { + occlusionTexture: { + index: 0 + }, + normalTexture: { + index: 2 + } + }, + { + extensions: { + KHR_techniques_webgl: { + values: { + diffuse: { + index: 3 + } + } + } + } + } + ], + meshes: [ + { + primitives: [ + { + material: 0 + }, + { + material: 1 + } + ] + } + ] + }; + + removeUnusedElements(gltf, ['material', 'texture', 'sampler', 'image']); + + expect(gltf.textures.length).toEqual(3); + expect(gltf.textures[0].name).toEqual('0'); + expect(gltf.textures[1].name).toEqual('2'); + expect(gltf.textures[2].name).toEqual('3'); + expect(gltf.materials[0].occlusionTexture.index).toEqual(0); + expect(gltf.materials[0].normalTexture.index).toEqual(1); + expect(gltf.materials[1].extensions.KHR_techniques_webgl.values.diffuse.index).toEqual(2); + }); + + it('removes unused images', () => { + const gltf = { + images: [ + { + name: '0' + }, + { + name: '1' + }, + { + name: '2' + }, + { + name: '3' + }, + { + name: '4' + }, + { + name: '5' + } + ], + textures: [ + { + source: 1 + }, + { + source: 3 + }, + { + extensions: { + EXT_texture_webp: { + source: 5 + } + } + } + ], + materials: [ + { + occlusionTexture: { + index: 0 + }, + normalTexture: { + index: 1 + }, + emissiveTexture: { + index: 2 + } + } + ], + meshes: [ + { + primitives: [ + { + material: 0 + } + ] + } + ] + }; + + removeUnusedElements(gltf, ['material', 'texture', 'sampler', 'image']); + + expect(gltf.images.length).toEqual(3); + expect(gltf.images[0].name).toEqual('1'); + expect(gltf.images[1].name).toEqual('3'); + expect(gltf.images[2].name).toEqual('5'); + expect(gltf.textures[0].source).toEqual(0); + expect(gltf.textures[1].source).toEqual(1); + expect(gltf.textures[2].extensions.EXT_texture_webp.source).toEqual(2); + }); + + it('removes unused samplers', () => { + const gltf = { + samplers: [ + { + name: '0' + }, + { + name: '1' + }, + { + name: '2' + }, + { + name: '3' + }, + { + name: '4' + } + ], + textures: [ + { + sampler: 2 + }, + { + sampler: 3 + }, + { + // no sampler defined + } + ], + materials: [ + { + occlusionTexture: { + index: 0 + }, + normalTexture: { + index: 1 + }, + emissiveTexture: { + index: 2 + } + } + ], + meshes: [ + { + primitives: [ + { + material: 0 + } + ] + } + ] + }; + + removeUnusedElements(gltf, ['material', 'texture', 'sampler', 'image']); + + expect(gltf.samplers.length).toEqual(2); + expect(gltf.samplers[0].name).toEqual('2'); + expect(gltf.samplers[1].name).toEqual('3'); + expect(gltf.textures[0].sampler).toEqual(0); + expect(gltf.textures[1].sampler).toEqual(1); + expect(gltf.textures[2].sampler).toBeUndefined(); + }); + + it('removed elements propagate', () => { + const gltf = { + samplers: [ + { + name: 'sampler0' + }, + { + name: 'sampler1' + } + ], + images: [ + { + name: 'image0' + }, + { + name: 'image1' + } + ], + textures: [ + { + name: 'texture0', + source: 0, + sampler: 0 + }, + { + name: 'texture1', + source: 1, + sampler: 1 + } + ], + materials: [ + { + name: 'material0', + normalTexture: { + index: 0 + } + }, + { + name: 'material1', + normalTexture: { + index: 1 + } + } + ], + meshes: [ + { + primitives: [ + { + material: 1 + } + ] + } + ] + }; + + removeUnusedElements(gltf, ['material', 'texture', 'sampler', 'image']); + + expect(gltf.materials.length).toEqual(1); + expect(gltf.textures.length).toEqual(1); + expect(gltf.images.length).toEqual(1); + expect(gltf.samplers.length).toEqual(1); + + expect(gltf.materials[0].name).toEqual('material1'); + expect(gltf.textures[0].name).toEqual('texture1'); + expect(gltf.images[0].name).toEqual('image1'); + expect(gltf.samplers[0].name).toEqual('sampler1'); + + expect(gltf.materials[0].normalTexture.index).toEqual(0); + expect(gltf.textures[0].source).toEqual(0); + expect(gltf.textures[0].sampler).toEqual(0); + }); +}); \ No newline at end of file From 8a8eb7d8d66b30a929dc3c65e30a7407b4247e8c Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 4 Feb 2020 08:23:48 -0500 Subject: [PATCH 10/20] Update packages --- package.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 4999098c..ddcc7978 100644 --- a/package.json +++ b/package.json @@ -26,27 +26,27 @@ "node": ">=6.0.0" }, "dependencies": { - "bluebird": "^3.5.5", - "cesium": "^1.58.1", + "bluebird": "^3.7.2", + "cesium": "^1.66.0", "draco3d": "^1.3.4", - "fs-extra": "^8.0.1", + "fs-extra": "^8.1.0", "mime": "^2.4.4", - "object-hash": "^2.0.0", - "uuid": "^3.3.2", - "yargs": "^15.0.1" + "object-hash": "^2.0.1", + "uuid": "^3.4.0", + "yargs": "^15.1.0" }, "devDependencies": { - "cloc": "^2.5.0", - "coveralls": "^3.0.4", - "dependency-tree": "^7.0.2", - "eslint": "^6.0.0", - "eslint-config-cesium": "^8.0.0", + "cloc": "^2.5.1", + "coveralls": "^3.0.9", + "dependency-tree": "^7.2.0", + "eslint": "^6.8.0", + "eslint-config-cesium": "^8.0.1", "gulp": "^4.0.2", - "jasmine": "^3.4.0", + "jasmine": "^3.5.0", "jasmine-spec-reporter": "^4.2.1", - "jsdoc": "^3.6.2", + "jsdoc": "^3.6.3", "nyc": "^15.0.0", - "open": "^7.0.0", + "open": "^7.0.2", "requirejs": "^2.3.6" }, "scripts": { From 6a7a2b90af4b8a57ece7b776656af83956e26990 Mon Sep 17 00:00:00 2001 From: Sanjeet Suhag Date: Tue, 4 Feb 2020 09:49:33 -0500 Subject: [PATCH 11/20] Fixes eslint warning --- specs/lib/removeUnusedElementsSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/lib/removeUnusedElementsSpec.js b/specs/lib/removeUnusedElementsSpec.js index 75d463c9..10f80d5d 100644 --- a/specs/lib/removeUnusedElementsSpec.js +++ b/specs/lib/removeUnusedElementsSpec.js @@ -770,4 +770,4 @@ describe('removes unused materials, textures, images, samplers', () => { expect(gltf.textures[0].source).toEqual(0); expect(gltf.textures[0].sampler).toEqual(0); }); -}); \ No newline at end of file +}); From ac00f4c44be20382d9a3ca900623d9aee5a18c30 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 4 Feb 2020 09:56:09 -0500 Subject: [PATCH 12/20] Update Travis Node version to 10, remove requirejs dependency, update readme --- .travis.yml | 4 ++-- README.md | 2 +- package.json | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35df2d0d..da7dcdbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ os: language: node_js node_js: - - "8" + - "10" script: - npm run eslint @@ -14,4 +14,4 @@ script: after_success: ## We only need to run coveralls for one node version (doesn't matter which one). ## We also ignore publishing failures, since restarting an existing travis build would otherwise break. - - if node --version | grep -q ^v8 ; npm run coverage && npm run coveralls; fi + - npm run coverage && npm run coveralls; diff --git a/README.md b/README.md index 122731a6..5c7710ca 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Some functionality of gltf-pipeline is used by Cesium as a third party library. npm run build-cesium ``` -This will output a portion of the gltf-pipeline code into the `dist/cesium` folder, reformatted into AMD style for use with RequireJS and Cesium in the browser. +This will output a portion of the gltf-pipeline code into the `dist/cesium` folder for use with Cesium in the browser. ### Running Test Coverage diff --git a/package.json b/package.json index ddcc7978..0fdeffcc 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,7 @@ "jasmine-spec-reporter": "^4.2.1", "jsdoc": "^3.6.3", "nyc": "^15.0.0", - "open": "^7.0.2", - "requirejs": "^2.3.6" + "open": "^7.0.2" }, "scripts": { "jsdoc": "jsdoc ./lib -R ./README.md -d doc", From f5c6a5f6a6c0c95dd409139270fdaf9736f35ba0 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 4 Feb 2020 10:06:40 -0500 Subject: [PATCH 13/20] Update appveyor to node 10 --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b07a4021..dfd86a0e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,7 +5,7 @@ clone_depth: 50 environment: matrix: - - nodejs_version: "8" + - nodejs_version: "10" install: # Get the latest stable version of Node.js From c1a0a3ab7c53b46a9b7987c0bc7c5a72e761479c Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 4 Feb 2020 11:03:55 -0500 Subject: [PATCH 14/20] Updated version to 2.1.5 --- CHANGES.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 4b6ed8ed..c6dd60d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ Change Log ========== +### 2.1.5 - 2020-02-04 + +* Added removal of unused textures, samplers, and images. [#516](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/516) + ### 2.1.4 - 2019-10-04 * Added removal of unused materials, nodes and meshes. [#465](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/465) diff --git a/package.json b/package.json index 0fdeffcc..d1daa333 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gltf-pipeline", - "version": "2.1.4", + "version": "2.1.5", "description": "Content pipeline tools for optimizing glTF assets.", "license": "Apache-2.0", "contributors": [ From af6f466701a850d7cc16c22612626cd113b5aa9c Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 4 Feb 2020 12:20:03 -0500 Subject: [PATCH 15/20] Update to 2.1.6 --- CHANGES.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c6dd60d0..34ea744b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ Change Log ========== +### 2.1.6 - 2020-02-04 + +* Fixed a mistake in the 2.1.5 release where the changes from [#516](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/516) were accidentally removed. + ### 2.1.5 - 2020-02-04 * Added removal of unused textures, samplers, and images. [#516](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/516) diff --git a/package.json b/package.json index d1daa333..072ad55c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gltf-pipeline", - "version": "2.1.5", + "version": "2.1.6", "description": "Content pipeline tools for optimizing glTF assets.", "license": "Apache-2.0", "contributors": [ From b5a3f53f2a4fd5c6c79f10916ec118818c8e18f2 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 18 Feb 2020 11:58:29 -0500 Subject: [PATCH 16/20] Switch to CesiumGS github org --- CHANGES.md | 102 +++++++++++++++++++++++++-------------------------- LICENSE.md | 4 +- README.md | 16 ++++---- package.json | 10 ++--- 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 34ea744b..cde37786 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,39 +3,39 @@ Change Log ### 2.1.6 - 2020-02-04 -* Fixed a mistake in the 2.1.5 release where the changes from [#516](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/516) were accidentally removed. +* Fixed a mistake in the 2.1.5 release where the changes from [#516](https://github.com/CesiumGS/gltf-pipeline/pull/516) were accidentally removed. ### 2.1.5 - 2020-02-04 -* Added removal of unused textures, samplers, and images. [#516](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/516) +* Added removal of unused textures, samplers, and images. [#516](https://github.com/CesiumGS/gltf-pipeline/pull/516) ### 2.1.4 - 2019-10-04 -* Added removal of unused materials, nodes and meshes. [#465](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/465) -* Added `keepUnusedElements` flag to keep unused materials, nodes and meshes. [#465](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/465) +* Added removal of unused materials, nodes and meshes. [#465](https://github.com/CesiumGS/gltf-pipeline/pull/465) +* Added `keepUnusedElements` flag to keep unused materials, nodes and meshes. [#465](https://github.com/CesiumGS/gltf-pipeline/pull/465) ### 2.1.3 - 2019-03-21 -* Fixed a crash when saving separate resources that would exceed the Node buffer size limit. [#468](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/468) +* Fixed a crash when saving separate resources that would exceed the Node buffer size limit. [#468](https://github.com/CesiumGS/gltf-pipeline/pull/468) ### 2.1.2 - 2019-03-14 -* Fixed reading absolute uris. [#466](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/466) +* Fixed reading absolute uris. [#466](https://github.com/CesiumGS/gltf-pipeline/pull/466) ### 2.1.1 - 2019-02-11 -* Added ability to apply Draco compression to meshes without indices. [#424](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/424) +* Added ability to apply Draco compression to meshes without indices. [#424](https://github.com/CesiumGS/gltf-pipeline/pull/424) ### 2.1.0 - 2019-01-28 -* Fixed a bug where nodes containing extensions or extras where being removed in the glTF 1.0 to 2.0 upgrade stage. [#431](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/431) -* Added support for the `EXT_texture_webp` extension. [#450](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/450) +* Fixed a bug where nodes containing extensions or extras where being removed in the glTF 1.0 to 2.0 upgrade stage. [#431](https://github.com/CesiumGS/gltf-pipeline/pull/431) +* Added support for the `EXT_texture_webp` extension. [#450](https://github.com/CesiumGS/gltf-pipeline/pull/450) ### 2.0.1 - 2018-09-19 -* Fixed a bug where the buffer `byteOffset` was not set properly when updating 1.0 accessor types to 2.0 allowed values. [#418](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/418) -* Fixed a bug where bufferViews were not properly byte aligned when updating accessors from 1.0 to 2.0. [#421](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/421) -* Fixed a bug in `removePipelineExtras` when run in the browser. [#422](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/422) +* Fixed a bug where the buffer `byteOffset` was not set properly when updating 1.0 accessor types to 2.0 allowed values. [#418](https://github.com/CesiumGS/gltf-pipeline/pull/418) +* Fixed a bug where bufferViews were not properly byte aligned when updating accessors from 1.0 to 2.0. [#421](https://github.com/CesiumGS/gltf-pipeline/pull/421) +* Fixed a bug in `removePipelineExtras` when run in the browser. [#422](https://github.com/CesiumGS/gltf-pipeline/pull/422) ### 2.0.0 - 2018-08-14 @@ -65,50 +65,50 @@ Change Log * Fixed a bug where generating normals and materials did not take image transparency into account ### 1.0.2 - 2017-09-27 -* Fixed specular computation for certain models using the `KHR_materials_common` extension. [#309](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/309) -* Added a `optimizeDrawCalls` flag to merge nodes and meshes more aggressively to minimize draw calls. [#308](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/308) -* Added minimum lighting to diffuse when the `cesium` flag is enabled. [#313](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/313) -* Added a check for normals arrtibute for mesh in `modelMaterialsCommon`. [#318](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/318) -* Fixed generating duplicate accessors in `cesiumGeometryToGltfPrimitive`. [#321](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/321) +* Fixed specular computation for certain models using the `KHR_materials_common` extension. [#309](https://github.com/CesiumGS/gltf-pipeline/pull/309) +* Added a `optimizeDrawCalls` flag to merge nodes and meshes more aggressively to minimize draw calls. [#308](https://github.com/CesiumGS/gltf-pipeline/pull/308) +* Added minimum lighting to diffuse when the `cesium` flag is enabled. [#313](https://github.com/CesiumGS/gltf-pipeline/pull/313) +* Added a check for normals arrtibute for mesh in `modelMaterialsCommon`. [#318](https://github.com/CesiumGS/gltf-pipeline/pull/318) +* Fixed generating duplicate accessors in `cesiumGeometryToGltfPrimitive`. [#321](https://github.com/CesiumGS/gltf-pipeline/pull/321) ### 1.0.1 - 2017-07-07 -* Fix `gltf-pipeline` to work with Cesium 1.36 and newer. +* Fix `gltf-pipeline` to work with CesiumJS 1.36 and newer. ### 1.0.0 - 2017-07-07 -* Fixed issue where shader comparison in `MergeDuplicateProperties` would cause a crash. [#297](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/297) -* Fixed an issue where `mergeBuffers` would not align buffer views to 4-byte boundaries. [#298](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/298) -* Fixed an issue where face normal generation would crash for degenerate triangles. [#298](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/298) +* Fixed issue where shader comparison in `MergeDuplicateProperties` would cause a crash. [#297](https://github.com/CesiumGS/gltf-pipeline/pull/297) +* Fixed an issue where `mergeBuffers` would not align buffer views to 4-byte boundaries. [#298](https://github.com/CesiumGS/gltf-pipeline/pull/298) +* Fixed an issue where face normal generation would crash for degenerate triangles. [#298](https://github.com/CesiumGS/gltf-pipeline/pull/298) ### 0.1.0-alpha15 - 2017-06-06 -* Fixed the `removeNormals` stage so that it can operate independently of `generateNormals`. [#287](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/287) -* Fixed an issue with writing attributes with double underscores, which is reserved in GLSL. [#286](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/286) -* Fixed issue with transparent diffuse texture overriding the render state of other materials. [#284](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/284) -* Fixed crash when loading a model with a huge number of textures. [#283](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/283) +* Fixed the `removeNormals` stage so that it can operate independently of `generateNormals`. [#287](https://github.com/CesiumGS/gltf-pipeline/pull/287) +* Fixed an issue with writing attributes with double underscores, which is reserved in GLSL. [#286](https://github.com/CesiumGS/gltf-pipeline/pull/286) +* Fixed issue with transparent diffuse texture overriding the render state of other materials. [#284](https://github.com/CesiumGS/gltf-pipeline/pull/284) +* Fixed crash when loading a model with a huge number of textures. [#283](https://github.com/CesiumGS/gltf-pipeline/pull/283) ### 0.1.0-alpha14 - 2017-05-09 -* Fixed byte offset alignment issue when loading converted models in Cesium. [#279](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/279) -* Added case-insensitive regex checking for image extensions. [#278](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/278) -* Added `mergeVertices` option to merge duplicate vertices. This operation is now disabled by default. [#276](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/276) +* Fixed byte offset alignment issue when loading converted models in CesiumJS. [#279](https://github.com/CesiumGS/gltf-pipeline/pull/279) +* Added case-insensitive regex checking for image extensions. [#278](https://github.com/CesiumGS/gltf-pipeline/pull/278) +* Added `mergeVertices` option to merge duplicate vertices. This operation is now disabled by default. [#276](https://github.com/CesiumGS/gltf-pipeline/pull/276) ### 0.1.0-alpha13 - 2017-04-27 -* Fixed a bug in `processModelMaterialsCommon` that produced out-of-spec technique states. [#269](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/269) +* Fixed a bug in `processModelMaterialsCommon` that produced out-of-spec technique states. [#269](https://github.com/CesiumGS/gltf-pipeline/pull/269) ### 0.1.0-alpha12 - 2017-04-13 -* Fixed issue with ambient occlusion not working correctly with other stages. [#267](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/267) -* Fixed handling of binary glTF with special characters. [#253](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/253) +* Fixed issue with ambient occlusion not working correctly with other stages. [#267](https://github.com/CesiumGS/gltf-pipeline/pull/267) +* Fixed handling of binary glTF with special characters. [#253](https://github.com/CesiumGS/gltf-pipeline/pull/253) ### 0.1.0-alpha11 - 2017-03-07 * Added `compressTextures` stage to compress input textures to a variety of compressed texture formats. * Optimized `mergeBuffers` to avoid repeated copies, drastically improving performance when there are lots of buffers to merge. * Fixed a bug in `addPipelineExtras` that made it try to add extras to null objects. * Expose `triangleAxisAlignedBoundingBoxOverlap`, an implementation of Tomas Akenine-Möller algorithm for determining if a triangle overlaps an axis aligned bounding box. -* Merged [gltf-statistics](https://github.com/AnalyticalGraphicsInc/gltf-statistics) as a stage in the pipeline. -* Added `updateVersion` stage for patching glTF `0.8` -> `1.0` changes; `addDefaults` no longer calls `processModelMaterialsCommon`. [#223](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/223) -* Added `build-cesium-combined` command to gulp file for generating simple files for other projects. [#231](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/231). -* Change Cesium `Geometry`'s and `VertexFormat`'s `binormal` attribute to bitangent. -* Fixed a bug in `combinePrimitives` where combining primitives can overflow uint16 for the resulting indices. [#230](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/230) -* Made `generateNormals` stage optional and added `smoothNormals` option for generating smooth normals if the model does not have normals. [#240](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/240) -* `updateVersion` stage for upgrades the glTF version of an asset from `1.0` to `2.0`. [#223](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/223) +* Merged [gltf-statistics](https://github.com/CesiumGS/gltf-statistics) as a stage in the pipeline. +* Added `updateVersion` stage for patching glTF `0.8` -> `1.0` changes; `addDefaults` no longer calls `processModelMaterialsCommon`. [#223](https://github.com/CesiumGS/gltf-pipeline/pull/223) +* Added `build-cesium-combined` command to gulp file for generating simple files for other projects. [#231](https://github.com/CesiumGS/gltf-pipeline/pull/231). +* Change CesiumJS `Geometry`'s and `VertexFormat`'s `binormal` attribute to bitangent. +* Fixed a bug in `combinePrimitives` where combining primitives can overflow uint16 for the resulting indices. [#230](https://github.com/CesiumGS/gltf-pipeline/issues/230) +* Made `generateNormals` stage optional and added `smoothNormals` option for generating smooth normals if the model does not have normals. [#240](https://github.com/CesiumGS/gltf-pipeline/pull/240) +* `updateVersion` stage for upgrades the glTF version of an asset from `1.0` to `2.0`. [#223](https://github.com/CesiumGS/gltf-pipeline/pull/223) * All pipeline stages now operate on glTF `2.0` assets. ### 0.1.0-alpha10 - 2017-01-10 @@ -127,24 +127,24 @@ Change Log ### 0.1.0-alpha6 - 2016-11-18 -* Fixed `combinePrimitives` stage and re-added it to the pipeline. [#108](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/108) -* Expose parsing argument arrays into an options object via `parseArguments`. [#183](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/183) +* Fixed `combinePrimitives` stage and re-added it to the pipeline. [#108](https://github.com/CesiumGS/gltf-pipeline/issues/108) +* Expose parsing argument arrays into an options object via `parseArguments`. [#183](https://github.com/CesiumGS/gltf-pipeline/pull/183) ### 0.1.0-alpha5 - 2016-11-02 -* Added `MergeDuplicateProperties` for stages merging duplicate glTF properties, like materials and shaders. [#152](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/152) +* Added `MergeDuplicateProperties` for stages merging duplicate glTF properties, like materials and shaders. [#152](https://github.com/CesiumGS/gltf-pipeline/pull/152) * `mergeDuplicateAccessors` is now a part of this stage. * `RemoveUnusedProperties` stage names are changed from `removeUnusedXXX` to `removeXXX`. `MergeDuplicateProperties` conforms to this naming convention. -* `quantizedAttributes` has an optional `normalized` flag to use the glTF 1.0.1 `accessor.normalized` for a higher precision decode matrix. [#165](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/165) -* Fixed an issue where pipeline extras are not removed when running `Pipeline.processJSON` and `Pipeline.processFile`. [#180](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/180) -* Added support for generating hard normals with the `-f` flag and for removing normals with `-r`. [#173](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/173) -* Preserve non-default shader attributes when generating shaders. [#175](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/175) -* The `_3DTILESDIFFUSE` semantic is added to the model's technique when `optimizeForCesium` is true. [#174](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/174) +* `quantizedAttributes` has an optional `normalized` flag to use the glTF 1.0.1 `accessor.normalized` for a higher precision decode matrix. [#165](https://github.com/CesiumGS/gltf-pipeline/pull/165) +* Fixed an issue where pipeline extras are not removed when running `Pipeline.processJSON` and `Pipeline.processFile`. [#180](https://github.com/CesiumGS/gltf-pipeline/pull/180) +* Added support for generating hard normals with the `-f` flag and for removing normals with `-r`. [#173](https://github.com/CesiumGS/gltf-pipeline/pull/173) +* Preserve non-default shader attributes when generating shaders. [#175](https://github.com/CesiumGS/gltf-pipeline/pull/175) +* The `_3DTILESDIFFUSE` semantic is added to the model's technique when `optimizeForCesium` is true. [#174](https://github.com/CesiumGS/gltf-pipeline/pull/174) ### 0.1.0-alpha4 - 2016-08-25 -* `cacheOptimization` no longer crashes on primitives without indices. [#154](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/154) -* Public API is exposed via `index.js` [#153](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/153) +* `cacheOptimization` no longer crashes on primitives without indices. [#154](https://github.com/CesiumGS/gltf-pipeline/issues/154) +* Public API is exposed via `index.js` [#153](https://github.com/CesiumGS/gltf-pipeline/issues/153) * Documentation has been added for all exposed functions. * `OptimizationStats` is removed from `removeUnused` stages. * `gltfPipeline.js` is now named `Pipeline.js`. @@ -155,12 +155,12 @@ Change Log ### 0.1.0-alpha3 - 2016-07-25 -* Converted the API to now use promises instead of callbacks. [#135](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/135) +* Converted the API to now use promises instead of callbacks. [#135](https://github.com/CesiumGS/gltf-pipeline/pull/135) ### 0.1.0-alpha2 - 2016-07-21 -* Fixed an issue causing some compressed accessors to not render. [#148](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/148) -* Fixed a quantization rounding issue. [#147](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/147) +* Fixed an issue causing some compressed accessors to not render. [#148](https://github.com/CesiumGS/gltf-pipeline/pull/148) +* Fixed a quantization rounding issue. [#147](https://github.com/CesiumGS/gltf-pipeline/pull/147) ### 0.1.0-alpha1 - 2016-07-20 diff --git a/LICENSE.md b/LICENSE.md index a0b9ec80..0fd3b21f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2015-2017 Richard Lee, Analytical Graphics, Inc., and Contributors +Copyright 2015-2020 Richard Lee, Cesium GS, Inc., and Contributors Apache License Version 2.0, January 2004 @@ -188,7 +188,7 @@ Copyright 2015-2017 Richard Lee, Analytical Graphics, Inc., and Contributors same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2015-2017 Richard Lee, Analytical Graphics, Inc., and Contributors + Copyright 2015-2020 Richard Lee, Cesium GS, Inc., and Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 5c7710ca..8850471c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # glTF Pipeline -[![License](https://img.shields.io/:license-apache-blue.svg)](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/master/LICENSE.md) -[![Build Status](https://travis-ci.org/AnalyticalGraphicsInc/gltf-pipeline.svg?branch=master)](https://travis-ci.org/AnalyticalGraphicsInc/gltf-pipeline) -[![Coverage Status](https://coveralls.io/repos/AnalyticalGraphicsInc/gltf-pipeline/badge.svg?branch=master)](https://coveralls.io/r/AnalyticalGraphicsInc/gltf-pipeline?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/AnalyticalGraphicsInc/gltf-pipeline.svg)](https://greenkeeper.io/) +[![License](https://img.shields.io/:license-apache-blue.svg)](https://github.com/CesiumGS/gltf-pipeline/blob/master/LICENSE.md) +[![Build Status](https://travis-ci.org/CesiumGS/gltf-pipeline.svg?branch=master)](https://travis-ci.org/CesiumGS/gltf-pipeline) +[![Coverage Status](https://coveralls.io/repos/CesiumGS/gltf-pipeline/badge.svg?branch=master)](https://coveralls.io/r/CesiumGS/gltf-pipeline?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/CesiumGS/gltf-pipeline.svg)](https://greenkeeper.io/)

-Content pipeline tools for optimizing [glTF](https://www.khronos.org/gltf) assets by [Richard Lee](http://leerichard.net/) and the [Cesium team](http://cesiumjs.org/). +Content pipeline tools for optimizing [glTF](https://www.khronos.org/gltf) assets by [Richard Lee](http://leerichard.net/) and the [Cesium team](https://cesium.com/). Supports common operations including: * Converting glTF to glb (and reverse) @@ -150,15 +150,15 @@ To run ESLint automatically when a file is saved, run the following and leave it npm run eslint-watch ``` -### Building for Cesium integration +### Building for CesiumJS integration -Some functionality of gltf-pipeline is used by Cesium as a third party library. The necessary files can be generated using: +Some functionality of gltf-pipeline is used by CesiumJS as a third party library. The necessary files can be generated using: ``` npm run build-cesium ``` -This will output a portion of the gltf-pipeline code into the `dist/cesium` folder for use with Cesium in the browser. +This will output a portion of the gltf-pipeline code into the `dist/cesium` folder for use with CesiumJS in the browser. ### Running Test Coverage @@ -181,4 +181,4 @@ The documentation will be placed in the `doc` folder. ## Contributions -Pull requests are appreciated! Please use the same [Contributor License Agreement (CLA)](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md) and [Coding Guide](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Documentation/Contributors/CodingGuide/README.md) used for [Cesium](http://cesiumjs.org/). +Pull requests are appreciated! Please use the same [Contributor License Agreement (CLA)](https://github.com/CesiumGS/cesium/blob/master/CONTRIBUTING.md) and [Coding Guide](https://github.com/CesiumGS/cesium/blob/master/Documentation/Contributors/CodingGuide/README.md) used for [Cesium](https://github.com/CesiumGS/cesium). diff --git a/package.json b/package.json index 072ad55c..071fe73e 100644 --- a/package.json +++ b/package.json @@ -5,21 +5,21 @@ "license": "Apache-2.0", "contributors": [ { - "name": "Richard Lee, Analytical Graphics, Inc., and Contributors", - "url": "https://github.com/AnalyticalGraphicsInc/gltf-pipeline/graphs/contributors" + "name": "Richard Lee, Cesium GS, Inc., and Contributors", + "url": "https://github.com/CesiumGS/gltf-pipeline/graphs/contributors" } ], "keywords": [ "glTF", "WebGL" ], - "homepage": "https://github.com/AnalyticalGraphicsInc/gltf-pipeline", + "homepage": "https://github.com/CesiumGS/gltf-pipeline", "repository": { "type": "git", - "url": "git@github.com:AnalyticalGraphicsInc/gltf-pipeline.git" + "url": "git@github.com:CesiumGS/gltf-pipeline.git" }, "bugs": { - "url": "https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues" + "url": "https://github.com/CesiumGS/gltf-pipeline/issues" }, "main": "index.js", "engines": { From d254bcbbd1fac7e6352ccfcb91f508fc736dafe6 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 18 Feb 2020 17:31:20 -0500 Subject: [PATCH 17/20] Remove .idea --- .idea/encodings.xml | 8 -------- .idea/gltf-pipeline.iml | 11 ----------- .idea/inspectionProfiles/Project_Default.xml | 6 ------ .idea/jsLibraryMappings.xml | 6 ------ .idea/misc.xml | 6 ------ .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 7 files changed, 51 deletions(-) delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/gltf-pipeline.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/jsLibraryMappings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index ff871d06..00000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/gltf-pipeline.iml b/.idea/gltf-pipeline.iml deleted file mode 100644 index bbdc004d..00000000 --- a/.idea/gltf-pipeline.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index c6cc8c81..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml deleted file mode 100644 index d23208fb..00000000 --- a/.idea/jsLibraryMappings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 28a804d8..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 8bf1c21f..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 215bbaaddbb7312096141cd92864c27585089ad2 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Mon, 2 Mar 2020 15:00:43 -0500 Subject: [PATCH 18/20] Remove unneeded Cesium.isArray usage `Cesium.isArray` is deprecated and Node code should just be calling `Array.isArray` directly anyway. --- lib/ForEach.js | 3 +-- lib/removeExtension.js | 3 +-- lib/updateVersion.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ForEach.js b/lib/ForEach.js index b29e6871..8f8fc2d4 100644 --- a/lib/ForEach.js +++ b/lib/ForEach.js @@ -3,7 +3,6 @@ const Cesium = require('cesium'); const hasExtension = require('./hasExtension'); const defined = Cesium.defined; -const isArray = Cesium.isArray; module.exports = ForEach; @@ -58,7 +57,7 @@ ForEach.object = function(arrayOfObjects, handler) { */ ForEach.topLevel = function(gltf, name, handler) { const gltfProperty = gltf[name]; - if (defined(gltfProperty) && !isArray(gltfProperty)) { + if (defined(gltfProperty) && !Array.isArray(gltfProperty)) { return ForEach.objectLegacy(gltfProperty, handler); } diff --git a/lib/removeExtension.js b/lib/removeExtension.js index 8c34e459..10b1da66 100644 --- a/lib/removeExtension.js +++ b/lib/removeExtension.js @@ -4,7 +4,6 @@ const ForEach = require('./ForEach'); const removeExtensionsUsed = require('./removeExtensionsUsed'); const defined = Cesium.defined; -const isArray = Cesium.isArray; module.exports = removeExtension; @@ -37,7 +36,7 @@ function removeCesiumRTC(gltf) { } function removeExtensionAndTraverse(object, extension) { - if (isArray(object)) { + if (Array.isArray(object)) { const length = object.length; for (let i = 0; i < length; ++i) { removeExtensionAndTraverse(object[i], extension); diff --git a/lib/updateVersion.js b/lib/updateVersion.js index 2e772f68..c3d02f9c 100644 --- a/lib/updateVersion.js +++ b/lib/updateVersion.js @@ -17,7 +17,6 @@ const clone = Cesium.clone; const ComponentDatatype = Cesium.ComponentDatatype; const defaultValue = Cesium.defaultValue; const defined = Cesium.defined; -const isArray = Cesium.isArray; const Matrix4 = Cesium.Matrix4; const Quaternion = Cesium.Quaternion; const WebGLConstants = Cesium.WebGLConstants; @@ -572,7 +571,7 @@ function removeEmptyArrays(gltf) { for (const topLevelId in gltf) { if (Object.prototype.hasOwnProperty.call(gltf, topLevelId)) { const array = gltf[topLevelId]; - if (isArray(array) && array.length === 0) { + if (Array.isArray(array) && array.length === 0) { delete gltf[topLevelId]; } } From 704706ad15bfce7d32461357bb071483cc6bde8e Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Mon, 2 Mar 2020 15:37:54 -0500 Subject: [PATCH 19/20] Updated to 2.1.7 --- CHANGES.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index cde37786..ee7cc2ef 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ Change Log ========== +### 2.1.7 - 2020-03-02 + +* Removed usage of deprecated function `Cesium.isArray`. [#526](https://github.com/CesiumGS/gltf-pipeline/pull/526) + ### 2.1.6 - 2020-02-04 * Fixed a mistake in the 2.1.5 release where the changes from [#516](https://github.com/CesiumGS/gltf-pipeline/pull/516) were accidentally removed. diff --git a/package.json b/package.json index 071fe73e..ca35f549 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gltf-pipeline", - "version": "2.1.6", + "version": "2.1.7", "description": "Content pipeline tools for optimizing glTF assets.", "license": "Apache-2.0", "contributors": [ From 78629fc253a59807823adc1a1d358c2ffa19e261 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Mon, 2 Mar 2020 15:41:41 -0500 Subject: [PATCH 20/20] Remove unused uuid module --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index ca35f549..b6a09f9c 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "fs-extra": "^8.1.0", "mime": "^2.4.4", "object-hash": "^2.0.1", - "uuid": "^3.4.0", "yargs": "^15.1.0" }, "devDependencies": {