Python script - objects are grey after export to glb file There is my short code. I'm using blender_osm addon to generate these buildings. After the first render, it looks fine with colors on textures. But when I export it and reopen all textures are grey. What am I doing wrong?
import bpy


class PrepareModels(bpy.types.Operator):
    bl_idname = &quot;wm.prepare_models&quot;
    bl_label = &quot;Minimal Operator&quot;

    def execute(self, context):         
  
        context = bpy.context
        scene = context.scene
        
        bpy.ops.blender_osm.import_data()

        context.scene.blender_osm.dataType = 'osm'
        bpy.ops.blender_osm.import_data()

        bpy.ops.export_scene.gltf(filepath=&quot;/tmp/{}.glb&quot;.format(filename))
 
        return {'FINISHED'}
    
  
bpy.utils.register_class(PrepareModels)

bpy.ops.wm.prepare_models()

After @emackey comment I tried to convert one of my material using from bpy_extras.node_shader_utils import PrincipledBSDFWrapper as is said here https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Modules like this:
        mat = bpy.data.materials['wall']
        mat.use_nodes = True
        principled = PrincipledBSDFWrapper(mat, is_readonly=True)
        base_color = principled.base_color
        specular_texture = principled.specular_texture
        if specular_texture and specular_texture.image:
            specular_texture_filepath = principled.specular_texture.image.filepath

and also lik that:
        newmat = bpy.data.materials['wall']
        newmat.use_nodes = True
        node_tree = newmat.node_tree
        nodes = node_tree.nodes

        bsdf = nodes.get(&quot;Principled BSDF&quot;) 

        vcol = nodes.new(type=&quot;ShaderNodeVertexColor&quot;)
        vcol.layer_name = &quot;VColor&quot; # the vertex color layer name

        # make links
        node_tree.links.new(vcol.outputs[0], bsdf.inputs[0])

but it doesn't help
glTF (GLB) uses a PBR material system, and the Blender exporter requires the exported materials to use the &quot;Principled BSDF&quot; node.  The glTF material system is documented in the Blender Manual.
If the blender_osm addon is producing materials based on the Diffuse node or similar, these won't export correctly in the current version of the glTF exporter.  Your script will need to convert these materials to use Principled BSDF.