gltf-rs / gltf

A crate for loading glTF 2.0
Apache License 2.0
535 stars 124 forks source link

How to get the `TextureTransform` struct for a normal_texture #308

Open Dalot opened 3 years ago

Dalot commented 3 years ago

I am trying to mutate the offset data in a normal texture in a gltf file

"normalTexture": {
    "index": 10,
    "texCoord": 0,
    "extensions": {
        "KHR_texture_transform": {
            "offset": [
                0,
                -0.999999046
            ],
            "scale": [
                0.000244200259,
                8.06328753e-05
            ]
        }
    }
},

Although I can't see a way to get the TextureTransform struct from the NormalTexture. Is there a reason why it's not supported?

Edit: I think it's unfinished business...? If there is not any particular reason to not have the "extensions" part parsed, let me know that I can make an immediate PR.

SiebenCorgie commented 1 year ago

I think gltf::material::OcclusionTexture has the same problem.