Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gltf-pipeline

Package Overview
Dependencies
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gltf-pipeline - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

4

CHANGES.md
Change Log
==========
### 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)
### 2.1.2 - 2019-03-14

@@ -5,0 +9,0 @@

'use strict';
const BUFFER_MAX_BYTE_LENGTH = require('buffer').constants.MAX_LENGTH;
const Cesium = require('cesium');

@@ -26,3 +27,12 @@ const ForEach = require('./ForEach');

let buffersByteLength = 0;
ForEach.buffer(gltf, function(buffer) {
buffersByteLength += buffer.extras._pipeline.source.length;
});
// Don't merge buffers if the merged buffer will exceed the Node limit.
const splitBuffers = (buffersByteLength > mergeBuffers._getBufferMaxByteLength());
const buffersToMerge = {};
const mergedNameCount = {};

@@ -33,2 +43,10 @@ ForEach.bufferView(gltf, function(bufferView) {

mergedName = defined(mergedName) ? baseBufferName + '-' + mergedName : baseBufferName;
if (splitBuffers) {
if (!defined(mergedNameCount[mergedName])) {
mergedNameCount[mergedName] = 0;
}
mergedName += '-' + mergedNameCount[mergedName]++;
}
if (!defined(buffersToMerge[mergedName])) {

@@ -47,4 +65,6 @@ buffersToMerge[mergedName] = {

const bufferViewPadding = allocateBufferPadding(byteLength);
buffers.push(bufferViewPadding);
byteLength += bufferViewPadding.byteLength;
if (defined(bufferViewPadding)) {
buffers.push(bufferViewPadding);
byteLength += bufferViewPadding.byteLength;
}

@@ -69,4 +89,6 @@ bufferView.byteOffset = byteLength;

const bufferPadding = allocateBufferPadding(byteLength);
buffers.push(bufferPadding);
const mergedSource = Buffer.concat(buffers);
if (defined(bufferPadding)) {
buffers.push(bufferPadding);
}
const mergedSource = (buffers.length > 1) ? Buffer.concat(buffers) : buffers[0];
gltf.buffers[index] = {

@@ -93,3 +115,8 @@ name: mergedName,

}
return Buffer.alloc(0);
return undefined;
}
// Exposed for testing
mergeBuffers._getBufferMaxByteLength = function() {
return BUFFER_MAX_BYTE_LENGTH;
};

2

package.json
{
"name": "gltf-pipeline",
"version": "2.1.2",
"version": "2.1.3",
"description": "Content pipeline tools for optimizing glTF assets.",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc