from pygltflib import GLTF2

filename = (
    "Z:/projekte/284_COM_bubble/009_zeitraum/export/raum_02_wald/raum_02_wald.glb"
)
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "lichtband_typo":
        m.alphaMode = "BLEND"
        m.doubleSided = True
    if m.name.startswith("exit__"):
        m.doubleSided = True
    if m.name.startswith("ground__"):
        m.doubleSided = True
    if m.name == "entrance_rebake":
        # m.alphaMode='BLEND'
        m.doubleSided = True
glb.save(filename)

filename = "Z:/projekte/284_COM_bubble/009_zeitraum/export/raum_02_wald/raum_02_wald_floor_gate.glb"
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name.startswith("ground__"):
        m.doubleSided = True
glb.save(filename)

filename = (
    "Z:/projekte/284_COM_bubble/009_zeitraum/export/raum_02_wald/raum_02_wald_dome.glb"
)
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "dome":
        m.alphaMode = "BLEND"
        m.doubleSided = True
        m.pbrMetallicRoughness.baseColorFactor = [1.0, 1.0, 1.0, 0.1]
glb.save(filename)

filename = "Z:/projekte/284_COM_bubble/009_zeitraum/export/raum_02_wald/raum_02_wald_lichtband.glb"
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "lichtband_typo":
        m.alphaMode = "BLEND"
        m.doubleSided = True
glb.save(filename)

filename = "Z:/projekte/284_COM_bubble/009_zeitraum/export/raum_02_wald/raum_02_wald_exit_doors_animated.glb"
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "entrance_rebake":
        # m.alphaMode='BLEND'
        m.doubleSided = True
glb.save(filename)

filename = "Z:/projekte/284_COM_bubble/009_zeitraum/export/raum_02_wald/raum_02_wald_trees_draco.gltf"
glb = GLTF2().load(filename)
mats = glb.materials
for m in glb.materials:
    if m.name == "tree__Twigs_Pale":
        m.doubleSided = True
    if m.name == "tree__Twigs":
        m.doubleSided = True
    if m.name == "tree__Bark_Branches":
        m.doubleSided = True
glb.save(filename)
