How to use the @gltf-transform/core.GLTFUtil.removeBuffer function in @gltf-transform/core

To help you get started, we’ve selected a few @gltf-transform/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github donmccurdy / glTF-Transform / packages / split / src / split.ts View on Github external
}
      })

      removedBufferViews.push(bufferViewIndex);
    });

  });

  // Removed emptied bufferviews.
  removedBufferViews.sort((a, b) => a > b ? -1 : 1);
  removedBufferViews.forEach((index) => GLTFUtil.removeBufferView(container, index));

  // Remove initial buffer, if empty.
  const buffer = json.buffers[0];
  if (buffer.byteLength === 0) {
    GLTFUtil.removeBuffer(container, 0);
  }

  return container;
}