Skip to content

Commit

Permalink
Merge branch 'master' into duplicate-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Mar 27, 2020
2 parents 1d1990e + 06d86a9 commit 3a1a446
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Change Log

* Fixed writing duplicate resource that are referenced multiple times. [#483](https://github.com/AnalyticalGraphicsInc/gltf-pipeline/pull/483)

### 2.1.8 - 2020-03-04

* Fixed a bug in `processGltf` and `gltfToGlb` where the user's `options` object was getting modified with internal options. [#528](https://github.com/CesiumGS/gltf-pipeline/pull/528)

### 2.1.7 - 2020-03-02

* Removed usage of deprecated function `Cesium.isArray`. [#526](https://github.com/CesiumGS/gltf-pipeline/pull/526)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![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/)

<p align="center">
<a href="https://www.khronos.org/gltf"><img src="doc/gltf.png" onerror="this.src='gltf.png'"/></a>
Expand Down
4 changes: 2 additions & 2 deletions lib/gltfToGlb.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Cesium = require('cesium');
const getJsonBufferPadded = require('./getJsonBufferPadded');
const processGltf = require('./processGltf');

const defaultValue = Cesium.defaultValue;
const clone = Cesium.clone;
const defined = Cesium.defined;

module.exports = gltfToGlb;
Expand All @@ -16,7 +16,7 @@ module.exports = gltfToGlb;
* @returns {Promise} A promise that resolves to a buffer containing the glb contents.
*/
function gltfToGlb(gltf, options) {
options = defaultValue(options, {});
options = defined(options) ? clone(options) : {};
options.bufferStorage = {
buffer: undefined
};
Expand Down
3 changes: 2 additions & 1 deletion lib/processGltf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const updateVersion = require('./updateVersion');
const writeResources = require('./writeResources');
const compressDracoMeshes = require('./compressDracoMeshes');

const clone = Cesium.clone;
const defaultValue = Cesium.defaultValue;
const defined = Cesium.defined;

Expand All @@ -35,7 +36,7 @@ module.exports = processGltf;
*/
function processGltf(gltf, options) {
const defaults = processGltf.defaults;
options = defaultValue(options, {});
options = defined(options) ? clone(options) : {};
options.separateBuffers = defaultValue(options.separate, defaults.separate);
options.separateShaders = defaultValue(options.separate, defaults.separate);
options.separateTextures = defaultValue(options.separateTextures, defaults.separateTextures) || options.separate;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gltf-pipeline",
"version": "2.1.7",
"version": "2.1.8",
"description": "Content pipeline tools for optimizing glTF assets.",
"license": "Apache-2.0",
"contributors": [
Expand Down

0 comments on commit 3a1a446

Please sign in to comment.