1
$\begingroup$

I am new to Blender, and trying to export a tshirt Blender model in gltf format. This model has individual materials for example front, back, collar (as given in the attached picture) etc., and also a material called "whole_design" that covers the entire model.

But when I export this model in gltf/glb format, I could see only "whole_design" material being exported and not the individual (front, back etc.) materials.

Is it possible to export the overlapping materials? Or am I doing any mistakes while setting up the Blender model or exporting the same.

Thanks in advance.

enter image description here

$\endgroup$
1
  • $\begingroup$ A face can only be tied to one material. I guess the exporter gets rid of unused materials when exporting, or gtlf format doesn't support materials with no tied face. I think you want to use different UV maps rather than materials, since a face can indeed support several uv maps (8 to be exact in Blender) $\endgroup$
    – Gorgious
    May 19 at 8:41
1
$\begingroup$

The glTF exporter in Blender won't use materials that aren't assigned, and as mentioned in the comment above, only one material may be assigned per face.

But, glTF also has a relatively new extension called KHR_materials_variants that allows certain viewers to automatically swap between materials on an asset. Check out the announcement of that extension which includes an embedded demo.

Screenshot of glTF with multiple materials

I haven't tried this myself yet, but you may also want to take a look at a Blender glTF material variants plugin which is in early devlopment by one of the ThreeJS/Hubs contributors. It actually plugs in to the existing glTF addon, creating some new Blender UI for assigning multiple materials, while still making use of the official Khronos glTF exporter for the final result.

There's also a glTF Meld Tool. I haven't tried this either, but this tool is said to take glTFs with identical geometry, where only the materials are different, and automatically meld them into a single glTF with KHR_materials_variants applied to it.

$\endgroup$
1
  • $\begingroup$ Thanks emackey! $\endgroup$
    – Mayank
    May 29 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.