glTF-Transform icon indicating copy to clipboard operation
glTF-Transform copied to clipboard

Add 'variants' lib and CLI function

Open donmccurdy opened this issue 4 years ago • 4 comments

See https://github.com/KhronosGroup/glTF/pull/1681, similar to https://github.com/facebookincubator/glTFVariantMeld. Would be added to the lib package and available through the CLI. Not sure whether the existing meld API is the right one, maybe this should take a config file pointing to external textures, and a single glTF, instead?

donmccurdy avatar Aug 13 '20 17:08 donmccurdy

The rationale behind the current meld API is so that you don't need to do the heavy lifting of figuring out which materials are shared and which aren't.

In practice, Shopify would expect merchants to upload to their product separate .glbs representing each variant. In the backend we would do all the basis, DRACO, LOD, etc... etc.... magic, as well as melding the variants together. It would be an automatic process.

pushmatrix avatar Aug 13 '20 23:08 pushmatrix

Ok, that makes sense — thanks!

donmccurdy avatar Aug 13 '20 23:08 donmccurdy

@echadwick-wayfair do you have any preferences on how a variant-authoring workflow might work for an artist? Would you want to export a GLB for each variant and then merge them into one GLB with variants? Or create a "source" file and somehow inject variants into that?

Trying to figure out how to add support here (via CLI and/or scripting), and then — potentially — someone else could use this tool to create a web UI to do the same.

donmccurdy avatar Jan 25 '21 21:01 donmccurdy

Lately I've been exporting variants models to ASCII glTFs, then manually editing one of them to add the variant syntax (copied directly from a Sample Model), then copying in the materials info from the other glTFs I exported. Visual Studio Code with the glTF Tools extension is pretty good for this.

It would be great to have it built into an exporter, like the Max2Babylon that we use here to export from 3ds Max. Then artists wouldn't have to do a bunch of typing. Max2Babylon has a nice multi-export GUI already, for splitting up a single scene file into multiple .glTF or .GLB files. It shouldn't be too hard to adapt a similar approach using Layers (or another common 3D scene organization system) to organize models & materials into their corresponding variants, then let the exporter combine them all.

image

In the meantime it would be nice to have a command-line tool that combined exported models together. I guess I should be using glTFVariantMeld, but that requires building it first which is a bit of a hurdle. https://github.com/facebookincubator/glTFVariantMeld

On Mon, Jan 25, 2021 at 4:19 PM Don McCurdy [email protected] wrote:

@echadwick-wayfair https://github.com/echadwick-wayfair do you have any preferences on how a variant-authoring workflow might work for an artist? Would you want to export a GLB for each variant and then merge them into one GLB with variants? Or create a "source" file and somehow inject variants into that?

Trying to figure out how to add support here (via CLI and/or scripting), and then — potentially — someone else could use this tool to create a web UI to do the same.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/donmccurdy/glTF-Transform/issues/64#issuecomment-767119491, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJSQ3DG5JRG2GSGJ6JRT36LS3XN6ZANCNFSM4P6VOEXQ .

echadwick-artist avatar Jan 25 '21 22:01 echadwick-artist

I'm concerned that I don't personally understand the requirements for what would make a good material variants implementation. For example, what the input files look like, what workflows are used to create them, and a sufficient number of examples to test.

I'd rather not implement this speculatively; it's a bit complex for that. But I would welcome PRs, or might be open to sponsored work to implement this with a team that has a clearer sense of the desired art workflow.

donmccurdy avatar Dec 21 '22 02:12 donmccurdy