Skip to content

Using setExtras() on gltf-transform CLI #1177

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

You must be logged in to vote

Hi @Utopiah and @coderofsalvation! The CLI doesn't provide any way to assign custom "extras" metadata today, unless you use a custom config.

Are you hoping to assign extras on the root of the glTF file, or to specific objects/meshes/materials/etc within the file? Different options might be easier depending on the purpose. Do you have a preference on how you'd want to do this?

It is definitely possible to use the scripting interface as well... would be something like:

import { NodeIO } from '@gltf-transform/core';
import { ALL_EXTENSIONS } from '@gltf-transform/extensions';

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

const document = await io.read('path/to/model.glb');

c…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Utopiah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants