1
$\begingroup$

I want to export objects that have multiple materials, without exporting the actual materials, since I'm making materials in Godot.

Disabling Geometry > Materials in the exporter makes it not export materials, but then I end up with only 1 material slot, when the meshes have faces assigned to multiple materials. I also tried having emptying the material slots in Blender, but that also makes them be exported with only 1 slot.

For example, I have this mesh:

tv mesh

It has 4 material slots:

materials in blender

The materials currently loaded in those slots are basic materials I make with only a color texture, just to help me UV map the meshes. I make the "real" materials in Godot, so I don't need to export them.

After importing to Godot, I load the real materials:

materials in godot

This is with Geometry > Materials enabled. With it disabled, or with empty slots in Blender, I only get 1 slot, with all faces assigned to it:

1 slot in godot

Apparently it's added automatically by Godot, since this glTF file has no materials node, unlike the one exported with materials.

This is the materials node in the glTF with materials exported:

"materials" : [
    {
        "doubleSided" : true,
        "emissiveFactor" : [
            0,
            0,
            0
        ],
        "name" : "plastic_black",
        "pbrMetallicRoughness" : {
            "baseColorTexture" : {
                "index" : 0,
                "texCoord" : 0
            },
            "metallicFactor" : 0,
            "roughnessFactor" : 0.5
        }
    },
    {
        "doubleSided" : true,
        "emissiveFactor" : [
            0,
            0,
            0
        ],
        "name" : "chrome",
        "pbrMetallicRoughness" : {
            "baseColorFactor" : [
                0.800000011920929,
                0.800000011920929,
                0.800000011920929,
                1
            ],
            "metallicFactor" : 1,
            "roughnessFactor" : 0.0416666679084301
        }
    },
    {
        "doubleSided" : true,
        "emissiveFactor" : [
            0,
            0,
            0
        ],
        "name" : "wood",
        "pbrMetallicRoughness" : {
            "baseColorTexture" : {
                "index" : 1,
                "texCoord" : 0
            },
            "metallicFactor" : 0,
            "roughnessFactor" : 0.5
        }
    },
    {
        "doubleSided" : true,
        "emissiveFactor" : [
            0,
            0,
            0
        ],
        "name" : "screen_padding",
        "pbrMetallicRoughness" : {
            "baseColorFactor" : [
                0,
                0,
                0,
                1
            ],
            "metallicFactor" : 0,
            "roughnessFactor" : 0.5
        }
    },
    {
        "doubleSided" : true,
        "emissiveFactor" : [
            0,
            0,
            0
        ],
        "name" : "screen",
        "pbrMetallicRoughness" : {
            "baseColorFactor" : [
                0.800000011920929,
                0.800000011920929,
                0.800000011920929,
                1
            ],
            "metallicFactor" : 0,
            "roughnessFactor" : 0.5
        }
    }
],

Changing it to this

"materials" : [
{},
{},
{},
{},
{}
],

does remove the materials and leave empty slots. Can I make it do this automatically? Also, Blender still exports textures, so I'll have to manually delete them every time as well.

$\endgroup$
1

Your Answer

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

Browse other questions tagged or ask your own question.