Skip to content

Possibility to specify name for .bin files emmited from partition command? #412

Answered by donmccurdy
oddnugget asked this question in Q&A
Discussion options

You must be logged in to vote

If mesh.getName() is returning undefined, it's likely that GLTFExporter has not saved the name of the geometry in a location that's useful to the partitiion() function. glTF has "Mesh" and "Primitive" concepts, but neither is really a 1:1 counterpart to THREE.BufferGeometry.

You may need to use the scripting API to have more control of the bin file name, something like:

import { NodeIO } from '@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions';
import { partition } from '@gltf-transform/functions';

const io = new NodeIO().registerExtensions( KHRONOS_EXTENSIONS );

const document = io.read('./input.glb');

// Partition.
await document.transform( partition(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oddnugget
Comment options

Answer selected by oddnugget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants