from pygltflib import GLTF2

filenames = ["//store/data/projekte/284_COM_bubble/012_lufthansa/export/pavillon/pavillon_a_platziert.glb",
             "//store/data/projekte/284_COM_bubble/012_lufthansa/export/pavillon/pavillon_b_platziert.glb"]
for filename in filenames:
    glb = GLTF2().load(filename)
    mats = glb.materials
    for m in glb.materials:
        if m.name == "elm_leaf":
            m.alphaMode = "BLEND"
            m.doubleSided = True
            # m.pbrMetallicRoughness.baseColorFactor = [1.0, 1.0, 1.0, 0.5]
        if m.name == "grass__0":
            m.doubleSided = True
            m.alphaMode = "BLEND"
            # m.pbrMetallicRoughness.baseColorFactor = [1.0, 1.0, 1.0, 1.0]
        # if m.name == "briefe":
        #     m.doubleSided = True
        #     m.pbrMetallicRoughness.baseColorFactor = [1.0, 1.0, 1.0, 1.0]
    # glb.materials["transparent"].doubleSided=True
    # glb.materials["paper_single"].doubleSided=True
    glb.save(filename)
