from pygltflib import GLTF2

filename = "//store/data/projekte/284_COM_bubble/012_lufthansa/export/landschaft/landschaft.glb"
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "blue_glass":
        m.alphaMode = "BLEND"
        m.doubleSided = True
        m.pbrMetallicRoughness.baseColorFactor = [0.19, 0.56, 0.75, 0.9]
    # 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)

filename = "//store/data/projekte/284_COM_bubble/012_lufthansa/export/landschaft/landschaft_wasser.glb"
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "wasser":
        m.alphaMode = "BLEND"
        m.doubleSided = True
        m.pbrMetallicRoughness.baseColorFactor = [0.09779, 0.113369, 0.127, 0.8]
    # 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)
