Exporting mesh with materials

Hello guys,

I have an problem with export mesh with materials. I imported using datashmit a mesh. I assign a material with basecolor, roughness, metallic, specular and Normal textures. After that I select mesh, export it as Gltf and it exports only basecolor and normal. If I try export it as fbx, it exports just color and no textures.

What should I do? Is even possible to export mesh with material from UE5? I am using 5.1.1 version. Thanks.

I don’t think it’s possible :wink:

Also, same the other way around. You have to make the material manually after import.

1 Like

Allright…that’s very sad for me. So…do you have information about exporting export metadata? For example I have an mesh named “abc” with material named “xyz” which has specific basecolor, metal, rough…

and if is possible to export text file:

mesh: abc, material:xyz, basecolor: 125,125,125, roughness: 0.5, normal: location blabla name: aaaa.png
…

You can use python to import with metadata, I’m assuming it will go the other way too, but know very little about it

with gltf exporter you should be able to export the mesh with its materials and the textures used with the material.

It depends how complex is your material. If it is simple enough you should try to put “Disable” in material baking and UE should export the textures as used in UE
if you put “simple” or “Use Mesh Data” UE will bake the material on new textures.

look here for Bake Material Inputs

and here for Material Expression Matching

2 Likes

Thanks for your answer.

I get this warnings and after export with “Disable” in mat baking I get just base_color. Can you please help me with this?

EDIT: after I remove some “multiply” nodes from Normal, now I’m able to export Normal map also. But Metallic and roughness dont.

Hello. I would like to ask you, do you have some solution except solutions included in pasted link?

Can you show a screenshot for your material graph of “cdzxccd”?
or share the material asset and its textures so we have a look?

Basically, it is what I said earlier.
Either the material is simple enough: texture / color just applied to an input of material and that can be exported without being baked. If material expression does some computation or some convoluted stuff then that needs to be baked to textures as glTF does not use material graphs.
Then depending on the input used in your material, UE will bake texture for: bake color, normal, rougthness, etc.

This is how looks the material.

The dev says:
“It looks like the metallic and roughness uses the incorrect channels. The exporter’s pattern matching currently, requires that you use the same channels as glTF, i.e. B-channel for Metallic and G-channel for Roughness”

You will also have to have the same texture for metallic and roughness: metallic in B and Roughness in G. Else material matching does not work and exporter will request to do a baking. We are working to make that more flexible in the future.

So to use “Disable” you will need to do what is stated before.
Else if you bake to simple you should get textures but not the one as is in UE, some might be baked together and resolution will be the one specified in exporter.

1 Like